summaryrefslogtreecommitdiff
path: root/src/net/eathena/beinghandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-10 20:30:10 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-10 20:30:10 +0300
commit890fd4c9ceab089de688b00acf5163d795ccec4a (patch)
treebcaf7fb78fdb6a0fb426f2abe9a9636cb2050076 /src/net/eathena/beinghandler.cpp
parent7c6f3d5a9cc4e83520dc8c2ac75ec987e730d381 (diff)
downloadplus-890fd4c9ceab089de688b00acf5163d795ccec4a.tar.gz
plus-890fd4c9ceab089de688b00acf5163d795ccec4a.tar.bz2
plus-890fd4c9ceab089de688b00acf5163d795ccec4a.tar.xz
plus-890fd4c9ceab089de688b00acf5163d795ccec4a.zip
eathena: add packet SMSG_BEING_ATTRS 0x0b0a.
Diffstat (limited to 'src/net/eathena/beinghandler.cpp')
-rw-r--r--src/net/eathena/beinghandler.cpp27
1 files changed, 27 insertions, 0 deletions
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