diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-10-30 07:55:47 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-10-30 07:55:47 -0600 |
commit | d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53 (patch) | |
tree | ab809df771094d860c5f2b4f1ad0f1083c6a4dca /src/net | |
parent | 1c0ee2fc301d88c5c696392d9959e82e2acd0086 (diff) | |
download | mana-client-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.tar.gz mana-client-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.tar.bz2 mana-client-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.tar.xz mana-client-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.zip |
Support switching characters under eAthena
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/charhandler.h | 4 | ||||
-rw-r--r-- | src/net/ea/beinghandler.cpp | 3 | ||||
-rw-r--r-- | src/net/ea/charserverhandler.cpp | 7 | ||||
-rw-r--r-- | src/net/ea/charserverhandler.h | 2 | ||||
-rw-r--r-- | src/net/ea/gamehandler.cpp | 18 | ||||
-rw-r--r-- | src/net/ea/generalhandler.cpp | 1 | ||||
-rw-r--r-- | src/net/ea/protocol.h | 3 | ||||
-rw-r--r-- | src/net/manaserv/charhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/manaserv/charhandler.h | 2 |
9 files changed, 44 insertions, 1 deletions
diff --git a/src/net/charhandler.h b/src/net/charhandler.h index 4cace541..0ad3c1b7 100644 --- a/src/net/charhandler.h +++ b/src/net/charhandler.h @@ -52,7 +52,9 @@ class CharHandler bool gender, int hairstyle, int hairColor, std::vector<int> stats) = 0; - virtual void deleteCharacter(int slot, LocalPlayer *character) = 0; + virtual void deleteCharacter(int slot, LocalPlayer* character) = 0; + + virtual void switchCharacter() = 0; }; } // namespace Net diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index 80e9b350..2cc93f6e 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -118,6 +118,9 @@ void BeingHandler::handleMessage(MessageIn &msg) { case SMSG_BEING_VISIBLE: case SMSG_BEING_MOVE: + if (!beingManager) + return; + // Information about a being in range id = msg.readInt32(); speed = msg.readInt16(); diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index b578fab9..f4b82aee 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -284,6 +284,13 @@ void CharServerHandler::deleteCharacter(int slot, LocalPlayer *character) outMsg.writeString("a@a.com", 40); } +void CharServerHandler::switchCharacter() +{ + // This is really a map-server packet + MessageOut outMsg(CMSG_PLAYER_RESTART); + outMsg.writeInt8(1); +} + void CharServerHandler::connect() { const Token &token = diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h index 90e7372c..393ec15c 100644 --- a/src/net/ea/charserverhandler.h +++ b/src/net/ea/charserverhandler.h @@ -63,6 +63,8 @@ class CharServerHandler : public MessageHandler, public Net::CharHandler void deleteCharacter(int slot, LocalPlayer* character); + void switchCharacter(); + void connect(); protected: diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index 012e6f8c..f101e03a 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -35,6 +35,8 @@ #include "gui/widgets/chattab.h" +#include "gui/okdialog.h" + #include "utils/gettext.h" #include "utils/stringutils.h" @@ -51,6 +53,8 @@ GameHandler::GameHandler() SMSG_MAP_LOGIN_SUCCESS, SMSG_SERVER_PING, SMSG_WHO_ANSWER, + SMSG_CHAR_SWITCH_RESPONSE, + SMSG_MAP_QUIT_RESPONSE, 0 }; handledMessages = _messages; @@ -84,6 +88,20 @@ void GameHandler::handleMessage(MessageIn &msg) localChatTab->chatLog(strprintf(_("Online users: %d"), msg.readInt32()), BY_SERVER); break; + + case SMSG_CHAR_SWITCH_RESPONSE: + if (msg.readInt8()) + { + state = STATE_SWITCH_CHARACTER; + } + break; + + case SMSG_MAP_QUIT_RESPONSE: + if (msg.readInt8()) + { + new OkDialog(_("Game"), _("Request to quit denied!"), NULL); + } + break; } } diff --git a/src/net/ea/generalhandler.cpp b/src/net/ea/generalhandler.cpp index 78a10423..62a7c1aa 100644 --- a/src/net/ea/generalhandler.cpp +++ b/src/net/ea/generalhandler.cpp @@ -239,6 +239,7 @@ void GeneralHandler::guiWindowsLoaded() void GeneralHandler::guiWindowsUnloaded() { delete partyTab; + partyTab = 0; } void GeneralHandler::clearHandlers() diff --git a/src/net/ea/protocol.h b/src/net/ea/protocol.h index 8f3e40b5..1e093e91 100644 --- a/src/net/ea/protocol.h +++ b/src/net/ea/protocol.h @@ -65,7 +65,10 @@ static const int STORAGE_OFFSET = 1; #define SMSG_CHAR_MAP_INFO 0x0071 #define SMSG_CHAR_PASSWORD_RESPONSE 0x0062 /**< Custom packet reply to password change request */ +#define SMSG_CHAR_SWITCH_RESPONSE 0x00b3 + #define SMSG_MAP_LOGIN_SUCCESS 0x0073 /**< Contains starting location */ +#define SMSG_MAP_QUIT_RESPONSE 0x018b #define SMSG_PLAYER_UPDATE_1 0x01d8 #define SMSG_PLAYER_UPDATE_2 0x01d9 #define SMSG_PLAYER_MOVE 0x01da /**< A nearby player moves */ diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index a1b014fa..e7a99e8d 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -382,4 +382,9 @@ void CharHandler::deleteCharacter(int slot, LocalPlayer* character) Net::AccountServer::Account::deleteCharacter(slot); } +void CharHandler::switchCharacter() +{ + // TODO +} + } // namespace ManaServ diff --git a/src/net/manaserv/charhandler.h b/src/net/manaserv/charhandler.h index dafe6431..5fa57faf 100644 --- a/src/net/manaserv/charhandler.h +++ b/src/net/manaserv/charhandler.h @@ -66,6 +66,8 @@ class CharHandler : public MessageHandler, public Net::CharHandler void deleteCharacter(int slot, LocalPlayer* character); + void switchCharacter(); + protected: void handleCharCreateResponse(MessageIn &msg); |