diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/accountserver/account.cpp | 14 | ||||
-rw-r--r-- | src/net/accountserver/account.h | 4 | ||||
-rw-r--r-- | src/net/playerhandler.cpp | 26 | ||||
-rw-r--r-- | src/net/protocol.h | 14 |
4 files changed, 17 insertions, 41 deletions
diff --git a/src/net/accountserver/account.cpp b/src/net/accountserver/account.cpp index 385cd77a..7275cacc 100644 --- a/src/net/accountserver/account.cpp +++ b/src/net/accountserver/account.cpp @@ -100,17 +100,3 @@ void Net::AccountServer::Account::changePassword( Net::AccountServer::connection->send(msg); } - -void Net::AccountServer::Account::enterWorld() -{ - MessageOut msg(PAMSG_ENTER_WORLD); - - Net::AccountServer::connection->send(msg); -} - -void Net::AccountServer::Account::enterChat() -{ - MessageOut msg(PAMSG_ENTER_CHAT); - - Net::AccountServer::connection->send(msg); -} diff --git a/src/net/accountserver/account.h b/src/net/accountserver/account.h index 8e46eaa5..368623e6 100644 --- a/src/net/accountserver/account.h +++ b/src/net/accountserver/account.h @@ -49,10 +49,6 @@ namespace Net void changePassword(const std::string &oldPassowrd, const std::string &newPassword); - - void enterWorld(); - - void enterChat(); } } } 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(); - } } diff --git a/src/net/protocol.h b/src/net/protocol.h index 80ad48af..de908c53 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -129,28 +129,24 @@ enum { APMSG_CHAR_CREATE_RESPONSE = 0x0021, // B error PAMSG_CHAR_DELETE = 0x0022, // B index APMSG_CHAR_DELETE_RESPONSE = 0x0023, // B error - APMSG_CHAR_INFO = 0x0024, // B index, S name, B gender, B hair style, B hair color, B level, W money, W*6 stats, S mapname, W*2 position - APMSG_CHAR_LIST_RESPONSE = 0x0025, // B number, { B index, S name, B gender, B hair style, B hair color, B level, W money, W*6 stats, S mapname, W*2 position }* + APMSG_CHAR_INFO = 0x0024, // B index, S name, B gender, B hair style, B hair color, B level, W money, W*6 stats PAMSG_CHAR_SELECT = 0x0026, // B index - APMSG_CHAR_SELECT_RESPONSE = 0x0027, // B error, S mapname, W*2 position + APMSG_CHAR_SELECT_RESPONSE = 0x0027, // B error, B*32 token, S game address, W game port, S chat address, W chat port PAMSG_EMAIL_CHANGE = 0x0030, // S email APMSG_EMAIL_CHANGE_RESPONSE = 0x0031, // B error PAMSG_EMAIL_GET = 0x0032, // - APMSG_EMAIL_GET_RESPONSE = 0x0033, // B error, S email PAMSG_PASSWORD_CHANGE = 0x0034, // S old password, S new password APMSG_PASSWORD_CHANGE_RESPONSE = 0x0035, // B error - PAMSG_ENTER_WORLD = 0x0040, // - - APMSG_ENTER_WORLD_RESPONSE = 0x0041, // B error, S address, W port, B*32 token - PAMSG_ENTER_CHAT = 0x0042, // - - APMSG_ENTER_CHAT_RESPONSE = 0x0043, // B error, S address, W port, B*32 token + PGMSG_CONNECT = 0x0050, // B*32 token GPMSG_CONNECT_RESPONSE = 0x0051, // B error PCMSG_CONNECT = 0x0053, // B*32 token CPMSG_CONNECT_RESPONSE = 0x0054, // B error // Game - GPMSG_PLAYER_MAP_CHANGE = 0x0100, // S filename, W x, W y, B newserv - // [, S32 token, S server, W port] + GPMSG_PLAYER_MAP_CHANGE = 0x0100, // S filename, W x, W y + GPMSG_PLAYER_SERVER_CHANGE = 0x0101, // B*32 token, S game address, W game port PGMSG_PICKUP = 0x0110, GPMSG_PICKUP_RESPONSE = 0x0111, GPMSG_BEING_ENTER = 0x0200, // B type, W being id |