diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-17 21:09:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-17 21:09:08 +0300 |
commit | d792bfdd47f922b18b320444249db68255e1728a (patch) | |
tree | 8dc752a2f02b5692e8623dcc342e2327272d0f83 /src/net/eathena/playerhandler.cpp | |
parent | 5cb81c6bda794f6898f692cc8b9a36a04fa989fd (diff) | |
download | mv-d792bfdd47f922b18b320444249db68255e1728a.tar.gz mv-d792bfdd47f922b18b320444249db68255e1728a.tar.bz2 mv-d792bfdd47f922b18b320444249db68255e1728a.tar.xz mv-d792bfdd47f922b18b320444249db68255e1728a.zip |
Impliment packets CMSG_PLAYER_CHANGE_DIR and CMSG_MAP_PING for all packet versions.
Diffstat (limited to 'src/net/eathena/playerhandler.cpp')
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 180 |
1 files changed, 176 insertions, 4 deletions
diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index 09c80e5fa..8f5e625e8 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -44,6 +44,7 @@ #include "debug.h" extern Net::PlayerHandler *playerHandler; +extern int packetVersion; extern int serverVersion; namespace EAthena @@ -113,10 +114,181 @@ void PlayerHandler::pickUp(const FloorItem *const floorItem) const void PlayerHandler::setDirection(const unsigned char direction) const { createOutPacket(CMSG_PLAYER_CHANGE_DIR); - outMsg.writeInt8(0, "head direction"); - outMsg.writeInt8(0, "unused"); - outMsg.writeInt8(MessageOut::toServerDirection(direction), - "player direction"); + if (packetVersion >= 20101124) + { + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20080827) + { + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20070212) + { + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20070108) + { + outMsg.writeInt32(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20060327) + { + outMsg.writeInt32(0, "unused"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20050719) + { + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20050718) + { + outMsg.writeInt32(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20050628) + { + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20050509) + { + outMsg.writeInt8(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20050110) + { + outMsg.writeInt32(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20041129) + { + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20041025) + { + outMsg.writeInt32(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20041005) + { + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20040920) + { + outMsg.writeInt32(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20040906) + { + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20040809) + { + outMsg.writeInt16(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else if (packetVersion >= 20040713) + { + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt16(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } + else + { + outMsg.writeInt8(0, "head direction"); + outMsg.writeInt8(0, "unused"); + outMsg.writeInt8(MessageOut::toServerDirection(direction), + "player direction"); + } } void PlayerHandler::setDestination(const int x, const int y, |