summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorLloyd Bryant <lloyd_bryant@netzero.net>2008-07-22 18:05:08 +0000
committerLloyd Bryant <lloyd_bryant@netzero.net>2008-07-22 18:05:08 +0000
commita73a655f398ae9fae01253dec1cc1f9bb1d44ea7 (patch)
tree87acb37b62c2262073788ec9a858b73e74074cf4 /src/net
parent877188e5636738db262fdf55a9ed5d794ca7f5b8 (diff)
downloadmana-a73a655f398ae9fae01253dec1cc1f9bb1d44ea7.tar.gz
mana-a73a655f398ae9fae01253dec1cc1f9bb1d44ea7.tar.bz2
mana-a73a655f398ae9fae01253dec1cc1f9bb1d44ea7.tar.xz
mana-a73a655f398ae9fae01253dec1cc1f9bb1d44ea7.zip
Added support for the new eAthena version
Diffstat (limited to 'src/net')
-rw-r--r--src/net/beinghandler.cpp28
-rw-r--r--src/net/protocol.h4
2 files changed, 32 insertions, 0 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index f3c0cfb4..778c8cfe 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -45,6 +45,7 @@ BeingHandler::BeingHandler()
static const Uint16 _messages[] = {
SMSG_BEING_VISIBLE,
SMSG_BEING_MOVE,
+ SMSG_BEING_MOVE2,
SMSG_BEING_REMOVE,
SMSG_BEING_ACTION,
SMSG_BEING_LEVELUP,
@@ -164,6 +165,33 @@ void BeingHandler::handleMessage(MessageIn *msg)
msg->readInt8(); // unknown / sit
break;
+ case SMSG_BEING_MOVE2:
+ /*
+ * A simplified movement packet, used by the
+ * later versions of eAthena for both mobs and
+ * players
+ */
+ dstBeing = beingManager->findBeing(msg->readInt32());
+
+ Uint16 srcX, srcY, dstX, dstY;
+ msg->readCoordinatePair(srcX, srcY, dstX, dstY);
+ msg->readInt32(); // Server tick
+
+ /*
+ * This packet doesn't have enough info to actually
+ * create a new being, so if the being isn't found,
+ * we'll just pretend the packet didn't happen
+ */
+
+ if (dstBeing) {
+ dstBeing->setAction(Being::STAND);
+ dstBeing->mX = srcX;
+ dstBeing->mY = srcY;
+ dstBeing->setDestination(dstX, dstY);
+ }
+
+ break;
+
case SMSG_BEING_REMOVE:
// A being should be removed or has died
dstBeing = beingManager->findBeing(msg->readInt32());
diff --git a/src/net/protocol.h b/src/net/protocol.h
index f90fcba3..53f245b5 100644
--- a/src/net/protocol.h
+++ b/src/net/protocol.h
@@ -26,6 +26,7 @@
// Packets from server to client
#define SMSG_LOGIN_SUCCESS 0x0073 /**< Contains starting location */
+#define SMSG_SERVER_PING 0x007f /**< Contains server tick */
#define SMSG_PLAYER_UPDATE_1 0x01d8
#define SMSG_PLAYER_UPDATE_2 0x01d9
#define SMSG_PLAYER_MOVE 0x01da /**< A nearby player moves */
@@ -57,6 +58,8 @@
#define SMSG_ITEM_REMOVE 0x00a1 /**< An item disappers */
#define SMSG_BEING_VISIBLE 0x0078
#define SMSG_BEING_MOVE 0x007b /**< A nearby monster moves */
+#define SMSG_BEING_SPAWN 0x007c /**< A being spawns nearby */
+#define SMSG_BEING_MOVE2 0x0086 /**< New eAthena being moves */
#define SMSG_BEING_REMOVE 0x0080
#define SMSG_BEING_CHANGE_LOOKS 0x00c3
#define SMSG_BEING_CHANGE_LOOKS2 0x01d7 /**< Same as 0x00c3, but 16 bit ID */
@@ -102,6 +105,7 @@
#define SMSG_PARTY_MESSAGE 0x0109
// Packets from client to server
+#define CMSG_CLIENT_PING 0x007e /**< Send to server with tick */
#define CMSG_TRADE_RESPONSE 0x00e6
#define CMSG_ITEM_PICKUP 0x009f
#define CMSG_MAP_LOADED 0x007d