summaryrefslogtreecommitdiff
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
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.
-rw-r--r--src/net/tmwa/beinghandler.cpp41
-rw-r--r--src/net/tmwa/network.cpp1
-rw-r--r--src/net/tmwa/protocol.h1
3 files changed, 43 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(
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index b96cfd2b5..d1bc269af 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -81,6 +81,7 @@ short packet_lengths[] =
// #0x2000
26, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, 10, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
const unsigned int BUFFER_SIZE = 655360;
diff --git a/src/net/tmwa/protocol.h b/src/net/tmwa/protocol.h
index e41275757..999216ee5 100644
--- a/src/net/tmwa/protocol.h
+++ b/src/net/tmwa/protocol.h
@@ -138,6 +138,7 @@ static const int STORAGE_OFFSET = 1;
#define SMSG_BEING_ACTION 0x008a /**< Attack, sit, stand up, ... */
#define SMSG_BEING_CHAT 0x008d /**< A being talks */
#define SMSG_BEING_NAME_RESPONSE 0x0095 /**< Has to be requested */
+#define SMSG_BEING_NAME_RESPONSE2 0x0220 /**< Has to be requested */
#define SMSG_BEING_CHANGE_DIRECTION 0x009c
#define SMSG_BEING_RESURRECT 0x0148