summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-31 00:17:14 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-31 00:17:14 +0300
commitfb36852e1fe3e93811ef7de329729789ec815cf5 (patch)
tree586b47294692b9b40a2bd332e2b3c26e55731902 /src
parent593dbe6cbce8a4137b7e86633e801d6200f6e999 (diff)
downloadmanaplus-fb36852e1fe3e93811ef7de329729789ec815cf5.tar.gz
manaplus-fb36852e1fe3e93811ef7de329729789ec815cf5.tar.bz2
manaplus-fb36852e1fe3e93811ef7de329729789ec815cf5.tar.xz
manaplus-fb36852e1fe3e93811ef7de329729789ec815cf5.zip
eathena: add packet SMSG_MAP_NOT_FOUND 0x0840.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/generalhandler.cpp13
-rw-r--r--src/net/eathena/generalhandler.h2
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
4 files changed, 17 insertions, 1 deletions
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp
index c5730556a..aa939acb5 100644
--- a/src/net/eathena/generalhandler.cpp
+++ b/src/net/eathena/generalhandler.cpp
@@ -118,6 +118,7 @@ GeneralHandler::GeneralHandler() :
static const uint16_t _messages[] =
{
SMSG_CONNECTION_PROBLEM,
+ SMSG_MAP_NOT_FOUND,
0
};
handledMessages = _messages;
@@ -147,6 +148,10 @@ void GeneralHandler::handleMessage(Net::MessageIn &msg)
processConnectionProblem(msg);
break;
+ case SMSG_MAP_NOT_FOUND:
+ processMapNotFound(msg);
+ break;
+
default:
break;
}
@@ -254,6 +259,14 @@ void GeneralHandler::processConnectionProblem(Net::MessageIn &msg)
client->setState(STATE_ERROR);
}
+void GeneralHandler::processMapNotFound(Net::MessageIn &msg)
+{
+ const int sz = msg.readInt16("len") - 4;
+ msg.readString(sz, "map name?");
+ errorMessage = _("Map not found");
+ client->setState(STATE_ERROR);
+}
+
void GeneralHandler::load()
{
(new Network)->registerHandler(this);
diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h
index 40ec4d053..cf6c33f4d 100644
--- a/src/net/eathena/generalhandler.h
+++ b/src/net/eathena/generalhandler.h
@@ -63,6 +63,8 @@ class GeneralHandler final : public MessageHandler,
protected:
static void processConnectionProblem(Net::MessageIn &msg);
+ static void processMapNotFound(Net::MessageIn &msg);
+
MessageHandlerPtr mAdminHandler;
MessageHandlerPtr mBeingHandler;
MessageHandlerPtr mBuySellHandler;
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 1581a8dd9..5211e5ea3 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -220,7 +220,7 @@ int16_t packet_lengths[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 26, 0,
// #0x0840
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0,
+ -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 31b4c4b40..9a6824ba4 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -28,6 +28,7 @@
*********************************/
#define SMSG_SERVER_PING 0x007f /**< Contains server tick */
#define SMSG_CONNECTION_PROBLEM 0x0081
+#define SMSG_MAP_NOT_FOUND 0x0840
#define SMSG_LOGIN_DATA 0x0069
#define SMSG_LOGIN_ERROR 0x006a