From 890fd4c9ceab089de688b00acf5163d795ccec4a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 10 Jan 2015 20:30:10 +0300 Subject: eathena: add packet SMSG_BEING_ATTRS 0x0b0a. --- src/net/eathena/beinghandler.cpp | 27 +++++++++++++++++++++++++++ src/net/eathena/beinghandler.h | 2 ++ src/net/eathena/packets.h | 2 +- src/net/eathena/protocol.h | 1 + 4 files changed, 31 insertions(+), 1 deletion(-) (limited to 'src/net') diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index ab8700227..a3458c9f8 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -112,6 +112,7 @@ BeingHandler::BeingHandler(const bool enableSync) : SMSG_BEING_STAT_UPDATE_1, SMSG_MOB_INFO, SMSG_BEING_MOVE3, + SMSG_BEING_ATTRS, 0 }; handledMessages = _messages; @@ -301,6 +302,10 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) processBeingMove3(msg); break; + case SMSG_BEING_ATTRS: + processBeingAttrs(msg); + break; + default: break; } @@ -1546,4 +1551,26 @@ void BeingHandler::processMobInfo(Net::MessageIn &msg) dstBeing->setAttackRange(attackRange); } +void BeingHandler::processBeingAttrs(Net::MessageIn &msg) +{ + const int len = msg.readInt16("len"); + if (len < 12) + return; + Being *const dstBeing = actorManager->findBeing( + msg.readInt32("player id")); + const int gmLevel = msg.readInt32("gm level"); + if (dstBeing && gmLevel) + { + if (dstBeing == localPlayer) + localPlayer->setGMLevel(gmLevel); + dstBeing->setGM(true); + } + else + { + if (dstBeing == localPlayer) + localPlayer->setGMLevel(0); + dstBeing->setGM(false); + } +} + } // namespace EAthena diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index 54b2e8059..9c0d0b920 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -118,6 +118,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler static void processBeingSelfEffect(Net::MessageIn &msg); static void processMobInfo(Net::MessageIn &msg); + + static void processBeingAttrs(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 63fa106d3..600a1a41e 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, 0, 0, 0, 0, 0, 0, + 16, -1, 10, -1, -1, -1, -1, 0, 27, 0, -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, 0, diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index baf048c56..3c713ff72 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -127,6 +127,7 @@ #define SMSG_BEING_CHANGE_DIRECTION 0x009c #define SMSG_BEING_RESURRECT 0x0148 #define SMSG_BEING_STAT_UPDATE_1 0x01ab +#define SMSG_BEING_ATTRS 0x0b0a #define SMSG_PLAYER_STATUS_CHANGE 0x0229 #define SMSG_PLAYER_STATUS_CHANGE2 0x028a -- cgit v1.2.3-70-g09d2