summaryrefslogtreecommitdiff
path: root/src/net/eathena/charserverhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-18 15:23:24 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-18 15:23:24 +0300
commit485cf3ed0a92beddfbff839d3603ff1f2a98f805 (patch)
treeb177d403b251213a5bc9d2934c1d938ed29ad9df /src/net/eathena/charserverhandler.cpp
parentee633de31c7978ae4a776cce4de86729356e1b1f (diff)
downloadmv-485cf3ed0a92beddfbff839d3603ff1f2a98f805.tar.gz
mv-485cf3ed0a92beddfbff839d3603ff1f2a98f805.tar.bz2
mv-485cf3ed0a92beddfbff839d3603ff1f2a98f805.tar.xz
mv-485cf3ed0a92beddfbff839d3603ff1f2a98f805.zip
eathena: add packet SMSG_CHAR_CHARACTERS 0x099d.
Diffstat (limited to 'src/net/eathena/charserverhandler.cpp')
-rw-r--r--src/net/eathena/charserverhandler.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 8034d873b..79a316420 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -96,6 +96,7 @@ CharServerHandler::CharServerHandler() :
SMSG_CHAR_DELETE2_ACK,
SMSG_CHAR_DELETE2_ACCEPT_ACTUAL_ACK,
SMSG_CHAR_DELETE2_CANCEL_ACK,
+ SMSG_CHAR_CHARACTERS,
0
};
handledMessages = _messages;
@@ -174,6 +175,10 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg)
processCharDelete2CancelAck(msg);
break;
+ case SMSG_CHAR_CHARACTERS:
+ processCharCharacters(msg);
+ break;
+
default:
break;
}
@@ -676,4 +681,30 @@ void CharServerHandler::processCharDelete2CancelAck(Net::MessageIn &msg)
msg.readInt32("result");
}
+void CharServerHandler::processCharCharacters(Net::MessageIn &msg)
+{
+ msg.skip(2, "packet len");
+
+ delete_all(mCharacters);
+ mCharacters.clear();
+
+ // Derive number of characters from message length
+ const int count = (msg.getLength() - 4)
+ / (106 + 4 + 2 + 16 + 4 + 4 + 4 + 4);
+
+ for (int i = 0; i < count; ++i)
+ {
+ Net::Character *const character = new Net::Character;
+ charServerHandler->readPlayerData(msg, character, false);
+ mCharacters.push_back(character);
+ if (character->dummy)
+ {
+ logger->log("CharServer: Player: %s (%d)",
+ character->dummy->getName().c_str(), character->slot);
+ }
+ }
+
+ client->setState(STATE_CHAR_SELECT);
+}
+
} // namespace EAthena