diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2009-10-06 23:40:55 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2009-10-06 23:43:40 +0200 |
commit | 64a37da4cb8d74a29f369e96e8c3669275516394 (patch) | |
tree | caa0eb0d05ab5674b6b6ac822d151aa2585721e8 /src/net/ea/gamehandler.cpp | |
parent | 610dc30ceecdfe538f71826689630e0f28c278cc (diff) | |
download | mana-64a37da4cb8d74a29f369e96e8c3669275516394.tar.gz mana-64a37da4cb8d74a29f369e96e8c3669275516394.tar.bz2 mana-64a37da4cb8d74a29f369e96e8c3669275516394.tar.xz mana-64a37da4cb8d74a29f369e96e8c3669275516394.zip |
Some cleanup regarding keeping track of gender for eAthena
LoginHandler now owns the world list and the token, instead of having
them as global variables with pointers to the 'sex' member of the token
from the GUI.
Diffstat (limited to 'src/net/ea/gamehandler.cpp')
-rw-r--r-- | src/net/ea/gamehandler.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index f84688a3..a3c0ad3a 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -21,6 +21,7 @@ #include "net/ea/gamehandler.h" +#include "net/ea/loginhandler.h" #include "net/ea/network.h" #include "net/ea/protocol.h" @@ -41,7 +42,7 @@ Net::GameHandler *gameHandler; extern Game *game; namespace EAthena { -extern Token netToken; + extern ServerInfo mapServer; GameHandler::GameHandler() @@ -91,16 +92,19 @@ void GameHandler::connect() { mNetwork->connect(mapServer); + const Token &token = + static_cast<LoginHandler*>(Net::getLoginHandler())->getToken(); + // Send login infos MessageOut outMsg(CMSG_MAP_SERVER_CONNECT); - outMsg.writeInt32(netToken.account_ID); + outMsg.writeInt32(token.account_ID); outMsg.writeInt32(player_node->getId()); - outMsg.writeInt32(netToken.session_ID1); - outMsg.writeInt32(netToken.session_ID2); - outMsg.writeInt8((netToken.sex == GENDER_MALE) ? 1 : 0); + outMsg.writeInt32(token.session_ID1); + outMsg.writeInt32(token.session_ID2); + outMsg.writeInt8((token.sex == GENDER_MALE) ? 1 : 0); // Change the player's ID to the account ID to match what eAthena uses - player_node->setId(netToken.account_ID); + player_node->setId(token.account_ID); // We get 4 useless bytes before the real answer comes in (what are these?) mNetwork->skip(4); |