summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-10 12:36:08 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-10 12:38:00 +0300
commit574efa8ae89f7786239753537eb32c222686f4a1 (patch)
treedc6f15a6a2a968f459bf541b30b7ef1df71d9f8b /src/net/eathena
parenta2af952c687ff666208a316d8b7b4e394df19d2f (diff)
downloadplus-574efa8ae89f7786239753537eb32c222686f4a1.tar.gz
plus-574efa8ae89f7786239753537eb32c222686f4a1.tar.bz2
plus-574efa8ae89f7786239753537eb32c222686f4a1.tar.xz
plus-574efa8ae89f7786239753537eb32c222686f4a1.zip
Impliment packets CMSG_SOLVE_CHAR_NAME and SMSG_SOLVE_CHAR_NAME.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/beinghandler.cpp6
-rw-r--r--src/net/eathena/beinghandler.h2
-rw-r--r--src/net/eathena/beingrecv.cpp8
-rw-r--r--src/net/eathena/beingrecv.h1
-rw-r--r--src/net/eathena/packetsin.inc2
5 files changed, 18 insertions, 1 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index ddee2d6fa..2d4686786 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -73,4 +73,10 @@ void BeingHandler::viewPlayerEquipment(const Being *const being)
outMsg.writeBeingId(being->getId(), "account id");
}
+void BeingHandler::requestNameByCharId(const int id) const
+{
+ createOutPacket(CMSG_SOLVE_CHAR_NAME);
+ outMsg.writeInt32(id, "character id");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h
index 6780e9bc3..11d2250ff 100644
--- a/src/net/eathena/beinghandler.h
+++ b/src/net/eathena/beinghandler.h
@@ -41,6 +41,8 @@ class BeingHandler final : public Ea::BeingHandler
void requestRanks(const RankT rank) const override final;
+ void requestNameByCharId(const int id) const override final;
+
protected:
void viewPlayerEquipment(const Being *const being);
};
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp
index 2aaf6be7e..31a7bd371 100644
--- a/src/net/eathena/beingrecv.cpp
+++ b/src/net/eathena/beingrecv.cpp
@@ -1672,4 +1672,12 @@ void BeingRecv::processSkillCancel(Net::MessageIn &msg)
msg.readInt32("id?");
}
+void BeingRecv::processSolveCharName(Net::MessageIn &msg)
+{
+ const int id = msg.readInt32("char id");
+ const std::string name = msg.readString(24, "name");
+ if (actorManager)
+ actorManager->addChar(id, name);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/beingrecv.h b/src/net/eathena/beingrecv.h
index 95f7b50eb..31b35d5a3 100644
--- a/src/net/eathena/beingrecv.h
+++ b/src/net/eathena/beingrecv.h
@@ -110,6 +110,7 @@ namespace EAthena
void processPvpSet(Net::MessageIn &msg);
void processNameResponse2(Net::MessageIn &msg);
void processSkillCancel(Net::MessageIn &msg);
+ void processSolveCharName(Net::MessageIn &msg);
Being *createBeing2(Net::MessageIn &msg,
const BeingId id,
const int16_t job,
diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc
index 7d463d043..a2ffcfcbe 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -399,7 +399,7 @@ packet(SMSG_SKILL_NO_DAMAGE, 0x011a, 15, &Ea::BeingRecv::processS
packet(SMSG_SKILL_SNAP, 0x08d2, 10, &SkillRecv::processSkillSnap);
packet(SMSG_SKILL_UNIT_UPDATE, 0x01ac, 6, &SkillRecv::processSkillUnitUpdate);
packet(SMSG_SKILL_WARP_POINT, 0x011c, 68, &SkillRecv::processSkillWarpPoint);
-packet(SMSG_SOLVE_CHAR_NAME, 0x0194, 30, nullptr);
+packet(SMSG_SOLVE_CHAR_NAME, 0x0194, 30, &BeingRecv::processSolveCharName);
packet(SMSG_SPIRIT_BALLS, 0x01d0, 8, &BeingRecv::processSpiritBalls);
packet(SMSG_SPIRIT_BALL_SINGLE, 0x01e1, 8, &BeingRecv::processSpiritBallSingle);
packet(SMSG_STARS_KILL, 0x020e, 32, &BeingRecv::processStarsKill);