diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-14 22:44:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-14 22:44:37 +0300 |
commit | e1841e31c606f1d97ea54c3f00f3380db814f3d2 (patch) | |
tree | fa9c9b178fe5ba9ca931e67332aef016efa95145 /src/net/eathena | |
parent | 72938b640199d03d6092366224d3927d5d2a33b9 (diff) | |
download | manaverse-e1841e31c606f1d97ea54c3f00f3380db814f3d2.tar.gz manaverse-e1841e31c606f1d97ea54c3f00f3380db814f3d2.tar.bz2 manaverse-e1841e31c606f1d97ea54c3f00f3380db814f3d2.tar.xz manaverse-e1841e31c606f1d97ea54c3f00f3380db814f3d2.zip |
Rename readInt8 into readUInt8 because it really read uint8_t.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 38 | ||||
-rw-r--r-- | src/net/eathena/buysellhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/eathena/charserverhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/eathena/generalhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/eathena/loginhandler.cpp | 8 | ||||
-rw-r--r-- | src/net/eathena/npchandler.cpp | 4 | ||||
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 4 |
7 files changed, 35 insertions, 34 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index e21a1d0e6..d44b2508b 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -267,15 +267,15 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg, if (!dstBeing) return; - const int type = msg.readInt8(); + const uint8_t type = msg.readUInt8(); int id = 0; - int id2 = 0; + unsigned int id2 = 0U; const std::string color; if (!look2) { - id = msg.readInt8(); - id2 = 1; // default color + id = static_cast<int>(msg.readUInt8()); + id2 = 1U; // default color } else { // SMSG_BEING_CHANGE_LOOKS2 @@ -487,10 +487,10 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, const uint16_t headMid = msg.readInt16(); const int hairColor = msg.readInt16(); - msg.readInt8(); - msg.readInt8(); - msg.readInt8(); - msg.readInt8(); // unused + msg.readUInt8(); + msg.readUInt8(); + msg.readUInt8(); + msg.readUInt8(); // unused const int guild = msg.readInt32(); // guild @@ -505,10 +505,10 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, msg.readInt16(); // emblem msg.readInt16(); // manner dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3 - msg.readInt8(); // karma + msg.readUInt8(); // karma // reserving bit for future usage dstBeing->setGender(Being::intToGender( - static_cast<uint8_t>(msg.readInt8() & 3))); + static_cast<uint8_t>(msg.readUInt8() & 3U))); if (!disguiseId) { @@ -570,7 +570,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, if (msgType == 1 || msgType == 2) { - const int type = msg.readInt8(); + const uint8_t type = msg.readUInt8(); switch (type) { case 0: @@ -602,15 +602,15 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, } else if (msgType == 3) { - msg.readInt8(); // unknown + msg.readUInt8(); // unknown } - const int level = msg.readInt8(); // Lv + const int level = static_cast<int>(msg.readUInt8()); // Lv if (level) dstBeing->setLevel(level); - msg.readInt8(); // unknown + msg.readUInt8(); // unknown if (dstBeing->getType() != ActorType::PLAYER || msgType != 3) @@ -635,7 +635,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, return; if (visible) - msg.readInt8(); // padding? + msg.readUInt8(); // padding? // Information about a being in range const int id = msg.readInt32(); @@ -736,8 +736,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, msg.readInt16(); // manner dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3 - msg.readInt8(); // karma - uint8_t gender = msg.readInt8(); + msg.readUInt8(); // karma + uint8_t gender = msg.readUInt8(); if (dstBeing->getType() == ActorType::PLAYER) { @@ -806,8 +806,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, dstBeing->setDirection(dir); } - msg.readInt8(); // unknown - msg.readInt8(); // state / sit + msg.readUInt8(); // unknown + msg.readUInt8(); // state / sit msg.readInt16(); // level dstBeing->setStunMode(stunMode); diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp index 30fb8beae..a3d5dca23 100644 --- a/src/net/eathena/buysellhandler.cpp +++ b/src/net/eathena/buysellhandler.cpp @@ -101,7 +101,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg) { const int value = msg.readInt32(); msg.readInt32(); // DCvalue - msg.readInt8(); // type + msg.readUInt8(); // type const int itemId = msg.readInt16(); const unsigned char color = 1; mBuyDialog->addItem(itemId, color, 0, value); @@ -111,7 +111,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg) void BuySellHandler::processNpcSellResponse(Net::MessageIn &msg) { - switch (msg.readInt8()) + switch (msg.readUInt8()) { case 0: NotifyManager::notify(NotifyTypes::SOLD); diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index 47629c3dc..a7c77f122 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -183,7 +183,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, character->dummy = tempPlayer; for (int i = 0; i < 6; i++) - character->data.mStats[i + STR].base = msg.readInt8(); + character->data.mStats[i + STR].base = msg.readUInt8(); tempPlayer->setSprite(SPRITE_SHOE, shoes); tempPlayer->setSprite(SPRITE_GLOVES, gloves); @@ -197,9 +197,9 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, tempPlayer->setSprite(SPRITE_HAT, hat); // head option top tempPlayer->setSprite(SPRITE_TOPCLOTHES, topClothes); tempPlayer->setSprite(SPRITE_MISC2, misc2); - character->slot = msg.readInt8(); // character slot + character->slot = msg.readUInt8(); // character slot - msg.readInt8(); // unknown + msg.readUInt8(); // unknown } void CharServerHandler::chooseCharacter(Net::Character *const character) diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index 2b54be9cb..dcc4bc15c 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -120,8 +120,9 @@ void GeneralHandler::handleMessage(Net::MessageIn &msg) { case SMSG_CONNECTION_PROBLEM: { - const int code = msg.readInt8(); - logger->log("Connection problem: %i", code); + const uint8_t code = msg.readUInt8(); + logger->log("Connection problem: %u", + static_cast<unsigned int>(code)); switch (code) { diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp index 8ca8bd1b7..99017dfdc 100644 --- a/src/net/eathena/loginhandler.cpp +++ b/src/net/eathena/loginhandler.cpp @@ -162,10 +162,10 @@ void LoginHandler::requestUpdateHosts() void LoginHandler::processServerVersion(Net::MessageIn &msg) { - msg.readInt8(); - msg.readInt8(); - msg.readInt8(); - msg.readInt8(); + msg.readUInt8(); + msg.readUInt8(); + msg.readUInt8(); + msg.readUInt8(); msg.readInt32(); mRegistrationEnabled = true; serverVersion = 0; diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index 75db7396b..297e333cf 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -245,7 +245,7 @@ void NpcHandler::processNpcCutin(Net::MessageIn &msg A_UNUSED, const int npcId A_UNUSED) { msg.readString(64); // image name - msg.readInt8(); // type + msg.readUInt8(); // type } void NpcHandler::processNpcViewPoint(Net::MessageIn &msg A_UNUSED, @@ -254,7 +254,7 @@ void NpcHandler::processNpcViewPoint(Net::MessageIn &msg A_UNUSED, msg.readInt32(); // type msg.readInt32(); // x msg.readInt32(); // y - msg.readInt8(); // byte + msg.readUInt8(); // byte msg.readInt32(); // color } diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index 2aad363c0..150e86d6c 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -230,7 +230,7 @@ void PlayerHandler::processPlayerShortcuts(Net::MessageIn &msg) { for (int f = 0; f < 27; f ++) { - msg.readInt8(); // type 0: item, 1: skill + msg.readUInt8(); // type 0: item, 1: skill msg.readInt32(); // item or skill id msg.readInt16(); // lvl } @@ -238,7 +238,7 @@ void PlayerHandler::processPlayerShortcuts(Net::MessageIn &msg) void PlayerHandler::processPlayerShowEquip(Net::MessageIn &msg) { - msg.readInt8(); // show equip + msg.readUInt8(); // show equip } } // namespace EAthena |