diff options
author | Andrei Karas <akaras@inbox.ru> | 2019-05-15 02:00:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2019-05-15 02:00:02 +0300 |
commit | 1517630edf7dd30560fde38bcafa9cee7e08f8f6 (patch) | |
tree | dce005f2d5c46d807581b07586c333cc0beec824 | |
parent | ebeb2c4f224016bf076f9a97d7f03afc16a102cf (diff) | |
download | mv-1517630edf7dd30560fde38bcafa9cee7e08f8f6.tar.gz mv-1517630edf7dd30560fde38bcafa9cee7e08f8f6.tar.bz2 mv-1517630edf7dd30560fde38bcafa9cee7e08f8f6.tar.xz mv-1517630edf7dd30560fde38bcafa9cee7e08f8f6.zip |
Add packet SMSG_NAME_RESPONSE_TITLE 0x0adf
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 60 | ||||
-rw-r--r-- | src/net/eathena/beingrecv.h | 1 | ||||
-rw-r--r-- | src/net/eathena/packetsin.inc | 18 |
3 files changed, 79 insertions, 0 deletions
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index 981dd9ef1..1961be9a7 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -34,6 +34,8 @@ #include "enums/resources/notifytypes.h" +#include "enums/resources/map/mapitemtype.h" + #include "particle/particleengine.h" #include "input/keyboardconfig.h" @@ -1674,6 +1676,64 @@ void BeingRecv::processBeingResurrect(Net::MessageIn &msg) BLOCK_END("BeingRecv::processBeingResurrect") } +void BeingRecv::processNameResponseTitle(Net::MessageIn &msg) +{ + if (actorManager == nullptr) + return; + + const BeingId beingId = msg.readBeingId("being id"); + msg.readInt32("group id"); // +++ can be used for icon or other + const std::string name = msg.readString(24, "name"); + msg.readString(24, "title"); // +++ can be used for second name part + Being *const dstBeing = actorManager->findBeing(beingId); + + actorManager->updateNameId(name, beingId); + + if (dstBeing != nullptr) + { + if (beingId == localPlayer->getId()) + { + localPlayer->pingResponse(); + } + else + { + if (dstBeing->getType() != ActorType::Portal) + { + dstBeing->setName(name); + } + else if (viewport != nullptr) + { + Map *const map = viewport->getMap(); + if (map != nullptr) + { + map->addPortalTile(name, MapItemType::PORTAL, + dstBeing->getTileX(), dstBeing->getTileY()); + } + } + dstBeing->updateGuild(); + dstBeing->addToCache(); + + if (dstBeing->getType() == ActorType::Player) + dstBeing->updateColors(); + + if (localPlayer != nullptr) + { + const Party *const party = localPlayer->getParty(); + if (party != nullptr && party->isMember(dstBeing->getId())) + { + PartyMember *const member = party->getMember( + dstBeing->getId()); + + if (member != nullptr) + member->setName(dstBeing->getName()); + } + localPlayer->checkNewName(dstBeing); + } + return; + } + } +} + void BeingRecv::processPlayerGuilPartyInfo(Net::MessageIn &msg) { BLOCK_START("BeingRecv::processPlayerGuilPartyInfo") diff --git a/src/net/eathena/beingrecv.h b/src/net/eathena/beingrecv.h index d2e0e5929..bab20c09b 100644 --- a/src/net/eathena/beingrecv.h +++ b/src/net/eathena/beingrecv.h @@ -83,6 +83,7 @@ namespace EAthena void processSkillEntry(Net::MessageIn &msg); void processPlayerStatusChange(Net::MessageIn &msg); void processBeingResurrect(Net::MessageIn &msg); + void processNameResponseTitle(Net::MessageIn &msg); void processPlayerGuilPartyInfo(Net::MessageIn &msg); void processPlayerGuilPartyInfo2(Net::MessageIn &msg); void processBeingRemoveSkill(Net::MessageIn &msg); diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index cda7ec635..a701ea896 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -1320,6 +1320,18 @@ if (packetVersionZero >= 20171123) packet(SMSG_LOGIN_OTP, 0x0ae3, -1, &LoginRecv::processLoginOtp2, 20171123); } +// 20171129 re +if (packetVersionRe >= 20171129) +{ + packet(SMSG_NAME_RESPONSE_TITLE, 0x0adf, 58, &BeingRecv::processNameResponseTitle, 20171129); +} + +// 20171130 zero +if (packetVersionZero >= 20171130) +{ + packet(SMSG_NAME_RESPONSE_TITLE, 0x0adf, 58, &BeingRecv::processNameResponseTitle, 20171130); +} + // 20171207 if (packetVersion >= 20171207) { @@ -1363,6 +1375,12 @@ if (packetVersionZero >= 20180131) packet(SMSG_CHAR_PINCODE_STATUS2, 0x0ae9, 13, &CharServerRecv::processPincodeStatus2, 20180124); } +// 20180207 main +if (packetVersionMain >= 20180207) +{ + packet(SMSG_NAME_RESPONSE_TITLE, 0x0adf, 58, &BeingRecv::processNameResponseTitle, 20180207); +} + // re 20180221 if (packetVersionRe >= 20180221) { |