diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/chat-server/chathandler.cpp | 8 | ||||
-rw-r--r-- | src/game-server/accountconnection.cpp | 2 | ||||
-rw-r--r-- | src/game-server/gamehandler.cpp | 2 |
4 files changed, 17 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2007-02-23 Rogier Polak <rogier.l.a.polak@gmail.com> + + * src/chat-server/chathandler.cpp: Added disconnect. + * src/game-server/gamehandler.cpp, + src/game-server/accountconnection.cpp: Bugfixes related to + switch_character. + 2007-02-04 Rogier Polak <rogier_polak@users.sourceforge.net> * src/chat-server/chathandler.cpp, diff --git a/src/chat-server/chathandler.cpp b/src/chat-server/chathandler.cpp index 8269a6be..589f1e43 100644 --- a/src/chat-server/chathandler.cpp +++ b/src/chat-server/chathandler.cpp @@ -444,6 +444,14 @@ void ChatHandler::processMessage(NetComputer *comp, MessageIn &message) } break; + case PCMSG_DISCONNECT: + { + result.writeShort(CPMSG_DISCONNECT_RESPONSE); + result.writeByte(ERRMSG_OK); + chatChannelManager->removeUserFromEveryChannels(computer.characterName); + } + break; + default: LOG_WARN("ChatHandler::processMessage, Invalid message type" << message.getId()); diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp index a5c7bddd..e380d25a 100644 --- a/src/game-server/accountconnection.cpp +++ b/src/game-server/accountconnection.cpp @@ -104,7 +104,7 @@ void AccountConnection::playerReconnectAccount(int id, const std::string magic_t LOG_INFO("Send GAMSG_PLAYER_RECONNECT."); MessageOut msg(GAMSG_PLAYER_RECONNECT); msg.writeLong(id); - msg.writeString(magic_token); + msg.writeString(magic_token, 32); send(msg); } diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp index 05e4d2b0..5801c6fe 100644 --- a/src/game-server/gamehandler.cpp +++ b/src/game-server/gamehandler.cpp @@ -309,7 +309,7 @@ void GameHandler::processMessage(NetComputer *comp, MessageIn &message) bool reconnectAccount = (bool) message.readByte(); result.writeShort(GPMSG_DISCONNECT_RESPONSE); - result.writeShort(ERRMSG_OK); // It is when control reaches here + result.writeByte(ERRMSG_OK); // It is, when control reaches here if (reconnectAccount) { |