diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-12 18:39:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-12 18:39:00 +0300 |
commit | 351821c1f18f9285be58df0a05339936311f6490 (patch) | |
tree | 47a60cad4f61f63c5ac2faf98dcae24760d7fe11 /src/net/tmwa | |
parent | e50632a83a3c679cffd372656277a304d5d853f8 (diff) | |
download | manaverse-351821c1f18f9285be58df0a05339936311f6490.tar.gz manaverse-351821c1f18f9285be58df0a05339936311f6490.tar.bz2 manaverse-351821c1f18f9285be58df0a05339936311f6490.tar.xz manaverse-351821c1f18f9285be58df0a05339936311f6490.zip |
first part of style fixed after cpplint checks.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/adminhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 26 | ||||
-rw-r--r-- | src/net/tmwa/buysellhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/charserverhandler.cpp | 29 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 3 | ||||
-rw-r--r-- | src/net/tmwa/gui/guildtab.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/gui/partytab.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/guildhandler.cpp | 44 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/itemhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/loginhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/tmwa/messagehandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/messagein.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/messageout.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/network.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 34 | ||||
-rw-r--r-- | src/net/tmwa/partyhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/questhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/skillhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/tradehandler.cpp | 2 |
23 files changed, 98 insertions, 110 deletions
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index 667972539..c156b9f51 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -87,7 +87,7 @@ void AdminHandler::localAnnounce(const std::string &text) const void AdminHandler::hide(const bool h A_UNUSED) const { MessageOut outMsg(CMSG_ADMIN_HIDE); - outMsg.writeInt32(0); //unused + outMsg.writeInt32(0); // unused } void AdminHandler::kick(const int playerId) const @@ -96,4 +96,4 @@ void AdminHandler::kick(const int playerId) const outMsg.writeInt32(playerId); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 2d8cc8b7a..8e367b0c3 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -102,7 +102,7 @@ BeingHandler::BeingHandler(bool enableSync) : void BeingHandler::requestNameById(const int id) const { MessageOut outMsg(0x0094); - outMsg.writeInt32(id); //readLong(2)); + outMsg.writeInt32(id); // readLong(2)); } void BeingHandler::handleMessage(Net::MessageIn &msg) @@ -434,10 +434,10 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, // An update about a player, potentially including movement. const int id = msg.readInt32(); const short speed = msg.readInt16(); - const uint16_t stunMode = msg.readInt16(); // opt1; - uint32_t statusEffects = msg.readInt16(); // opt2; + const uint16_t stunMode = msg.readInt16(); // opt1; + uint32_t statusEffects = msg.readInt16(); // opt2; statusEffects |= (static_cast<uint32_t>(msg.readInt16())) - << 16; // status.options; Aethyra uses this as misc2 + << 16; // status.options; Aethyra uses this as misc2 const short job = msg.readInt16(); Being *dstBeing = actorSpriteManager->findBeing(id); @@ -475,7 +475,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, const uint16_t headBottom = msg.readInt16(); if (msgType == 3) - msg.readInt32(); // server tick + msg.readInt32(); // server tick const uint16_t headTop = msg.readInt16(); const uint16_t headMid = msg.readInt16(); @@ -486,9 +486,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, colors[1] = msg.readInt8(); colors[2] = msg.readInt8(); - msg.readInt8(); //unused -// shoes = msg.readInt16(); -// gloves = msg.readInt16(); //sd->head_dir + msg.readInt8(); //unused const int guild = msg.readInt32(); // guild @@ -512,7 +510,6 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, dstBeing->setSprite(SPRITE_WEAPON, weapon, "", 1, true); if (!mHideShield) dstBeing->setSprite(SPRITE_SHIELD, shield); - //dstBeing->setSprite(SPRITE_SHOE, shoes); if (serverVersion > 0) { dstBeing->setSprite(SPRITE_BOTTOMCLOTHES, headBottom, @@ -526,10 +523,6 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, dstBeing->setSprite(SPRITE_TOPCLOTHES, headMid); dstBeing->setSprite(SPRITE_HAT, headTop); } - //dstBeing->setSprite(SPRITE_GLOVES, gloves); - //dstBeing->setSprite(SPRITE_CAPE, cape); - //dstBeing->setSprite(SPRITE_MISC1, misc1); - //dstBeing->setSprite(SPRITE_MISC2, misc2); dstBeing->setSprite(SPRITE_HAIR, hairStyle * -1, ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); dstBeing->setHairColor(hairColor); @@ -617,20 +610,19 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, } else if (msgType == 3) { - msg.readInt8(); // unknown + msg.readInt8(); // unknown } const int level = msg.readInt8(); // Lv if (level) dstBeing->setLevel(level); - msg.readInt8(); // unknown + msg.readInt8(); // unknown if (dstBeing->getType() != Being::PLAYER || msgType != 3) { dstBeing->setActionTime(tick_time); -// dstBeing->reset(); } dstBeing->setStunMode(stunMode); @@ -643,4 +635,4 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg, dstBeing->setMoveTime(); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index 5d173ae17..8bb426bef 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -143,4 +143,4 @@ void BuySellHandler::processNpcSellResponse(Net::MessageIn &msg) const } } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index d2f727af9..3a72ffa03 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -157,19 +157,19 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, data.mAttributes[PlayerInfo::MP] = msg.readInt16(); data.mAttributes[PlayerInfo::MAX_MP] = msg.readInt16(); - msg.readInt16(); // speed - tempPlayer->setSubtype(msg.readInt16()); // class (used for race) + msg.readInt16(); // speed + tempPlayer->setSubtype(msg.readInt16()); // class (used for race) const int hairStyle = msg.readInt16(); - const uint16_t weapon = msg.readInt16(); // unused on server. need use? + const uint16_t weapon = msg.readInt16(); // unused on server. need use? tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", 1, true); data.mAttributes[PlayerInfo::LEVEL] = msg.readInt16(); - msg.readInt16(); // skill point + msg.readInt16(); // skill point const int bottomClothes = msg.readInt16(); const int shield = msg.readInt16(); - const int hat = msg.readInt16(); // head option top + const int hat = msg.readInt16(); // head option top const int topClothes = msg.readInt16(); int hairColor = msg.readInt16(); @@ -195,19 +195,19 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, tempPlayer->setSprite(SPRITE_MISC1, misc1, "", msg.readInt8()); tempPlayer->setSprite(SPRITE_BOTTOMCLOTHES, bottomClothes, "", msg.readInt8()); - //to avoid show error (error.xml) need remove this sprite + // to avoid show error (error.xml) need remove this sprite if (!config.getBoolValue("hideShield")) tempPlayer->setSprite(SPRITE_SHIELD, shield, "", msg.readInt8()); else msg.readInt8(); tempPlayer->setSprite(SPRITE_HAT, hat, "", - msg.readInt8()); // head option top + msg.readInt8()); // head option top tempPlayer->setSprite(SPRITE_TOPCLOTHES, topClothes, "", msg.readInt8()); tempPlayer->setSprite(SPRITE_MISC2, misc2, "", msg.readInt8()); msg.skip(5); - character->slot = msg.readInt8(); // character slot + character->slot = msg.readInt8(); // character slot } else { @@ -216,17 +216,16 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, tempPlayer->setSprite(SPRITE_CAPE, cape); tempPlayer->setSprite(SPRITE_MISC1, misc1); tempPlayer->setSprite(SPRITE_BOTTOMCLOTHES, bottomClothes); - //to avoid show error (error.xml) need remove this sprite + // to avoid show error (error.xml) need remove this sprite if (!config.getBoolValue("hideShield")) tempPlayer->setSprite(SPRITE_SHIELD, shield); - tempPlayer->setSprite(SPRITE_HAT, hat); // head option top + 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.readInt8(); // character slot } - - msg.readInt8(); // unknown + msg.readInt8(); // unknown } void CharServerHandler::chooseCharacter(Net::Character *const character) @@ -313,7 +312,7 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg) loginData.characterSlots = static_cast<short unsigned int>(slots); const bool version = msg.readInt8() == 1 && serverVersion > 0; - msg.skip(17); // 0 Unused + msg.skip(17); // 0 Unused delete_all(mCharacters); mCharacters.clear(); @@ -340,4 +339,4 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg) Client::setState(STATE_CHAR_SELECT); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 09b3bd518..6610dec26 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -58,7 +58,7 @@ ChatHandler::ChatHandler() : SMSG_WHISPER, SMSG_WHISPER_RESPONSE, SMSG_GM_CHAT, - SMSG_MVP, // MVP + SMSG_MVP, // MVP SMSG_IGNORE_ALL_RESPONSE, 0 }; @@ -287,4 +287,4 @@ void ChatHandler::unIgnoreAll() const outMsg.writeInt8(1); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index ce6fa0e14..c92a83654 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -164,4 +164,4 @@ void GameHandler::disconnect2() const MessageOut outMsg(CMSG_CLIENT_DISCONNECT); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index 1d4d5274f..01a012ee0 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -163,7 +163,6 @@ void GeneralHandler::handleMessage(Net::MessageIn &msg) default: break; - } BLOCK_END("GeneralHandler::handleMessage") } @@ -296,4 +295,4 @@ void GeneralHandler::gameEnded() const Ea::partyTab = nullptr; } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/gui/guildtab.cpp b/src/net/tmwa/gui/guildtab.cpp index c7e155341..08a42eadc 100644 --- a/src/net/tmwa/gui/guildtab.cpp +++ b/src/net/tmwa/gui/guildtab.cpp @@ -47,4 +47,4 @@ GuildTab::~GuildTab() { } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/gui/partytab.cpp b/src/net/tmwa/gui/partytab.cpp index 725cae1d2..348e5cbfb 100644 --- a/src/net/tmwa/gui/partytab.cpp +++ b/src/net/tmwa/gui/partytab.cpp @@ -50,4 +50,4 @@ PartyTab::~PartyTab() { } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index a21ef726f..69d5f0e41 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -196,7 +196,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg) void GuildHandler::create(const std::string &name) const { MessageOut msg(CMSG_GUILD_CREATE); - msg.writeInt32(0); // Unused + msg.writeInt32(0); // unused msg.writeString(name, 24); } @@ -212,8 +212,8 @@ void GuildHandler::invite(const int guildId A_UNUSED, { MessageOut msg(CMSG_GUILD_INVITE); msg.writeInt32(being->getId()); - msg.writeInt32(0); // Unused - msg.writeInt32(0); // Unused + msg.writeInt32(0); // unused + msg.writeInt32(0); // unused } } @@ -225,8 +225,8 @@ void GuildHandler::invite(const int guildId A_UNUSED, MessageOut msg(CMSG_GUILD_INVITE); msg.writeInt32(being->getId()); - msg.writeInt32(0); // Unused - msg.writeInt32(0); // Unused + msg.writeInt32(0); // unused + msg.writeInt32(0); // unused } void GuildHandler::inviteResponse(const int guildId, const bool response) const @@ -234,8 +234,8 @@ void GuildHandler::inviteResponse(const int guildId, const bool response) const MessageOut msg(CMSG_GUILD_INVITE_REPLY); msg.writeInt32(guildId); msg.writeInt8(response); - msg.writeInt8(0); // Unused - msg.writeInt16(0); // Unused + msg.writeInt8(0); // unused + msg.writeInt16(0); // unused } void GuildHandler::leave(const int guildId) const @@ -245,9 +245,9 @@ void GuildHandler::leave(const int guildId) const MessageOut msg(CMSG_GUILD_LEAVE); msg.writeInt32(guildId); - msg.writeInt32(player_node->getId()); // Account ID - msg.writeInt32(PlayerInfo::getCharId()); // Char ID - msg.writeString("", 40); // Message + msg.writeInt32(player_node->getId()); // Account ID + msg.writeInt32(PlayerInfo::getCharId()); // Char ID + msg.writeString("", 40); // Message } void GuildHandler::kick(const GuildMember *const member, @@ -258,9 +258,9 @@ void GuildHandler::kick(const GuildMember *const member, MessageOut msg(CMSG_GUILD_EXPULSION); msg.writeInt32(member->getGuild()->getId()); - msg.writeInt32(member->getID()); // Account ID - msg.writeInt32(member->getCharId()); // Char ID - msg.writeString(reason, 40); // Message + msg.writeInt32(member->getID()); // Account ID + msg.writeInt32(member->getCharId()); // Char ID + msg.writeString(reason, 40); // Message } void GuildHandler::chat(const int guildId A_UNUSED, @@ -286,7 +286,7 @@ void GuildHandler::memberList(const int guildId A_UNUSED) const // 4 = expulsion list MessageOut msg(CMSG_GUILD_REQUEST_INFO); - msg.writeInt32(1); // Request member list + msg.writeInt32(1); // Request member list } void GuildHandler::info(const int guildId A_UNUSED) @@ -300,7 +300,7 @@ void GuildHandler::info(const int guildId A_UNUSED) showBasicInfo = true; MessageOut msg(CMSG_GUILD_REQUEST_INFO); - msg.writeInt32(0); // Request basic info + msg.writeInt32(0); // Request basic info } void GuildHandler::changeMemberPostion(const GuildMember *const member, @@ -310,10 +310,10 @@ void GuildHandler::changeMemberPostion(const GuildMember *const member, return; MessageOut msg(CMSG_GUILD_CHANGE_MEMBER_POS); - msg.writeInt16(16); // size less then 16 <= 4 + 12 - msg.writeInt32(member->getID()); // Account ID - msg.writeInt32(member->getCharId()); // Char ID - msg.writeInt32(level); // pos + msg.writeInt16(16); // size less then 16 <= 4 + 12 + msg.writeInt32(member->getID()); // Account ID + msg.writeInt32(member->getCharId()); // Char ID + msg.writeInt32(level); // pos } void GuildHandler::changeNotice(const int guildId, const std::string &msg1, @@ -321,8 +321,8 @@ void GuildHandler::changeNotice(const int guildId, const std::string &msg1, { MessageOut msg(CMSG_GUILD_CHANGE_NOTICE); msg.writeInt32(guildId); - msg.writeString(msg1, 60); // msg1 - msg.writeString(msg2, 120); // msg2 + msg.writeString(msg1, 60); // msg1 + msg.writeString(msg2, 120); // msg2 } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 59aa6f69a..561f3ec90 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -166,7 +166,7 @@ void InventoryHandler::useItem(const Item *const item) const MessageOut outMsg(CMSG_PLAYER_INVENTORY_USE); outMsg.writeInt16(static_cast<int16_t>( item->getInvIndex() + INVENTORY_OFFSET)); - outMsg.writeInt32(item->getId()); // unused + outMsg.writeInt32(item->getId()); // unused } void InventoryHandler::dropItem(const Item *const item, const int amount) const @@ -204,4 +204,4 @@ void InventoryHandler::moveItem2(const int source, const int slot, } } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/itemhandler.cpp b/src/net/tmwa/itemhandler.cpp index bb537a0c7..5a888d28f 100644 --- a/src/net/tmwa/itemhandler.cpp +++ b/src/net/tmwa/itemhandler.cpp @@ -66,4 +66,4 @@ void ItemHandler::handleMessage(Net::MessageIn &msg) BLOCK_END("ItemHandler::handleMessage") } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index fca7e904c..00e0563e8 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -137,7 +137,7 @@ void LoginHandler::sendLoginRegister(const std::string &username, if (email.empty()) { MessageOut outMsg(CMSG_LOGIN_REGISTER); - outMsg.writeInt32(0); // client version + outMsg.writeInt32(0); // client version outMsg.writeString(username, 24); outMsg.writeStringNoLog(password, 24); @@ -152,7 +152,7 @@ void LoginHandler::sendLoginRegister(const std::string &username, else { MessageOut outMsg(CMSG_LOGIN_REGISTER2); - outMsg.writeInt32(0); // client version + outMsg.writeInt32(0); // client version outMsg.writeString(username, 24); outMsg.writeStringNoLog(password, 24); @@ -181,15 +181,15 @@ void LoginHandler::requestUpdateHosts() const void LoginHandler::processServerVersion(Net::MessageIn &msg) { - const uint8_t b1 = msg.readInt8(); // -1 - const uint8_t b2 = msg.readInt8(); // E - const uint8_t b3 = msg.readInt8(); // V - const uint8_t b4 = msg.readInt8(); // L + const uint8_t b1 = msg.readInt8(); // -1 + const uint8_t b2 = msg.readInt8(); // E + const uint8_t b3 = msg.readInt8(); // V + const uint8_t b4 = msg.readInt8(); // L if (b1 == 255 && b2 == 'E' && b3 == 'V' && b4 == 'L') { const unsigned int options = msg.readInt8(); mRegistrationEnabled = options; - msg.skip(2); // 0 unused + msg.skip(2); // 0 unused serverVersion = msg.readInt8(); if (serverVersion >= 5) requestUpdateHosts(); @@ -240,4 +240,4 @@ int LoginHandler::supportedOptionalActions() const : SetGenderOnRegister; } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/messagehandler.cpp b/src/net/tmwa/messagehandler.cpp index abe57a396..827efdcbd 100644 --- a/src/net/tmwa/messagehandler.cpp +++ b/src/net/tmwa/messagehandler.cpp @@ -48,4 +48,4 @@ void MessageHandler::setNetwork(Network *network) mNetwork = network; } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp index 3414b0091..67cacf504 100644 --- a/src/net/tmwa/messagein.cpp +++ b/src/net/tmwa/messagein.cpp @@ -33,7 +33,7 @@ #include "debug.h" -namespace TmwAthena +namespace TmwAthena { MessageIn::MessageIn(const char *const data, const unsigned int length) : @@ -81,4 +81,4 @@ int32_t MessageIn::readInt32() return value; } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp index d520b407e..b0fff0292 100644 --- a/src/net/tmwa/messageout.cpp +++ b/src/net/tmwa/messageout.cpp @@ -145,4 +145,4 @@ void MessageOut::writeCoordinates(const unsigned short x, PacketCounters::incOutBytes(3); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index be91b5bc9..120cbb158 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -221,4 +221,4 @@ Network *Network::instance() return mInstance; } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 0c55d8d7e..fa9647b9d 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -115,7 +115,7 @@ void NpcHandler::talk(const int npcId) const { MessageOut outMsg(CMSG_NPC_TALK); outMsg.writeInt32(npcId); - outMsg.writeInt8(0); // Unused + outMsg.writeInt8(0); // unused } void NpcHandler::nextDialog(const int npcId) const @@ -161,21 +161,21 @@ void NpcHandler::stringInput(const int npcId, const std::string &value) const outMsg.writeInt16(static_cast<int16_t>(value.length() + 9)); outMsg.writeInt32(npcId); outMsg.writeString(value, static_cast<int>(value.length())); - outMsg.writeInt8(0); // Prevent problems with string reading + outMsg.writeInt8(0); // Prevent problems with string reading } void NpcHandler::buy(const int beingId) const { MessageOut outMsg(CMSG_NPC_BUY_SELL_REQUEST); outMsg.writeInt32(beingId); - outMsg.writeInt8(0); // Buy + outMsg.writeInt8(0); // Buy } void NpcHandler::sell(const int beingId) const { MessageOut outMsg(CMSG_NPC_BUY_SELL_REQUEST); outMsg.writeInt32(beingId); - outMsg.writeInt8(1); // Sell + outMsg.writeInt8(1); // Sell } void NpcHandler::buyItem(const int beingId A_UNUSED, const int itemId, @@ -184,7 +184,7 @@ void NpcHandler::buyItem(const int beingId A_UNUSED, const int itemId, MessageOut outMsg(CMSG_NPC_BUY_REQUEST); if (serverVersion > 0) { - outMsg.writeInt16(10); // One item (length of packet) + outMsg.writeInt16(10); // One item (length of packet) outMsg.writeInt16(static_cast<int16_t>(amount)); outMsg.writeInt16(static_cast<int16_t>(itemId)); outMsg.writeInt8(color); @@ -192,7 +192,7 @@ void NpcHandler::buyItem(const int beingId A_UNUSED, const int itemId, } else { - outMsg.writeInt16(8); // One item (length of packet) + outMsg.writeInt16(8); // One item (length of packet) outMsg.writeInt16(static_cast<int16_t>(amount)); outMsg.writeInt16(static_cast<int16_t>(itemId)); } @@ -202,7 +202,7 @@ void NpcHandler::sellItem(const int beingId A_UNUSED, const int itemId, const int amount) const { MessageOut outMsg(CMSG_NPC_SELL_REQUEST); - outMsg.writeInt16(8); // One item (length of packet) + outMsg.writeInt16(8); // One item (length of packet) outMsg.writeInt16(static_cast<int16_t>(itemId + INVENTORY_OFFSET)); outMsg.writeInt16(static_cast<int16_t>(amount)); } @@ -288,35 +288,35 @@ void NpcHandler::processNpcCommand(Net::MessageIn &msg, const int npcId) case 4: if (viewport) { - msg.readInt32(); // id + msg.readInt32(); // id const int x = msg.readInt16(); const int y = msg.readInt16(); viewport->moveCameraRelative(x, y); } break; - case 5: // close dialog + case 5: // close dialog closeDialog(npcId); break; - case 6: // show avatar + case 6: // show avatar if (mDialog) { mDialog->showAvatar(static_cast<uint16_t>( - msg.readInt32())); // avatar id + msg.readInt32())); // avatar id } break; - case 7: // set avatar direction + case 7: // set avatar direction if (mDialog) { mDialog->setAvatarDirection( Net::MessageIn::fromServerDirection( - static_cast<uint8_t>(msg.readInt32()))); // direction + static_cast<uint8_t>(msg.readInt32()))); // direction } break; - case 8: // set avatar action + case 8: // set avatar action if (mDialog) - mDialog->setAvatarAction(msg.readInt32()); // direction + mDialog->setAvatarAction(msg.readInt32()); // direction break; - case 9: // clear npc dialog + case 9: // clear npc dialog if (mDialog) mDialog->clearRows(); break; @@ -334,4 +334,4 @@ void NpcHandler::processLangReuqest(Net::MessageIn &msg A_UNUSED, stringInput(npcId, getLangSimple()); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index f86e030d1..39a580ebf 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -155,7 +155,7 @@ void PartyHandler::kick(Being *const being) const { MessageOut outMsg(CMSG_PARTY_KICK); outMsg.writeInt32(being->getId()); - outMsg.writeString("", 24); //Unused + outMsg.writeString("", 24); // unused } } @@ -173,7 +173,7 @@ void PartyHandler::kick(const std::string &name) const MessageOut outMsg(CMSG_PARTY_KICK); outMsg.writeInt32(m->getID()); - outMsg.writeString(name, 24); //Unused + outMsg.writeString(name, 24); // unused } void PartyHandler::chat(const std::string &text) const @@ -203,4 +203,4 @@ void PartyHandler::setShareItems(const PartyShare share) const outMsg.writeInt16(static_cast<int16_t>(share)); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 17ba07af1..dd05e1b03 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -81,11 +81,11 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) processPlayerStatUpdate2(msg); break; - case SMSG_PLAYER_STAT_UPDATE_3: // Update a base attribute + case SMSG_PLAYER_STAT_UPDATE_3: // Update a base attribute processPlayerStatUpdate3(msg); break; - case SMSG_PLAYER_STAT_UPDATE_4: // Attribute increase ack + case SMSG_PLAYER_STAT_UPDATE_4: // Attribute increase ack processPlayerStatUpdate4(msg); break; @@ -287,4 +287,4 @@ void PlayerHandler::updateStatus(const uint8_t status) const outMsg.writeInt8(0); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/questhandler.cpp b/src/net/tmwa/questhandler.cpp index 9789c2eb4..bb36ad820 100644 --- a/src/net/tmwa/questhandler.cpp +++ b/src/net/tmwa/questhandler.cpp @@ -33,8 +33,6 @@ #include "debug.h" -//extern Net::QuestHandler *questHandler; - namespace TmwAthena { @@ -48,7 +46,6 @@ QuestHandler::QuestHandler() : 0 }; handledMessages = _messages; -// questHandler = this; } void QuestHandler::handleMessage(Net::MessageIn &msg) @@ -102,4 +99,4 @@ void QuestHandler::processPlayerQuests(Net::MessageIn &msg A_UNUSED) const questsWindow->rebuild(false); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/skillhandler.cpp b/src/net/tmwa/skillhandler.cpp index 9dd6af1fe..75edaf63b 100644 --- a/src/net/tmwa/skillhandler.cpp +++ b/src/net/tmwa/skillhandler.cpp @@ -71,7 +71,8 @@ void SkillHandler::handleMessage(Net::MessageIn &msg) BLOCK_END("SkillHandler::handleMessage") } -void SkillHandler::useBeing(const int id, const int level, const int beingId) const +void SkillHandler::useBeing(const int id, const int level, + const int beingId) const { MessageOut outMsg(CMSG_SKILL_USE_BEING); outMsg.writeInt16(static_cast<int16_t>(id)); @@ -96,4 +97,4 @@ void SkillHandler::useMap(const int id, const std::string &map) const outMsg.writeString(map, 16); } -} // namespace TmwAthena +} // namespace TmwAthena diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 4f413fdaf..33c08382e 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -146,4 +146,4 @@ void TradeHandler::cancel() const MessageOut outMsg(CMSG_TRADE_CANCEL_REQUEST); } -} // namespace TmwAthena +} // namespace TmwAthena |