summaryrefslogtreecommitdiff
path: root/src/net/playerhandler.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-12-30 23:26:18 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-12-30 23:26:18 +0000
commitd464d0912e202c11d69d8e33bae8c18304760087 (patch)
tree3b5fcfa01ecc5277f2a23dd46db0a30a0c320d89 /src/net/playerhandler.cpp
parent9266a94488be76e8cb9700a1426832dfc914320c (diff)
downloadmana-d464d0912e202c11d69d8e33bae8c18304760087.tar.gz
mana-d464d0912e202c11d69d8e33bae8c18304760087.tar.bz2
mana-d464d0912e202c11d69d8e33bae8c18304760087.tar.xz
mana-d464d0912e202c11d69d8e33bae8c18304760087.zip
Updated protocol.
Diffstat (limited to 'src/net/playerhandler.cpp')
-rw-r--r--src/net/playerhandler.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp
index 79875d1c..988a9a68 100644
--- a/src/net/playerhandler.cpp
+++ b/src/net/playerhandler.cpp
@@ -79,6 +79,7 @@ PlayerHandler::PlayerHandler()
//SMSG_PLAYER_STAT_UPDATE_6,
//SMSG_PLAYER_ARROW_MESSAGE,
GPMSG_PLAYER_MAP_CHANGE,
+ GPMSG_PLAYER_SERVER_CHANGE,
0
};
handledMessages = _messages;
@@ -92,6 +93,15 @@ void PlayerHandler::handleMessage(MessageIn &msg)
handleMapChangeMessage(msg);
break;
+ case GPMSG_PLAYER_SERVER_CHANGE:
+ { // TODO: Implement reconnecting to another game server
+ std::string token = msg.readString(32);
+ std::string address = msg.readString();
+ int port = msg.readShort();
+ logger->log("Changing server to %s:%d", address.c_str(), port);
+ } break;
+
+ /*
case SMSG_PLAYER_STAT_UPDATE_1:
{
Sint16 type = msg.readShort();
@@ -287,21 +297,18 @@ void PlayerHandler::handleMessage(MessageIn &msg)
}
}
break;
+ */
}
}
void
PlayerHandler::handleMapChangeMessage(MessageIn &msg)
{
- // { "mapname", x, y, B new server [, token, "gameserver", W port] }
-
std::string mapName = msg.readString();
unsigned short x = msg.readShort();
unsigned short y = msg.readShort();
- unsigned char newServer = msg.readByte();
- logger->log("Changing map to %s (%d, %d) on %s server",
- mapName.c_str(), x, y, (newServer) ? "another" : "same");
+ logger->log("Changing map to %s (%d, %d)", mapName.c_str(), x, y);
// Switch the actual map, deleting the previous one
engine->changeMap(mapName);
@@ -309,15 +316,6 @@ PlayerHandler::handleMapChangeMessage(MessageIn &msg)
current_npc = 0;
player_node->setAction(Being::STAND);
-
player_node->mX = x;
player_node->mY = y;
-
- if (newServer)
- {
- // TODO: Implement reconnecting to another game server
- //std::string token = msg.readString(32);
- //std::string gameServer = msg.readString();
- //unsigned short gameServerPort = msg.readShort();
- }
}