summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-02 18:09:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:56 +0300
commitc8002e43c3fd32152ae5b26e6568d35c2861b6fd (patch)
tree7c51a4f312b1a15ac68f75d1baa45f80375b5116
parent148bafe5950332613068f60543e5a1833e661587 (diff)
downloadplus-c8002e43c3fd32152ae5b26e6568d35c2861b6fd.tar.gz
plus-c8002e43c3fd32152ae5b26e6568d35c2861b6fd.tar.bz2
plus-c8002e43c3fd32152ae5b26e6568d35c2861b6fd.tar.xz
plus-c8002e43c3fd32152ae5b26e6568d35c2861b6fd.zip
add packet comments in gamehandler.
-rw-r--r--src/net/ea/gamehandler.cpp7
-rw-r--r--src/net/eathena/gamehandler.cpp6
-rw-r--r--src/net/tmwa/gamehandler.cpp18
3 files changed, 16 insertions, 15 deletions
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp
index cce62c1af..e8e114c30 100644
--- a/src/net/ea/gamehandler.cpp
+++ b/src/net/ea/gamehandler.cpp
@@ -60,18 +60,19 @@ void GameHandler::setMap(const std::string &map)
void GameHandler::processWhoAnswer(Net::MessageIn &msg) const
{
- NotifyManager::notify(NotifyTypes::ONLINE_USERS, msg.readInt32());
+ NotifyManager::notify(NotifyTypes::ONLINE_USERS,
+ msg.readInt32("users count"));
}
void GameHandler::processCharSwitchResponse(Net::MessageIn &msg) const
{
- if (msg.readUInt8())
+ if (msg.readUInt8("response"))
client->setState(STATE_SWITCH_CHARACTER);
}
void GameHandler::processMapQuitResponse(Net::MessageIn &msg) const
{
- if (msg.readUInt8())
+ if (msg.readUInt8("response"))
{
new OkDialog(_("Game"),
// TRANSLATORS: error message
diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp
index d56977371..1cb6ef40b 100644
--- a/src/net/eathena/gamehandler.cpp
+++ b/src/net/eathena/gamehandler.cpp
@@ -108,7 +108,7 @@ void GameHandler::connect()
mNetwork->connect(mapServer);
const Token &token =
- static_cast<LoginHandler*>(Net::getLoginHandler())->getToken();
+ static_cast<LoginHandler*>(Net::getLoginHandler())->getToken();
if (client->getState() == STATE_CONNECT_GAME)
@@ -164,7 +164,7 @@ void GameHandler::quit() const
void GameHandler::ping(const int tick) const
{
MessageOut msg(CMSG_CLIENT_PING);
- msg.writeInt32(tick);
+ msg.writeInt32(tick, "tick");
}
void GameHandler::disconnect2() const
@@ -182,7 +182,7 @@ void GameHandler::processMapLogin(Net::MessageIn &msg) const
unsigned char direction;
uint16_t x, y;
msg.readInt32("start time");
- msg.readCoordinates(x, y, direction);
+ msg.readCoordinates(x, y, direction, "position");
msg.readInt8("x size");
msg.readInt8("y size");
logger->log("Protocol: Player start position: "
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp
index ae60a0874..f0c3c0d5d 100644
--- a/src/net/tmwa/gamehandler.cpp
+++ b/src/net/tmwa/gamehandler.cpp
@@ -122,11 +122,11 @@ void GameHandler::connect()
// Send login infos
MessageOut outMsg(CMSG_MAP_SERVER_CONNECT);
- outMsg.writeInt32(token.account_ID);
- outMsg.writeInt32(mCharID);
- outMsg.writeInt32(token.session_ID1);
- outMsg.writeInt32(token.session_ID2);
- outMsg.writeInt8(Being::genderToInt(token.sex));
+ outMsg.writeInt32(token.account_ID, "account id");
+ outMsg.writeInt32(mCharID, "char id");
+ outMsg.writeInt32(token.session_ID1, "session id1");
+ outMsg.writeInt32(token.session_ID2, "session id2");
+ outMsg.writeInt8(Being::genderToInt(token.sex), "gender");
/*
if (localPlayer)
@@ -163,7 +163,7 @@ void GameHandler::quit() const
void GameHandler::ping(const int tick) const
{
MessageOut msg(CMSG_CLIENT_PING);
- msg.writeInt32(tick);
+ msg.writeInt32(tick, "tick");
}
void GameHandler::disconnect2() const
@@ -175,9 +175,9 @@ void GameHandler::processMapLogin(Net::MessageIn &msg) const
{
unsigned char direction;
uint16_t x, y;
- msg.readInt32(); // server tick
- msg.readCoordinates(x, y, direction);
- msg.skip(2); // 0x0505
+ msg.readInt32("tick");
+ msg.readCoordinates(x, y, direction, "position");
+ msg.skip(2, "unknown?");
logger->log("Protocol: Player start position: (%d, %d),"
" Direction: %d", x, y, direction);