summaryrefslogtreecommitdiff
path: root/src/net/tmwa/beinghandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-18 01:47:23 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-18 01:47:23 +0200
commit3b699158d2732d45e3a6bbb8c0dc1abfe85a9167 (patch)
treea4b8e95e65d458161c726be55cd263fee4f8b132 /src/net/tmwa/beinghandler.cpp
parent652759da11309e151d2d522532bc2a367cbd179d (diff)
downloadmanaplus-3b699158d2732d45e3a6bbb8c0dc1abfe85a9167.tar.gz
manaplus-3b699158d2732d45e3a6bbb8c0dc1abfe85a9167.tar.bz2
manaplus-3b699158d2732d45e3a6bbb8c0dc1abfe85a9167.tar.xz
manaplus-3b699158d2732d45e3a6bbb8c0dc1abfe85a9167.zip
Add packet SMSG_BEING_NAME_RESPONSE2 with big being names.
Diffstat (limited to 'src/net/tmwa/beinghandler.cpp')
-rw-r--r--src/net/tmwa/beinghandler.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index f1d31a145..742a69f66 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -75,6 +75,7 @@ BeingHandler::BeingHandler(bool enableSync):
SMSG_BEING_CHANGE_LOOKS,
SMSG_BEING_CHANGE_LOOKS2,
SMSG_BEING_NAME_RESPONSE,
+ SMSG_BEING_NAME_RESPONSE2,
SMSG_PLAYER_GUILD_PARTY_INFO,
SMSG_BEING_CHANGE_DIRECTION,
SMSG_PLAYER_UPDATE_1,
@@ -745,6 +746,46 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
}
}
break;
+ case SMSG_BEING_NAME_RESPONSE2:
+ {
+ int len = msg.readInt16();
+ logger->log("len: %d", len);
+ int beingId = msg.readInt32();
+ logger->log("id: %d", beingId);
+ std::string str = msg.readString(len - 8);
+ logger->log("str: %s", str.c_str());
+ if ((dstBeing = actorSpriteManager->findBeing(beingId)))
+ {
+ if (beingId == player_node->getId())
+ {
+ player_node->pingResponse();
+ }
+ else
+ {
+ dstBeing->setName(str);
+ dstBeing->updateGuild();
+ dstBeing->addToCache();
+
+ if (dstBeing->getType() == Being::PLAYER)
+ dstBeing->updateColors();
+
+ if (player_node)
+ {
+ Party *party = player_node->getParty();
+ if (party && party->isMember(dstBeing->getId()))
+ {
+ PartyMember *member = party->getMember(
+ dstBeing->getId());
+
+ if (member)
+ member->setName(dstBeing->getName());
+ }
+ player_node->checkNewName(dstBeing);
+ }
+ }
+ }
+ }
+ break;
case SMSG_BEING_IP_RESPONSE:
{
if ((dstBeing = actorSpriteManager->findBeing(