summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-20 14:29:05 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-20 14:29:05 +0000
commit292f3e50a59b06bf129893b352466d7d54fa3d71 (patch)
tree7150b66c08c3dd83e79baef52332922ba3ab324d /src/main.cpp
parent0c90838cef0d75e14097dc66c6b5210eef976029 (diff)
downloadmana-292f3e50a59b06bf129893b352466d7d54fa3d71.tar.gz
mana-292f3e50a59b06bf129893b352466d7d54fa3d71.tar.bz2
mana-292f3e50a59b06bf129893b352466d7d54fa3d71.tar.xz
mana-292f3e50a59b06bf129893b352466d7d54fa3d71.zip
Fixed selection of player character and implemented sending of game and chat
server tokens. It gets you in the game (or what's left of it), but not on any map yet.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/main.cpp b/src/main.cpp
index d62594c9..ef5557ec 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -80,6 +80,7 @@
// Account infos
char n_character;
+std::string token;
std::vector<Spriteset *> hairset;
Spriteset *playerset[2];
@@ -456,20 +457,16 @@ void accountRegister(LoginData *loginData)
void mapLogin(Network *network, LoginData *loginData)
{
- // TODO: Before the client has been identified using the magic token, the
- // map path is not known yet.
- logger->log("Map: %s", map_path.c_str());
-
network->registerHandler(&mapLoginHandler);
- // Send login infos
- // TODO: The token would need to be sent to complete client identification
- // for the game server
- //MessageOut outMsg(0x0072);
- //outMsg.writeLong(loginData->account_ID);
- //outMsg.writeLong(player_node->mCharId);
- //outMsg.writeLong(loginData->session_ID1);
- //outMsg.writeLong(loginData->session_ID2);
+ // Send connect messages with the magic token to game and chat servers
+ MessageOut gameServerConnect(PGMSG_CONNECT);
+ gameServerConnect.writeString(token, 32);
+ network->send(Network::GAME, gameServerConnect);
+
+ MessageOut chatServerConnect(PCMSG_CONNECT);
+ chatServerConnect.writeString(token, 32);
+ network->send(Network::CHAT, chatServerConnect);
}
/** Main */
@@ -689,11 +686,11 @@ int main(int argc, char *argv[])
case STATE_CONNECT_GAME:
logger->log("State: CONNECT_GAME");
- mapLogin(network, &loginData);
currentDialog = new ConnectionDialog();
break;
case STATE_GAME:
+ mapLogin(network, &loginData);
sound.fadeOutMusic(1000);
currentDialog = NULL;