summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-10-30 07:55:47 -0600
committerJared Adams <jaxad0127@gmail.com>2009-10-30 07:55:47 -0600
commitd5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53 (patch)
treeab809df771094d860c5f2b4f1ad0f1083c6a4dca /src/net/ea
parent1c0ee2fc301d88c5c696392d9959e82e2acd0086 (diff)
downloadmana-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.tar.gz
mana-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.tar.bz2
mana-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.tar.xz
mana-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.zip
Support switching characters under eAthena
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/beinghandler.cpp3
-rw-r--r--src/net/ea/charserverhandler.cpp7
-rw-r--r--src/net/ea/charserverhandler.h2
-rw-r--r--src/net/ea/gamehandler.cpp18
-rw-r--r--src/net/ea/generalhandler.cpp1
-rw-r--r--src/net/ea/protocol.h3
6 files changed, 34 insertions, 0 deletions
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 */