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/ea | |
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/ea')
-rw-r--r-- | src/net/ea/beinghandler.cpp | 37 | ||||
-rw-r--r-- | src/net/ea/buysellhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/charserverhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 18 | ||||
-rw-r--r-- | src/net/ea/gamehandler.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/guildhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.cpp | 48 | ||||
-rw-r--r-- | src/net/ea/itemhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/ea/loginhandler.cpp | 9 | ||||
-rw-r--r-- | src/net/ea/partyhandler.cpp | 14 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 52 | ||||
-rw-r--r-- | src/net/ea/skillhandler.cpp | 8 | ||||
-rw-r--r-- | src/net/ea/tradehandler.cpp | 20 |
13 files changed, 120 insertions, 120 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index bffe6ef81..b7e9a0467 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -208,8 +208,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, if (speed == 0) speed = 150; - const int hairStyle = msg.readInt8(); - const uint8_t look = msg.readInt8(); + const uint8_t hairStyle = msg.readUInt8(); + const uint8_t look = msg.readUInt8(); dstBeing->setSubtype(job, look); if (dstBeing->getType() == ActorType::MONSTER && player_node) player_node->checkNewName(dstBeing); @@ -223,8 +223,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, const uint16_t shield = msg.readInt16(); const uint16_t headTop = msg.readInt16(); const uint16_t headMid = msg.readInt16(); - const unsigned char hairColor = msg.readInt8(); - msg.readInt8(); // free + const uint8_t hairColor = msg.readUInt8(); + msg.readUInt8(); // free const uint16_t shoes = msg.readInt16(); // clothes color uint16_t gloves; @@ -261,14 +261,14 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3 if (serverVersion > 0 && dstBeing->getType() == ActorType::MONSTER) { - const int attackRange = msg.readInt8(); // karma + const int attackRange = static_cast<int>(msg.readUInt8()); // karma dstBeing->setAttackRange(attackRange); } else { - msg.readInt8(); // karma + msg.readUInt8(); // karma } - uint8_t gender = msg.readInt8(); + uint8_t gender = msg.readUInt8(); if (!disguiseId && dstBeing->getType() == ActorType::PLAYER) { @@ -343,8 +343,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, dstBeing->setDirection(dir); } - msg.readInt8(); // unknown - msg.readInt8(); // unknown + msg.readUInt8(); // unknown + msg.readUInt8(); // unknown msg.readInt16(); dstBeing->setStunMode(stunMode); @@ -434,7 +434,7 @@ void BeingHandler::processBeingRemove(Net::MessageIn &msg) const if (dstBeing == player_node->getTarget()) player_node->stopAttack(true); - if (msg.readInt8() == 1) + if (msg.readUInt8() == 1U) { if (dstBeing->getCurrentAction() != BeingAction::DEAD) { @@ -481,7 +481,7 @@ void BeingHandler::processBeingResurrect(Net::MessageIn &msg) const if (dstBeing == player_node->getTarget()) player_node->stopAttack(); - if (msg.readInt8() == 1) + if (msg.readUInt8() == 1U) dstBeing->setAction(BeingAction::STAND, 0); BLOCK_END("BeingHandler::processBeingResurrect") } @@ -504,7 +504,7 @@ void BeingHandler::processSkillDamage(Net::MessageIn &msg) const const int param1 = msg.readInt32(); // Damage const int level = msg.readInt16(); // Skill level msg.readInt16(); // Div - msg.readInt8(); // Skill hit/type (?) + msg.readUInt8(); // Skill hit/type (?) if (srcBeing) srcBeing->handleSkill(dstBeing, param1, id, level); if (dstBeing) @@ -529,7 +529,7 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const msg.readInt32(); // dst speed const int param1 = msg.readInt16(); msg.readInt16(); // param 2 - const int type = msg.readInt8(); + const uint8_t type = msg.readUInt8(); msg.readInt16(); // param 3 switch (type) @@ -650,7 +650,7 @@ void BeingHandler::processBeingEmotion(Net::MessageIn &msg) const if (player_relations.hasPermission(dstBeing, PlayerRelation::EMOTE)) { - const unsigned char emote = msg.readInt8(); + const uint8_t emote = msg.readUInt8(); if (emote) { dstBeing->setEmote(emote, 0); @@ -770,8 +770,7 @@ void BeingHandler::processBeingChangeDirection(Net::MessageIn &msg) const msg.readInt16(); // unused - const unsigned char dir = static_cast<unsigned char>( - msg.readInt8() & 0x0f); + const uint8_t dir = static_cast<uint8_t>(msg.readUInt8() & 0x0FU); dstBeing->setDirection(dir); if (player_node) player_node->imitateDirection(dstBeing, dir); @@ -837,7 +836,7 @@ void BeingHandler::processPlaterStatusChange(Net::MessageIn &msg) const const uint16_t stunMode = msg.readInt16(); uint32_t statusEffects = msg.readInt16(); statusEffects |= (static_cast<uint32_t>(msg.readInt16())) << 16; - msg.readInt8(); // Unused? + msg.readUInt8(); // Unused? dstBeing->setStunMode(stunMode); dstBeing->setStatusEffectBlock(0, static_cast<uint16_t>( @@ -859,7 +858,7 @@ void BeingHandler::processBeingStatusChange(Net::MessageIn &msg) const // Status change const uint16_t status = msg.readInt16(); const int id = msg.readInt32(); - const int flag = msg.readInt8(); // 0: stop, 1: start + const bool flag = msg.readUInt8(); // 0: stop, 1: start Being *const dstBeing = actorManager->findBeing(id); if (dstBeing) @@ -884,7 +883,7 @@ void BeingHandler::processSkillNoDamage(Net::MessageIn &msg) const msg.readInt16(); // heal msg.readInt32(); // dst id msg.readInt32(); // src id - msg.readInt8(); // fail + msg.readUInt8(); // fail } void BeingHandler::processPvpMapMode(Net::MessageIn &msg) const diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index f8871748f..f8a6651ef 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -169,7 +169,7 @@ void BuySellHandler::processNpcSell(Net::MessageIn &msg, void BuySellHandler::processNpcBuyResponse(Net::MessageIn &msg) const { - if (msg.readInt8() == 0) + if (msg.readUInt8() == 0U) { NotifyManager::notify(NotifyTypes::BUY_DONE); } diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index d7ad9fd11..a0358dbb4 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -124,7 +124,7 @@ unsigned int CharServerHandler::maxSprite() const void CharServerHandler::processCharLoginError(Net::MessageIn &msg) const { BLOCK_START("CharServerHandler::processCharLoginError") - switch (msg.readInt8()) + switch (msg.readUInt8()) { case 0: // TRANSLATORS: error message @@ -166,7 +166,7 @@ void CharServerHandler::processCharCreate(Net::MessageIn &msg, void CharServerHandler::processCharCreateFailed(Net::MessageIn &msg) { BLOCK_START("CharServerHandler::processCharCreateFailed") - switch (msg.readInt8()) + switch (msg.readUInt8()) { case 1: case 0: diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 5c972db6b..4bbff5081 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -96,7 +96,7 @@ void ChatHandler::processWhisperResponse(Net::MessageIn &msg) mSentWhispers.pop(); } - const int type = msg.readInt8(); + const uint8_t type = msg.readUInt8(); switch (type) { case 0x00: @@ -283,9 +283,9 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg, if (channels) { chatMsgLength -= 3; - channel = msg.readInt8(); - channel += msg.readInt8(); - channel += msg.readInt8(); + channel = msg.readUInt8(); + channel += msg.readUInt8(); + channel += msg.readUInt8(); } if (chatMsgLength <= 0) @@ -352,9 +352,9 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat, if (channels) { chatMsgLength -= 3; - channel = msg.readInt8(); - channel += msg.readInt8(); - channel += msg.readInt8(); + channel = msg.readUInt8(); + channel += msg.readUInt8(); + channel += msg.readUInt8(); } if (chatMsgLength <= 0) { @@ -434,8 +434,8 @@ void ChatHandler::processMVP(Net::MessageIn &msg) const void ChatHandler::processIgnoreAllResponse(Net::MessageIn &msg) const { BLOCK_START("ChatHandler::processIgnoreAllResponse") - const int action = msg.readInt8(); - const int fail = msg.readInt8(); + const uint8_t action = msg.readUInt8(); + const uint8_t fail = msg.readUInt8(); if (!localChatTab) { BLOCK_END("ChatHandler::processIgnoreAllResponse") diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index afebc93a1..028ad8937 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -81,13 +81,13 @@ void GameHandler::processWhoAnswer(Net::MessageIn &msg) const void GameHandler::processCharSwitchResponse(Net::MessageIn &msg) const { - if (msg.readInt8()) + if (msg.readUInt8()) client->setState(STATE_SWITCH_CHARACTER); } void GameHandler::processMapQuitResponse(Net::MessageIn &msg) const { - if (msg.readInt8()) + if (msg.readUInt8()) { new OkDialog(_("Game"), _("Request to quit denied!"), DialogType::ERROR); diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp index 68d6a774b..42c6b0ec5 100644 --- a/src/net/ea/guildhandler.cpp +++ b/src/net/ea/guildhandler.cpp @@ -74,7 +74,7 @@ void GuildHandler::endAlliance(const int guildId A_UNUSED, void GuildHandler::processGuildCreateResponse(Net::MessageIn &msg) const { - const int flag = msg.readInt8(); + const uint8_t flag = msg.readUInt8(); switch (flag) { @@ -111,7 +111,7 @@ void GuildHandler::processGuildPositionInfo(Net::MessageIn &msg) const const int emblem = msg.readInt32(); const int posMode = msg.readInt32(); msg.readInt32(); // Unused - msg.readInt8(); // Unused + msg.readUInt8(); // Unused std::string guildName = msg.readString(24); Guild *const g = Guild::getGuild(static_cast<int16_t>(guildId)); @@ -395,7 +395,7 @@ void GuildHandler::processGuildSkillInfo(Net::MessageIn &msg) const msg.readInt16(); // SP msg.readInt16(); // 'Range' msg.skip(24); // 0 unused - msg.readInt8(); // Can be increased + msg.readUInt8(); // Can be increased } } @@ -421,7 +421,7 @@ void GuildHandler::processGuildInvite(Net::MessageIn &msg) const void GuildHandler::processGuildInviteAck(Net::MessageIn &msg) const { - const int flag = msg.readInt8(); + const uint8_t flag = msg.readUInt8(); if (!guildTab) return; @@ -580,7 +580,7 @@ void GuildHandler::processGuildSkillUp(Net::MessageIn &msg) const msg.readInt16(); // Level msg.readInt16(); // SP msg.readInt16(); // 'Range' - msg.readInt8(); // unused? (always 1) + msg.readUInt8(); // unused? (always 1) } void GuildHandler::processGuildReqAlliance(Net::MessageIn &msg) const @@ -602,7 +602,7 @@ void GuildHandler::processGuildDelAlliance(Net::MessageIn &msg) const void GuildHandler::processGuildOppositionAck(Net::MessageIn &msg) const { - msg.readInt8(); // Flag + msg.readUInt8(); // Flag } void GuildHandler::processGuildBroken(Net::MessageIn &msg) const diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index 09b8b6bad..6788784b2 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -205,8 +205,8 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg, const int index = msg.readInt16() - (playerInvintory ? INVENTORY_OFFSET : STORAGE_OFFSET); const int itemId = msg.readInt16(); - const int itemType = msg.readInt8(); - unsigned char identified = msg.readInt8(); + const uint8_t itemType = msg.readUInt8(); + uint8_t identified = msg.readUInt8(); const int amount = msg.readInt16(); const int arrow = msg.readInt16(); for (int i = 0; i < 4; i++) @@ -254,13 +254,13 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg) int cards[4]; const int index = msg.readInt16() - STORAGE_OFFSET; const int itemId = msg.readInt16(); - const int itemType = msg.readInt8(); - unsigned char identified = msg.readInt8(); + const uint8_t itemType = msg.readUInt8(); + uint8_t identified = msg.readUInt8(); const int amount = 1; msg.readInt16(); // Equip Point? msg.readInt16(); // Another Equip Point? - msg.readInt8(); // Attribute (broken) - const int refine = msg.readInt8(); + msg.readUInt8(); // Attribute (broken) + const uint8_t refine = msg.readUInt8(); for (int i = 0; i < 4; i++) cards[i] = msg.readInt16(); @@ -273,8 +273,8 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg) refine); } - if (serverVersion < 1 && identified > 1) - identified = 1; + if (serverVersion < 1 && identified > 1U) + identified = 1U; mInventoryItems.push_back(Ea::InventoryItem(index, itemId, amount, refine, identified, false)); @@ -297,16 +297,16 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) const int index = msg.readInt16() - INVENTORY_OFFSET; int amount = msg.readInt16(); const int itemId = msg.readInt16(); - unsigned char identified = msg.readInt8(); - msg.readInt8(); // attribute - const int refine = msg.readInt8(); + uint8_t identified = msg.readUInt8(); + msg.readUInt8(); // attribute + const int refine = msg.readUInt8(); for (int i = 0; i < 4; i++) msg.readInt16(); // cards[i] const int equipType = msg.readInt16(); - msg.readInt8(); // itemType + msg.readUInt8(); // itemType const ItemInfo &itemInfo = ItemDB::get(itemId); - const unsigned char err = msg.readInt8(); + const unsigned char err = msg.readUInt8(); int floorId; if (mSentPickups.empty()) { @@ -380,7 +380,7 @@ void InventoryHandler::processPlayerInventoryUse(Net::MessageIn &msg) msg.readInt16(); // item id msg.readInt32(); // id const int amount = msg.readInt16(); - msg.readInt8(); // type + msg.readUInt8(); // type if (inventory) { @@ -404,7 +404,7 @@ void InventoryHandler::processItemUseResponse(Net::MessageIn &msg) const int index = msg.readInt16() - INVENTORY_OFFSET; const int amount = msg.readInt16(); - if (msg.readInt8() == 0) + if (msg.readUInt8() == 0) { NotifyManager::notify(NotifyTypes::USE_FAILED); } @@ -460,9 +460,9 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg) const int index = msg.readInt16() - STORAGE_OFFSET; const int amount = msg.readInt32(); const int itemId = msg.readInt16(); - unsigned char identified = msg.readInt8(); - msg.readInt8(); // attribute - const int refine = msg.readInt8(); + unsigned char identified = msg.readUInt8(); + msg.readUInt8(); // attribute + const uint8_t refine = msg.readUInt8(); for (int i = 0; i < 4; i++) msg.readInt16(); // card i @@ -541,13 +541,13 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg) { const int index = msg.readInt16() - INVENTORY_OFFSET; const int itemId = msg.readInt16(); - const int itemType = msg.readInt8(); // type - unsigned char identified = msg.readInt8(); // identify flag + const uint8_t itemType = msg.readUInt8(); // type + uint8_t identified = msg.readUInt8(); // identify flag msg.readInt16(); // equip type const int equipType = msg.readInt16(); - msg.readInt8(); // attribute - const int refine = msg.readInt8(); + msg.readUInt8(); // attribute + const uint8_t refine = msg.readUInt8(); msg.skip(8); // card if (mDebugInventory) @@ -576,7 +576,7 @@ void InventoryHandler::processPlayerEquip(Net::MessageIn &msg) BLOCK_START("InventoryHandler::processPlayerEquip") const int index = msg.readInt16() - INVENTORY_OFFSET; const int equipType = msg.readInt16(); - const int flag = msg.readInt8(); + const uint8_t flag = msg.readUInt8(); if (!flag) NotifyManager::notify(NotifyTypes::EQUIP_FAILED); @@ -590,7 +590,7 @@ void InventoryHandler::processPlayerUnEquip(Net::MessageIn &msg) BLOCK_START("InventoryHandler::processPlayerUnEquip") msg.readInt16(); // inder val - INVENTORY_OFFSET; const int equipType = msg.readInt16(); - const int flag = msg.readInt8(); + const uint8_t flag = msg.readUInt8(); if (flag) mEquips.setEquipment(getSlot(equipType), -1); diff --git a/src/net/ea/itemhandler.cpp b/src/net/ea/itemhandler.cpp index 383ba2753..8719c6256 100644 --- a/src/net/ea/itemhandler.cpp +++ b/src/net/ea/itemhandler.cpp @@ -43,12 +43,12 @@ void ItemHandler::processItemVisible(Net::MessageIn &msg) { const int id = msg.readInt32(); const int itemId = msg.readInt16(); - const unsigned char identify = msg.readInt8(); // identify flag + const uint8_t identify = msg.readUInt8(); // identify flag const int x = msg.readInt16(); const int y = msg.readInt16(); const int amount = msg.readInt16(); - const int subX = msg.readInt8(); - const int subY = msg.readInt8(); + const int subX = msg.readUInt8(); + const int subY = msg.readUInt8(); if (actorManager) { @@ -61,11 +61,11 @@ void ItemHandler::processItemDropped(Net::MessageIn &msg) { const int id = msg.readInt32(); const int itemId = msg.readInt16(); - const unsigned char identify = msg.readInt8(); // identify flag + const uint8_t identify = msg.readUInt8(); // identify flag const int x = msg.readInt16(); const int y = msg.readInt16(); - const int subX = msg.readInt8(); - const int subY = msg.readInt8(); + const int subX = static_cast<int>(msg.readUInt8()); + const int subY = static_cast<int>(msg.readUInt8()); const int amount = msg.readInt16(); if (actorManager) diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 451850430..ece10c725 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -136,7 +136,7 @@ void LoginHandler::clearWorlds() void LoginHandler::procecessCharPasswordResponse(Net::MessageIn &msg) const { // 0: acc not found, 1: success, 2: password mismatch, 3: pass too short - const int errMsg = msg.readInt8(); + const uint8_t errMsg = msg.readUInt8(); // Successful pass change if (errMsg == 1) { @@ -203,7 +203,8 @@ void LoginHandler::processLoginData(Net::MessageIn &msg) // msg.skip(30); // unknown // reserve bits for future usage - mToken.sex = Being::intToGender(static_cast<uint8_t>(msg.readInt8() & 3)); + mToken.sex = Being::intToGender(static_cast<uint8_t>( + msg.readUInt8() & 3U)); for (int i = 0; i < worldCount; i++) { @@ -228,8 +229,8 @@ void LoginHandler::processLoginData(Net::MessageIn &msg) void LoginHandler::processLoginError(Net::MessageIn &msg) const { - const int code = msg.readInt8(); - logger->log("Login::error code: %i", code); + const uint8_t code = msg.readUInt8(); + logger->log("Login::error code: %u", static_cast<unsigned int>(code)); switch (code) { diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 8ba78cd91..2b83d9eb8 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -75,7 +75,7 @@ void PartyHandler::clear() const void PartyHandler::processPartyCreate(Net::MessageIn &msg) const { - if (msg.readInt8()) + if (msg.readUInt8()) NotifyManager::notify(NotifyTypes::PARTY_CREATE_FAILED); else NotifyManager::notify(NotifyTypes::PARTY_CREATED); @@ -129,8 +129,8 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const const int id = msg.readInt32(); std::string nick = msg.readString(24); std::string map = msg.readString(16); - const bool leader = msg.readInt8() == 0; - const bool online = msg.readInt8() == 0; + const bool leader = msg.readUInt8() == 0U; + const bool online = msg.readUInt8() == 0U; if (Ea::taParty) { @@ -191,7 +191,7 @@ void PartyHandler::processPartyInviteResponse(Net::MessageIn &msg) const const std::string nick = msg.readString(24); - switch (msg.readInt8()) + switch (msg.readUInt8()) { case 0: NotifyManager::notify(NotifyTypes::PARTY_INVITE_ALREADY_MEMBER, @@ -314,7 +314,7 @@ void PartyHandler::processPartyMove(Net::MessageIn &msg) const msg.skip(4); // 0 m->setX(msg.readInt16()); // x m->setY(msg.readInt16()); // y - const int online = msg.readInt8(); + const bool online = msg.readUInt8() != 0; if (m->getOnline() != online) Ea::partyTab->showOnline(m->getName(), online); m->setOnline(online); // online (if 0) @@ -327,7 +327,7 @@ void PartyHandler::processPartyMove(Net::MessageIn &msg) const msg.skip(4); // 0 msg.readInt16(); // x msg.readInt16(); // y - msg.readInt8(); // online (if 0) + msg.readUInt8(); // online (if 0) msg.readString(24); // party msg.readString(24); // nick msg.readString(16); // map @@ -338,7 +338,7 @@ void PartyHandler::processPartyLeave(Net::MessageIn &msg) const { const int id = msg.readInt32(); const std::string nick = msg.readString(24); - msg.readInt8(); // fail + msg.readUInt8(); // fail if (!player_node) return; diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 9e2a0dfb3..31e298fdc 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -442,8 +442,8 @@ void PlayerHandler::processPlayerStatUpdate4(Net::MessageIn &msg) { BLOCK_START("PlayerHandler::processPlayerStatUpdate4") const int type = msg.readInt16(); - const int ok = msg.readInt8(); - const int value = msg.readInt8(); + const uint8_t ok = msg.readUInt8(); + const int value = msg.readUInt8(); if (ok != 1) { @@ -463,47 +463,47 @@ void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg) BLOCK_START("PlayerHandler::processPlayerStatUpdate5") PlayerInfo::setAttribute(Attributes::CHAR_POINTS, msg.readInt16()); - int val = msg.readInt8(); + unsigned int val = msg.readUInt8(); PlayerInfo::setStatBase(EA_STR, val); if (statusWindow) - statusWindow->setPointsNeeded(EA_STR, msg.readInt8()); + statusWindow->setPointsNeeded(EA_STR, msg.readUInt8()); else - msg.readInt8(); + msg.readUInt8(); - val = msg.readInt8(); + val = msg.readUInt8(); PlayerInfo::setStatBase(EA_AGI, val); if (statusWindow) - statusWindow->setPointsNeeded(EA_AGI, msg.readInt8()); + statusWindow->setPointsNeeded(EA_AGI, msg.readUInt8()); else - msg.readInt8(); + msg.readUInt8(); - val = msg.readInt8(); + val = msg.readUInt8(); PlayerInfo::setStatBase(EA_VIT, val); if (statusWindow) - statusWindow->setPointsNeeded(EA_VIT, msg.readInt8()); + statusWindow->setPointsNeeded(EA_VIT, msg.readUInt8()); else - msg.readInt8(); + msg.readUInt8(); - val = msg.readInt8(); + val = msg.readUInt8(); PlayerInfo::setStatBase(EA_INT, val); if (statusWindow) - statusWindow->setPointsNeeded(EA_INT, msg.readInt8()); + statusWindow->setPointsNeeded(EA_INT, msg.readUInt8()); else - msg.readInt8(); + msg.readUInt8(); - val = msg.readInt8(); + val = msg.readUInt8(); PlayerInfo::setStatBase(EA_DEX, val); if (statusWindow) - statusWindow->setPointsNeeded(EA_DEX, msg.readInt8()); + statusWindow->setPointsNeeded(EA_DEX, msg.readUInt8()); else - msg.readInt8(); + msg.readUInt8(); - val = msg.readInt8(); + val = msg.readUInt8(); PlayerInfo::setStatBase(EA_LUK, val); if (statusWindow) - statusWindow->setPointsNeeded(EA_LUK, msg.readInt8()); + statusWindow->setPointsNeeded(EA_LUK, msg.readUInt8()); else - msg.readInt8(); + msg.readUInt8(); PlayerInfo::setStatBase(EA_ATK, msg.readInt16(), false); PlayerInfo::setStatMod(EA_ATK, msg.readInt16()); @@ -541,22 +541,22 @@ void PlayerHandler::processPlayerStatUpdate6(Net::MessageIn &msg) switch (type) { case 0x0020: - statusWindow->setPointsNeeded(EA_STR, msg.readInt8()); + statusWindow->setPointsNeeded(EA_STR, msg.readUInt8()); break; case 0x0021: - statusWindow->setPointsNeeded(EA_AGI, msg.readInt8()); + statusWindow->setPointsNeeded(EA_AGI, msg.readUInt8()); break; case 0x0022: - statusWindow->setPointsNeeded(EA_VIT, msg.readInt8()); + statusWindow->setPointsNeeded(EA_VIT, msg.readUInt8()); break; case 0x0023: - statusWindow->setPointsNeeded(EA_INT, msg.readInt8()); + statusWindow->setPointsNeeded(EA_INT, msg.readUInt8()); break; case 0x0024: - statusWindow->setPointsNeeded(EA_DEX, msg.readInt8()); + statusWindow->setPointsNeeded(EA_DEX, msg.readUInt8()); break; case 0x0025: - statusWindow->setPointsNeeded(EA_LUK, msg.readInt8()); + statusWindow->setPointsNeeded(EA_LUK, msg.readUInt8()); break; default: logger->log("QQQQ PLAYER_STAT_UPDATE_6 " diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp index 002309de4..e7ac66d7a 100644 --- a/src/net/ea/skillhandler.cpp +++ b/src/net/ea/skillhandler.cpp @@ -90,7 +90,7 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg) msg.readInt16(); // sp const int range = msg.readInt16(); msg.skip(24); // 0 unused - const int up = msg.readInt8(); + const int up = msg.readUInt8(); const int oldLevel = PlayerInfo::getSkillLevel(skillId); if (oldLevel && oldLevel != level) updateSkill = skillId; @@ -111,7 +111,7 @@ void SkillHandler::processPlayerSkillUp(Net::MessageIn &msg) const int level = msg.readInt16(); msg.readInt16(); // sp const int range = msg.readInt16(); - const int up = msg.readInt8(); + const int up = msg.readUInt8(); if (skillDialog && PlayerInfo::getSkillLevel(skillId) != level) skillDialog->playUpdateEffect(skillId); @@ -130,8 +130,8 @@ void SkillHandler::processSkillFailed(Net::MessageIn &msg) const int skillId = msg.readInt16(); const int16_t bskill = msg.readInt16(); msg.readInt16(); // btype - const signed char success = msg.readInt8(); - const signed char reason = msg.readInt8(); + const signed char success = msg.readUInt8(); + const signed char reason = msg.readUInt8(); if (success != static_cast<int>(SKILL_FAILED) && bskill == static_cast<int>(BSKILL_EMOTE)) { diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index b328086fc..0d0fd05da 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -128,7 +128,7 @@ void TradeHandler::processTradeResponse(Net::MessageIn &msg) const return; } - switch (msg.readInt8()) + switch (msg.readUInt8()) { case 0: // Too far away NotifyManager::notify(NotifyTypes::TRADE_FAIL_FAR_AWAY, @@ -181,10 +181,10 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg) { const int amount = msg.readInt32(); const int type = msg.readInt16(); - const int identify = msg.readInt8(); // identified flag - msg.readInt8(); // attribute - const int refine = msg.readInt8(); // refine - msg.skip(8); // card (4 shorts) + const uint8_t identify = msg.readUInt8(); // identified flag + msg.readUInt8(); // attribute + const int refine = msg.readUInt8(); // refine + msg.skip(8); // card (4 shorts) if (tradeWindow) { @@ -194,8 +194,8 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg) } else { - tradeWindow->addItem2(type, false, amount, refine, - static_cast<unsigned char>(identify), false); + tradeWindow->addItem2(type, false, amount, + refine, identify, false); } } } @@ -216,7 +216,7 @@ void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg) } const int quantity = msg.readInt16(); - const int res = msg.readInt8(); + const uint8_t res = msg.readUInt8(); switch (res) { case 0: @@ -254,9 +254,9 @@ void TradeHandler::processTradeOk(Net::MessageIn &msg) { // 0 means ok from myself, 1 means ok from other; if (tradeWindow) - tradeWindow->receivedOk(msg.readInt8() == 0); + tradeWindow->receivedOk(msg.readUInt8() == 0U); else - msg.readInt8(); + msg.readUInt8(); } void TradeHandler::processTradeCancel(Net::MessageIn &msg A_UNUSED) |