summaryrefslogtreecommitdiff
path: root/src/net/loginhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/loginhandler.cpp')
-rw-r--r--src/net/loginhandler.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp
index d65f7001..5b8fbd1f 100644
--- a/src/net/loginhandler.cpp
+++ b/src/net/loginhandler.cpp
@@ -27,12 +27,10 @@
#include "network.h"
#include "protocol.h"
+#include "../localplayer.h"
#include "../log.h"
#include "../logindata.h"
#include "../main.h"
-#include "../serverinfo.h"
-
-extern SERVER_INFO **server_info;
LoginHandler::LoginHandler()
{
@@ -56,9 +54,19 @@ void LoginHandler::handleMessage(MessageIn *msg)
charNumber = msg->readByte();
printf("Account has %i characters:\n", charNumber);
for (unsigned int i = 0; i < charNumber; i++) {
- printf("%i) %s\n", i, msg->readString().c_str());
+ // Create a temp empty player to show up in character
+ // selection dialog
+ LocalPlayer *temp = new LocalPlayer(0, 0, 0);
+ temp->setName(msg->readString());
+ temp->setSex(msg->readByte());
+ temp->setHairStyle(msg->readByte());
+ temp->setHairColor(msg->readByte());
+ temp->mLevel = msg->readByte();
+ temp->mGp = msg->readShort();
+ mCharInfo->select(i);
+ mCharInfo->setEntry(temp);
}
- state = CHAR_SERVER_STATE;
+ state = CHAR_SELECT_STATE;
}
// Login failed
else