diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-12-30 18:41:04 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-12-30 18:41:04 +0000 |
commit | 7f1c499e4e09ab939d6d31188aaaaf785250a1d5 (patch) | |
tree | 0d57377da58cf9817b0261130e0812870c0da1f1 /src/account-server | |
parent | af8b15193ebaed1de77a8a77ec2a0fed75a0d253 (diff) | |
download | manaserv-7f1c499e4e09ab939d6d31188aaaaf785250a1d5.tar.gz manaserv-7f1c499e4e09ab939d6d31188aaaaf785250a1d5.tar.bz2 manaserv-7f1c499e4e09ab939d6d31188aaaaf785250a1d5.tar.xz manaserv-7f1c499e4e09ab939d6d31188aaaaf785250a1d5.zip |
Controlled map activation from the account server, so that clients are not kept on the wrong server when warped.
Diffstat (limited to 'src/account-server')
-rw-r--r-- | src/account-server/serverhandler.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/account-server/serverhandler.cpp b/src/account-server/serverhandler.cpp index 99d872f8..7de37126 100644 --- a/src/account-server/serverhandler.cpp +++ b/src/account-server/serverhandler.cpp @@ -109,9 +109,15 @@ void ServerHandler::processMessage(NetComputer *comp, MessageIn &msg) while (msg.getUnreadLength()) { - unsigned id = msg.readShort(); + int id = msg.readShort(); LOG_INFO("Registering map " << id << '.', 0); - if (!servers.insert(std::make_pair(id, s)).second) + if (servers.insert(std::make_pair(id, s)).second) + { + MessageOut outMsg(AGMSG_ACTIVE_MAP); + outMsg.writeShort(id); + comp->send(outMsg); + } + else { LOG_ERROR("Server Handler: map is already registered.", 0); } |