summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-20 18:53:08 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-20 18:53:08 +0300
commit90a63c3d866812143faab7d2c551cfff8ba61aa3 (patch)
tree9a18eecbf0c489761266f0bda54914ed8735ffa0 /src
parent66f1a82e7910404b812db255a99cb559d9ab3dcf (diff)
downloadmanaverse-90a63c3d866812143faab7d2c551cfff8ba61aa3.tar.gz
manaverse-90a63c3d866812143faab7d2c551cfff8ba61aa3.tar.bz2
manaverse-90a63c3d866812143faab7d2c551cfff8ba61aa3.tar.xz
manaverse-90a63c3d866812143faab7d2c551cfff8ba61aa3.zip
Move processNameResponse2 from ea namespace into eathena.
Diffstat (limited to 'src')
-rw-r--r--src/net/ea/beinghandler.cpp46
-rw-r--r--src/net/ea/beinghandler.h2
-rw-r--r--src/net/eathena/beinghandler.cpp47
-rw-r--r--src/net/eathena/beinghandler.h2
4 files changed, 49 insertions, 48 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index c86414022..d50366884 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -418,52 +418,6 @@ void BeingHandler::processPvpMapMode(Net::MessageIn &msg)
BLOCK_END("BeingHandler::processPvpMapMode")
}
-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 BeingId beingId = msg.readBeingId("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::processBeingMove3(Net::MessageIn &msg)
{
BLOCK_START("BeingHandler::processBeingMove3")
diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h
index b5a4768fc..20622e514 100644
--- a/src/net/ea/beinghandler.h
+++ b/src/net/ea/beinghandler.h
@@ -64,8 +64,6 @@ class BeingHandler notfinal : public Net::BeingHandler
static void processPvpMapMode(Net::MessageIn &msg);
- static void processNameResponse2(Net::MessageIn &msg);
-
static void processBeingMove3(Net::MessageIn &msg);
// Should we honor server "Stop Walking" packets
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 4ab060b9a..10161d922 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -26,6 +26,7 @@
#include "effectmanager.h"
#include "game.h"
#include "notifymanager.h"
+#include "party.h"
#include "being/localplayer.h"
#include "being/mercenaryinfo.h"
@@ -1965,4 +1966,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 BeingId beingId = msg.readBeingId("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 EAthena
diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h
index 4a88d376f..ba8cf5ce7 100644
--- a/src/net/eathena/beinghandler.h
+++ b/src/net/eathena/beinghandler.h
@@ -165,6 +165,8 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler
static void processBeingViewEquipment(Net::MessageIn &msg);
static void processPvpSet(Net::MessageIn &msg);
+
+ static void processNameResponse2(Net::MessageIn &msg);
};
} // namespace EAthena