diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/beinghandler.cpp | 46 | ||||
-rw-r--r-- | src/net/ea/beinghandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 41 | ||||
-rw-r--r-- | src/net/eathena/beinghandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 46 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.h | 2 |
6 files changed, 48 insertions, 91 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index da6ace767..5f835047d 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -446,4 +446,50 @@ void BeingHandler::processPvpSet(Net::MessageIn &msg) BLOCK_END("BeingHandler::processPvpSet") } +void BeingHandler::processNameResponse2(Net::MessageIn &msg) +{ + BLOCK_START("BeingHandler::processNameResponse2") + if (!actorManager || !localPlayer) + { + BLOCK_END("BeingHandler::processNameResponse2") + return; + } + + const int len = msg.readInt16("len"); + const int beingId = msg.readInt32("account ic"); + const std::string str = msg.readString(len - 8, "name"); + Being *const dstBeing = actorManager->findBeing(beingId); + if (dstBeing) + { + if (beingId == localPlayer->getId()) + { + localPlayer->pingResponse(); + } + else + { + dstBeing->setName(str); + dstBeing->updateGuild(); + dstBeing->addToCache(); + + if (dstBeing->getType() == ActorType::Player) + dstBeing->updateColors(); + + if (localPlayer) + { + const Party *const party = localPlayer->getParty(); + if (party && party->isMember(dstBeing->getId())) + { + PartyMember *const member = party->getMember( + dstBeing->getId()); + + if (member) + member->setName(dstBeing->getName()); + } + localPlayer->checkNewName(dstBeing); + } + } + } + BLOCK_END("BeingHandler::processNameResponse2") +} + } // namespace Ea diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h index 8513df916..9ac9fc39d 100644 --- a/src/net/ea/beinghandler.h +++ b/src/net/ea/beinghandler.h @@ -68,6 +68,8 @@ class BeingHandler notfinal : public Net::BeingHandler static void processPvpSet(Net::MessageIn &msg); + static void processNameResponse2(Net::MessageIn &msg); + // Should we honor server "Stop Walking" packets static int mSpawnId; static bool mSync; diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index a3d6706b2..a0a086511 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -528,47 +528,6 @@ void BeingHandler::processBeingChangeLookContinue(Being *const dstBeing, } } -void BeingHandler::processNameResponse2(Net::MessageIn &msg) -{ - if (!actorManager || !localPlayer) - return; - - const int len = msg.readInt16("len"); - const int beingId = msg.readInt32("being id"); - const std::string str = msg.readString(len - 8, "name"); - Being *const dstBeing = actorManager->findBeing(beingId); - if (dstBeing) - { - if (beingId == localPlayer->getId()) - { - localPlayer->pingResponse(); - } - else - { - dstBeing->setName(str); - dstBeing->updateGuild(); - dstBeing->addToCache(); - - if (dstBeing->getType() == ActorType::Player) - dstBeing->updateColors(); - - if (localPlayer) - { - const Party *const party = localPlayer->getParty(); - if (party && party->isMember(dstBeing->getId())) - { - PartyMember *const member = party->getMember( - dstBeing->getId()); - - if (member) - member->setName(dstBeing->getName()); - } - localPlayer->checkNewName(dstBeing); - } - } - } -} - void BeingHandler::processPlayerUpdate1(Net::MessageIn &msg) { if (!actorManager || !localPlayer) diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index 3719362c3..00041bd9d 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -61,8 +61,6 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler static void processBeingSpawn(Net::MessageIn &msg); - static void processNameResponse2(Net::MessageIn &msg); - static void processPlayerUpdate1(Net::MessageIn &msg); static void processPlayerUpdate2(Net::MessageIn &msg); diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 3c77e70a1..23c23c213 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -421,52 +421,6 @@ void BeingHandler::processBeingChangeLookContinue(Being *const dstBeing, } } -void BeingHandler::processNameResponse2(Net::MessageIn &msg) -{ - BLOCK_START("BeingHandler::processNameResponse2") - if (!actorManager || !localPlayer) - { - BLOCK_END("BeingHandler::processNameResponse2") - return; - } - - const int len = msg.readInt16("len"); - const int beingId = msg.readInt32("account ic"); - const std::string str = msg.readString(len - 8, "name"); - Being *const dstBeing = actorManager->findBeing(beingId); - if (dstBeing) - { - if (beingId == localPlayer->getId()) - { - localPlayer->pingResponse(); - } - else - { - dstBeing->setName(str); - dstBeing->updateGuild(); - dstBeing->addToCache(); - - if (dstBeing->getType() == ActorType::Player) - dstBeing->updateColors(); - - if (localPlayer) - { - const Party *const party = localPlayer->getParty(); - if (party && party->isMember(dstBeing->getId())) - { - PartyMember *const member = party->getMember( - dstBeing->getId()); - - if (member) - member->setName(dstBeing->getName()); - } - localPlayer->checkNewName(dstBeing); - } - } - } - BLOCK_END("BeingHandler::processNameResponse2") -} - void BeingHandler::processPlayerUpdate1(Net::MessageIn &msg) { BLOCK_START("BeingHandler::processPlayerMoveUpdate") diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h index 1ecc23d43..cb366d8a1 100644 --- a/src/net/tmwa/beinghandler.h +++ b/src/net/tmwa/beinghandler.h @@ -56,8 +56,6 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler static void processBeingMove(Net::MessageIn &msg); - static void processNameResponse2(Net::MessageIn &msg); - static void processPlayerUpdate1(Net::MessageIn &msg); static void processPlayerUpdate2(Net::MessageIn &msg); |