diff options
author | Rogier Polak <rogier.l.a.polak@gmail.com> | 2007-03-20 00:18:21 +0000 |
---|---|---|
committer | Rogier Polak <rogier.l.a.polak@gmail.com> | 2007-03-20 00:18:21 +0000 |
commit | ed0e4fd21544d2c3e0a8494c6f48fc905afda04f (patch) | |
tree | 2c3cc326e5797670e137bdf610f3ec751c92c017 | |
parent | d0fa28b3820551adf5f4075355b05d19d7c43806 (diff) | |
download | manaserv-ed0e4fd21544d2c3e0a8494c6f48fc905afda04f.tar.gz manaserv-ed0e4fd21544d2c3e0a8494c6f48fc905afda04f.tar.bz2 manaserv-ed0e4fd21544d2c3e0a8494c6f48fc905afda04f.tar.xz manaserv-ed0e4fd21544d2c3e0a8494c6f48fc905afda04f.zip |
Corrected a bug, that occurred when connecting to the game-server.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/account-server/accounthandler.cpp | 2 | ||||
-rw-r--r-- | src/game-server/gamehandler.cpp | 2 | ||||
-rw-r--r-- | src/utils/tokencollector.hpp | 12 |
4 files changed, 15 insertions, 8 deletions
@@ -1,3 +1,10 @@ +2007-03-20 Rogier Polak <rogier.l.a.polak@gmail.com> + + * src/account-server/accounthandler.cpp, src/utils/tokencollector.hpp, + src/game-server/gamehandler.cpp: Corrected a bug, that occurred when + connecting to the game-server. Made member functions of TokenCollector + less fragile. + 2007-03-19 Philipp Sehmisch <tmw@crushnet.org> * src/game-server/gamehandler.cpp, src/game-server/gamehandler.hpp, diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index 726b1b8d..48a72548 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -268,7 +268,7 @@ handleReconnectMessage(AccountClient &computer, MessageIn &msg) if (computer.status != CLIENT_LOGIN) { LOG_DEBUG("Account tried to reconnect, but was allready logged in " - << "or quequed."); + << "or queued."); return; } diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp index a13edc2c..81f7a1e5 100644 --- a/src/game-server/gamehandler.cpp +++ b/src/game-server/gamehandler.cpp @@ -124,8 +124,8 @@ void GameHandler::processMessage(NetComputer *comp, MessageIn &message) if (message.getId() != PGMSG_CONNECT) return; std::string magic_token = message.readString(MAGIC_TOKEN_LENGTH); + computer.status = CLIENT_QUEUED; // Before the addPendingClient mTokenCollector.addPendingClient(magic_token, &computer); - computer.status = CLIENT_QUEUED; return; } else if (computer.status != CLIENT_CONNECTED) diff --git a/src/utils/tokencollector.hpp b/src/utils/tokencollector.hpp index aaee191e..b94643be 100644 --- a/src/utils/tokencollector.hpp +++ b/src/utils/tokencollector.hpp @@ -211,10 +211,10 @@ addPendingClient(const std::string & token, U clientPayload) // --------------------------------------------- if (((TC_ListItem< V >*)*it)->token == token) // Found a match { - mOwner->tokenMatched(clientPayload, - ((TC_ListItem< V >*)*it)->payload); - delete ((TC_ListItem< V >*)*it); + TC_ListItem< V >* tempConnect = (TC_ListItem< V >*)*it; mPendingConnects.erase(it); + mOwner->tokenMatched(clientPayload, tempConnect->payload); + delete tempConnect; return; // Done } } @@ -269,10 +269,10 @@ addPendingConnect(const std::string & token, V connectPayload) // --------------------------------------------- if (((TC_ListItem< U >*)*it)->token == token) // Found a match { - mOwner->tokenMatched(((TC_ListItem< U >*)*it)->payload, - connectPayload); - delete ((TC_ListItem< U >*)*it); + TC_ListItem< U >* tempClient = (TC_ListItem< U >*)*it; mPendingClients.erase(it); + mOwner->tokenMatched(tempClient->payload, connectPayload); + delete tempClient; return; // Done } } |