summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-12-18 17:19:28 +0300
committerAndrei Karas <akaras@inbox.ru>2011-12-18 17:19:28 +0300
commit722404ad29f268ef8861c62b038c4e14652c7555 (patch)
treef38d57adaba7bbe103f48bf3fd0b92c99d2c5329
parentba997be747666c74c46c734cb636a8de84c582b3 (diff)
downloadmanaplus-722404ad29f268ef8861c62b038c4e14652c7555.tar.gz
manaplus-722404ad29f268ef8861c62b038c4e14652c7555.tar.bz2
manaplus-722404ad29f268ef8861c62b038c4e14652c7555.tar.xz
manaplus-722404ad29f268ef8861c62b038c4e14652c7555.zip
Ad comments for "unused" data from server packets.
Fix some guild and worlds packets.
-rw-r--r--src/net/ea/gamehandler.cpp2
-rw-r--r--src/net/ea/guildhandler.cpp13
-rw-r--r--src/net/ea/loginhandler.cpp9
-rw-r--r--src/net/ea/partyhandler.cpp4
-rw-r--r--src/net/ea/specialhandler.cpp4
-rw-r--r--src/net/tmwa/charserverhandler.cpp4
-rw-r--r--src/net/tmwa/loginhandler.cpp2
7 files changed, 20 insertions, 18 deletions
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp
index b74f2384d..a43c159e3 100644
--- a/src/net/ea/gamehandler.cpp
+++ b/src/net/ea/gamehandler.cpp
@@ -73,7 +73,7 @@ void GameHandler::processMapLogin(Net::MessageIn &msg)
Uint16 x, y;
msg.readInt32(); // server tick
msg.readCoordinates(x, y, direction);
- msg.skip(2); // unknown
+ msg.skip(2); // 0x0505
logger->log("Protocol: Player start position: (%d, %d),"
" Direction: %d", x, y, direction);
// Switch now or we'll have problems
diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp
index 907fa13db..49df76f97 100644
--- a/src/net/ea/guildhandler.cpp
+++ b/src/net/ea/guildhandler.cpp
@@ -168,7 +168,7 @@ void GuildHandler::processGuildBasicInfo(Net::MessageIn &msg)
int avgLevel = msg.readInt32(); // Average level
int exp = msg.readInt32(); // Exp
int nextExp = msg.readInt32(); // Next exp
- msg.skip(16); // unused
+ msg.skip(16); // 0 unused
std::string name = msg.readString(24); // Name
std::string master = msg.readString(24); // Master's name
std::string castle = msg.readString(20); // Castles
@@ -242,7 +242,7 @@ void GuildHandler::processGuildMemberList(Net::MessageIn &msg)
int exp = msg.readInt32(); // Exp
int online = msg.readInt32(); // Online
int pos = msg.readInt32(); // Position
- msg.skip(50); // unused
+ msg.skip(50); // 0 unused
std::string name = msg.readString(24); // Name
GuildMember *m = taGuild->addMember(id, charId, name);
@@ -371,11 +371,11 @@ void GuildHandler::processGuildSkillInfo(Net::MessageIn &msg)
{
msg.readInt16(); // ID
msg.readInt16(); // 'Info' (unknown atm)
- msg.readInt16(); // unused
+ msg.readInt16(); // 0 unused
msg.readInt16(); // Level
msg.readInt16(); // SP
msg.readInt16(); // 'Range'
- msg.skip(24); // unused
+ msg.skip(24); // 0 unused
msg.readInt8(); // Can be increased
}
}
@@ -479,9 +479,10 @@ void GuildHandler::processGuildLeave(Net::MessageIn &msg)
void GuildHandler::processGuildExpulsion(Net::MessageIn &msg)
{
+ msg.skip(2); // size (can be many explusions in list)
std::string nick = msg.readString(24); // Name (of expulsed?)
- msg.readString(40); // Message
- msg.skip(24); // unused ("dummy")
+ msg.skip(24); // acc
+ msg.readString(44); // Message
if (taGuild)
taGuild->removeMember(nick);
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index 420236cfd..a23c83b63 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -159,7 +159,7 @@ void LoginHandler::processUpdateHost(Net::MessageIn &msg)
void LoginHandler::processLoginData(Net::MessageIn &msg)
{
// Skip the length word
- msg.skip(2);
+ msg.skip(2); // size
clearWorlds();
@@ -170,7 +170,7 @@ void LoginHandler::processLoginData(Net::MessageIn &msg)
mToken.session_ID2 = msg.readInt32();
msg.skip(4); // old ip
loginData.lastLogin = msg.readString(24);
- msg.skip(2); // unused bytes
+ msg.skip(2); // 0 unused bytes
// msg.skip(30); // unknown
// reserve bits for future usage
@@ -183,10 +183,11 @@ void LoginHandler::processLoginData(Net::MessageIn &msg)
world->address = msg.readInt32();
world->port = msg.readInt16();
world->name = msg.readString(20);
- world->online_users = msg.readInt32();
+ world->online_users = msg.readInt16();
config.setValue("updatehost", mUpdateHost);
world->updateHost = mUpdateHost;
- msg.skip(2); // unknown
+ msg.skip(2); // maintenance
+ msg.skip(2); // new
logger->log("Network: Server: %s (%s:%d)", world->name.c_str(),
ipToString(world->address), world->port);
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index 8373cb1c4..556e72c8d 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -320,7 +320,7 @@ void PartyHandler::processPartyMove(Net::MessageIn &msg)
m = Ea::taParty->getMember(id);
if (m)
{
- msg.skip(4);
+ msg.skip(4); // 0
m->setX(msg.readInt16()); // x
m->setY(msg.readInt16()); // y
m->setOnline(msg.readInt8()); // online (if 0)
@@ -330,7 +330,7 @@ void PartyHandler::processPartyMove(Net::MessageIn &msg)
}
else
{
- msg.skip(4);
+ msg.skip(4); // 0
msg.readInt16(); // x
msg.readInt16(); // y
msg.readInt8(); // online (if 0)
diff --git a/src/net/ea/specialhandler.cpp b/src/net/ea/specialhandler.cpp
index fe56db52a..4abcb004e 100644
--- a/src/net/ea/specialhandler.cpp
+++ b/src/net/ea/specialhandler.cpp
@@ -87,11 +87,11 @@ void SpecialHandler::processPlayerSkills(Net::MessageIn &msg)
{
int skillId = msg.readInt16();
msg.readInt16(); // target type
- msg.skip(2); // unused
+ msg.skip(2); // skill pool flags
int level = msg.readInt16();
msg.readInt16(); // sp
msg.readInt16(); // range
- msg.skip(24); // unused
+ msg.skip(24); // 0 unused
int up = msg.readInt8();
PlayerInfo::setStatBase(skillId, level);
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 69f7165ec..d08e4a091 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -190,7 +190,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
msg.readInt32(); // option
msg.readInt32(); // karma
msg.readInt32(); // manner
- msg.skip(2); // unknown
+ msg.readInt16(); // character points left
character->data.mAttributes[HP] = msg.readInt16();
character->data.mAttributes[MAX_HP] = msg.readInt16();
@@ -347,7 +347,7 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg)
loginData.characterSlots = static_cast<short unsigned int>(slots);
bool version = msg.readInt8() == 1 && serverVersion > 0;
- msg.skip(17); // Unused
+ msg.skip(17); // 0 Unused
delete_all(mCharacters);
mCharacters.clear();
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index bdc944d63..fba33297d 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -154,7 +154,7 @@ void LoginHandler::processServerVersion(Net::MessageIn &msg)
{
unsigned int options = msg.readInt8();
mRegistrationEnabled = options;
- msg.skip(2);
+ msg.skip(2); // 0 unused
serverVersion = msg.readInt8();
}
else