summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-20 23:48:46 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-20 23:48:46 +0300
commit68581ace3255ea4d8b0f0e5b33a33633a27b8e42 (patch)
tree498fbea8f60078e71b60cfb2dfec012563ca7aad /src/net/eathena
parent7a618aa66e0b5b7df3bccd1bf1df908f1b421629 (diff)
downloadplus-68581ace3255ea4d8b0f0e5b33a33633a27b8e42.tar.gz
plus-68581ace3255ea4d8b0f0e5b33a33633a27b8e42.tar.bz2
plus-68581ace3255ea4d8b0f0e5b33a33633a27b8e42.tar.xz
plus-68581ace3255ea4d8b0f0e5b33a33633a27b8e42.zip
eathena: add packet SMSG_NPC_AREA 0x0b0b
Change protocol version to 5.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/network.h2
-rw-r--r--src/net/eathena/npchandler.cpp19
-rw-r--r--src/net/eathena/npchandler.h2
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
5 files changed, 24 insertions, 2 deletions
diff --git a/src/net/eathena/network.h b/src/net/eathena/network.h
index 8920dd746..0e51b5a38 100644
--- a/src/net/eathena/network.h
+++ b/src/net/eathena/network.h
@@ -29,7 +29,7 @@
* Protocol version, reported to the eAthena char and mapserver who can adjust
* the protocol accordingly.
*/
-#define CLIENT_PROTOCOL_VERSION 4
+#define CLIENT_PROTOCOL_VERSION 5
namespace EAthena
{
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index 0bb2e2587..e797c0477 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -22,6 +22,8 @@
#include "net/eathena/npchandler.h"
+#include "actormanager.h"
+
#include "being/localplayer.h"
#include "gui/windows/npcdialog.h"
@@ -56,6 +58,7 @@ NpcHandler::NpcHandler() :
SMSG_NPC_CLOSE_TIMEOUT,
SMSG_NPC_COMMAND,
SMSG_NPC_CHANGETITLE,
+ SMSG_NPC_AREA,
0
};
handledMessages = _messages;
@@ -114,6 +117,10 @@ void NpcHandler::handleMessage(Net::MessageIn &msg)
processChangeTitle(msg);
break;
+ case SMSG_NPC_AREA:
+ processArea(msg);
+ break;
+
default:
break;
}
@@ -351,4 +358,16 @@ void NpcHandler::processNpcCloseTimeout(Net::MessageIn &msg)
msg.readInt32("npc id");
}
+void NpcHandler::processArea(Net::MessageIn &msg)
+{
+ const int len = msg.readInt16("len");
+ if (len < 12)
+ return;
+ Being *const dstBeing = actorManager->findBeing(
+ msg.readInt32("npc id"));
+ const int area = msg.readInt32("area size");
+ if (dstBeing)
+ dstBeing->setAreaSize(area);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h
index dc6eb8f97..c42030fd0 100644
--- a/src/net/eathena/npchandler.h
+++ b/src/net/eathena/npchandler.h
@@ -95,6 +95,8 @@ class NpcHandler final : public MessageHandler, public Ea::NpcHandler
static void processNpcShowProgressBar(Net::MessageIn &msg);
static void processNpcCloseTimeout(Net::MessageIn &msg);
+
+ static void processArea(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 600a1a41e..fb6b788e7 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -281,7 +281,7 @@ int16_t packet_lengths[] =
//0 1 2 3 4 5 6 7 8 9 a b c d e f
//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// #0x0B00
- 16, -1, 10, -1, -1, -1, -1, 0, 27, 0, -1, 0, 0, 0, 0, 0,
+ 16, -1, 10, -1, -1, -1, -1, 0, 27, 0, -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, 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 3c713ff72..384ea8e3e 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -154,6 +154,7 @@
#define SMSG_NPC_MARKET_BUY_ACK 0x09d7
#define SMSG_NPC_CASH_SHOP_OPEN 0x0287
#define SMSG_NPC_CASH_BUY_ACK 0x0289
+#define SMSG_NPC_AREA 0x0b0b
#define SMSG_PLAYER_CHAT 0x008e /**< Player talks */
#define SMSG_WHISPER 0x0097 /**< Whisper Recieved */