summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-12 18:39:00 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-12 18:39:00 +0300
commit351821c1f18f9285be58df0a05339936311f6490 (patch)
tree47a60cad4f61f63c5ac2faf98dcae24760d7fe11 /src/net/ea
parente50632a83a3c679cffd372656277a304d5d853f8 (diff)
downloadmanaplus-351821c1f18f9285be58df0a05339936311f6490.tar.gz
manaplus-351821c1f18f9285be58df0a05339936311f6490.tar.bz2
manaplus-351821c1f18f9285be58df0a05339936311f6490.tar.xz
manaplus-351821c1f18f9285be58df0a05339936311f6490.zip
first part of style fixed after cpplint checks.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/adminhandler.cpp2
-rw-r--r--src/net/ea/beinghandler.cpp58
-rw-r--r--src/net/ea/buysellhandler.cpp2
-rw-r--r--src/net/ea/charserverhandler.cpp2
-rw-r--r--src/net/ea/chathandler.cpp6
-rw-r--r--src/net/ea/gamehandler.cpp2
-rw-r--r--src/net/ea/gui/guildtab.cpp2
-rw-r--r--src/net/ea/gui/partytab.cpp2
-rw-r--r--src/net/ea/guildhandler.cpp162
-rw-r--r--src/net/ea/inventoryhandler.cpp27
-rw-r--r--src/net/ea/itemhandler.cpp2
-rw-r--r--src/net/ea/loginhandler.cpp6
-rw-r--r--src/net/ea/network.cpp4
-rw-r--r--src/net/ea/npchandler.cpp2
-rw-r--r--src/net/ea/partyhandler.cpp24
-rw-r--r--src/net/ea/playerhandler.cpp9
-rw-r--r--src/net/ea/skillhandler.cpp10
-rw-r--r--src/net/ea/tradehandler.cpp16
18 files changed, 161 insertions, 177 deletions
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp
index 79eff8e68..0d2245330 100644
--- a/src/net/ea/adminhandler.cpp
+++ b/src/net/ea/adminhandler.cpp
@@ -70,4 +70,4 @@ void AdminHandler::warp(const std::string &map, const int x, const int y) const
"@warp %s %d %d", map.c_str(), x, y), GENERAL_CHANNEL);
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 2f982a425..6f9cef522 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -201,13 +201,13 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
const uint16_t headBottom = msg.readInt16();
if (!visible)
- msg.readInt32(); // server tick
+ msg.readInt32(); // server tick
const uint16_t shield = msg.readInt16();
const uint16_t headTop = msg.readInt16();
const uint16_t headMid = msg.readInt16();
const int hairColor = msg.readInt16();
- const uint16_t shoes = msg.readInt16(); //clothes color - "abused" as shoes
+ const uint16_t shoes = msg.readInt16(); // clothes color
uint16_t gloves;
if (dstBeing->getType() == ActorSprite::MONSTER)
@@ -444,29 +444,20 @@ void BeingHandler::processSkillDamage(Net::MessageIn &msg) const
if (!actorSpriteManager)
return;
- const int id = msg.readInt16(); // Skill Id
+ const int id = msg.readInt16(); // Skill Id
Being *const srcBeing = actorSpriteManager->findBeing(msg.readInt32());
Being *const dstBeing = actorSpriteManager->findBeing(msg.readInt32());
- msg.readInt32(); // Server tick
- msg.readInt32(); // src speed
- msg.readInt32(); // dst speed
- const int param1 = msg.readInt32(); // Damage
- const int level = msg.readInt16(); // Skill level
- msg.readInt16(); // Div
- msg.readInt8(); // Skill hit/type (?)
+ msg.readInt32(); // Server tick
+ msg.readInt32(); // src speed
+ msg.readInt32(); // dst speed
+ const int param1 = msg.readInt32(); // Damage
+ const int level = msg.readInt16(); // Skill level
+ msg.readInt16(); // Div
+ msg.readInt8(); // Skill hit/type (?)
if (dstBeing)
- {
-// if (dstSpeed)
-// dstBeing->setAttackDelay(dstSpeed);
dstBeing->takeDamage(srcBeing, param1, Being::SKILL, id);
- }
if (srcBeing)
- {
-// if (srcSpeed)
-// srcBeing->setAttackDelay(srcSpeed);
-// srcBeing->handleAttack(dstBeing, param1, Being::HIT);
srcBeing->handleSkill(dstBeing, param1, id, level);
- }
}
void BeingHandler::processBeingAction(Net::MessageIn &msg) const
@@ -487,15 +478,13 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
switch (type)
{
- case Being::HIT: // Damage
- case Being::CRITICAL: // Critical Damage
- case Being::MULTI: // Critical Damage
- case Being::REFLECT: // Reflected Damage
- case Being::FLEE: // Lucky Dodge
+ case Being::HIT: // Damage
+ case Being::CRITICAL: // Critical Damage
+ case Being::MULTI: // Critical Damage
+ case Being::REFLECT: // Reflected Damage
+ case Being::FLEE: // Lucky Dodge
if (dstBeing)
{
-// if (dstSpeed)
-// dstBeing->setAttackDelay(dstSpeed);
dstBeing->takeDamage(srcBeing, param1,
static_cast<Being::AttackType>(type));
}
@@ -510,13 +499,13 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
}
break;
- case 0x01: // dead
+ case 0x01: // dead
break;
// tmw server can send here garbage?
// if (srcBeing)
// srcBeing->setAction(Being::DEAD);
- case 0x02: // Sit
+ case 0x02: // Sit
if (srcBeing)
{
srcBeing->setAction(Being::SIT);
@@ -529,7 +518,7 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
}
break;
- case 0x03: // Stand up
+ case 0x03: // Stand up
if (srcBeing)
{
srcBeing->setAction(Being::STAND);
@@ -570,7 +559,7 @@ void BeingHandler::processBeingSelfEffect(Net::MessageIn &msg) const
//+++ need dehard code effectType == 3
if (effectType == 3 && being->getType() == Being::PLAYER
&& socialWindow)
- { //reset received damage
+ { // reset received damage
socialWindow->resetDamage(being->getName());
}
}
@@ -667,7 +656,7 @@ void BeingHandler::processPlayerGuilPartyInfo(Net::MessageIn &msg) const
msg.skip(48);
}
dstBeing->addToCache();
- msg.readString(24); // Discard this
+ msg.readString(24); // Discard this
}
}
@@ -681,7 +670,7 @@ void BeingHandler::processBeingChangeDirection(Net::MessageIn &msg) const
if (!dstBeing)
return;
- msg.readInt16(); // unused
+ msg.readInt16(); // unused
const unsigned char dir = msg.readInt8() & 0x0f;
dstBeing->setDirection(dir);
@@ -741,7 +730,6 @@ void BeingHandler::processPlaterStatusChange(Net::MessageIn &msg) const
return;
// Change in players' flags
-
const int id = msg.readInt32();
Being *const dstBeing = actorSpriteManager->findBeing(id);
if (!dstBeing)
@@ -750,7 +738,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.readInt8(); // Unused?
dstBeing->setStunMode(stunMode);
dstBeing->setStatusEffectBlock(0, static_cast<uint16_t>(
@@ -767,7 +755,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 int flag = msg.readInt8(); // 0: stop, 1: start
Being *const dstBeing = actorSpriteManager->findBeing(id);
if (dstBeing)
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp
index a0d7d03dd..6a68355dd 100644
--- a/src/net/ea/buysellhandler.cpp
+++ b/src/net/ea/buysellhandler.cpp
@@ -179,4 +179,4 @@ void BuySellHandler::processNpcBuyResponse(Net::MessageIn &msg) const
}
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp
index 3d665af22..354326e08 100644
--- a/src/net/ea/charserverhandler.cpp
+++ b/src/net/ea/charserverhandler.cpp
@@ -253,4 +253,4 @@ void CharServerHandler::processChangeMapServer(Net::MessageIn &msg,
}
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index 20c108229..872878511 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -131,7 +131,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) const
if (player_relations.hasPermission(nick, PlayerRelation::TRADE))
{
if (shopWindow)
- { //commands to shop from player
+ { // commands to shop from player
if (chatMsg.find("!selllist ") == 0)
{
if (tradeBot)
@@ -336,7 +336,7 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat,
void ChatHandler::processMVP(Net::MessageIn &msg) const
{
// Display MVP player
- const int id = msg.readInt32(); // id
+ const int id = msg.readInt32(); // id
if (localChatTab && actorSpriteManager && config.getBoolValue("showMVP"))
{
const Being *const being = actorSpriteManager->findBeing(id);
@@ -390,4 +390,4 @@ void ChatHandler::processIgnoreAllResponse(Net::MessageIn &msg) const
}
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp
index 4a011c6a8..0e159bd76 100644
--- a/src/net/ea/gamehandler.cpp
+++ b/src/net/ea/gamehandler.cpp
@@ -92,4 +92,4 @@ void GameHandler::initEngines() const
Game::instance()->changeMap(mMap);
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/gui/guildtab.cpp b/src/net/ea/gui/guildtab.cpp
index 26f984a9a..0a1fb7314 100644
--- a/src/net/ea/gui/guildtab.cpp
+++ b/src/net/ea/gui/guildtab.cpp
@@ -165,4 +165,4 @@ void GuildTab::optionChanged(const std::string &value)
mShowOnline = config.getBoolValue("showGuildOnline");
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp
index fc59136e1..b8dd6aece 100644
--- a/src/net/ea/gui/partytab.cpp
+++ b/src/net/ea/gui/partytab.cpp
@@ -249,4 +249,4 @@ void PartyTab::playNewMessageSound()
{
soundManager.playGuiSound(SOUND_GUILD);
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp
index 2d3861956..19f892ed5 100644
--- a/src/net/ea/guildhandler.cpp
+++ b/src/net/ea/guildhandler.cpp
@@ -100,8 +100,8 @@ void GuildHandler::processGuildPositionInfo(Net::MessageIn &msg) const
const int guildId = msg.readInt32();
const int emblem = msg.readInt32();
const int posMode = msg.readInt32();
- msg.readInt32(); // Unused
- msg.readInt8(); // Unused
+ msg.readInt32(); // Unused
+ msg.readInt8(); // Unused
std::string guildName = msg.readString(24);
Guild *const g = Guild::getGuild(static_cast<short int>(guildId));
@@ -134,9 +134,9 @@ void GuildHandler::processGuildPositionInfo(Net::MessageIn &msg) const
void GuildHandler::processGuildMemberLogin(Net::MessageIn &msg) const
{
- const int accountId = msg.readInt32(); // Account ID
- const int charId = msg.readInt32(); // Char ID
- const int online = msg.readInt32(); // Flag
+ const int accountId = msg.readInt32(); // Account ID
+ const int charId = msg.readInt32(); // Char ID
+ const int online = msg.readInt32(); // Flag
if (taGuild)
{
GuildMember *const m = taGuild->getMember(accountId, charId);
@@ -151,20 +151,20 @@ void GuildHandler::processGuildMemberLogin(Net::MessageIn &msg) const
void GuildHandler::processGuildMasterOrMember(Net::MessageIn &msg) const
{
- msg.readInt32(); // Type (0x57 for member, 0xd7 for master)
+ msg.readInt32(); // Type (0x57 for member, 0xd7 for master)
}
void GuildHandler::processGuildBasicInfo(Net::MessageIn &msg)
{
- const int guildId = msg.readInt32(); // Guild ID
- const int level = msg.readInt32(); // Guild level
- const int members = msg.readInt32(); // 'Connect member'
- const int maxMembers = msg.readInt32(); // 'Max member'
- const int avgLevel = msg.readInt32(); // Average level
- const int exp = msg.readInt32(); // Exp
- const int nextExp = msg.readInt32(); // Next exp
- msg.skip(16); // 0 unused
- std::string name = msg.readString(24); // Name
+ const int guildId = msg.readInt32(); // Guild ID
+ const int level = msg.readInt32(); // Guild level
+ const int members = msg.readInt32(); // 'Connect member'
+ const int maxMembers = msg.readInt32(); // 'Max member'
+ const int avgLevel = msg.readInt32(); // Average level
+ const int exp = msg.readInt32(); // Exp
+ const int nextExp = msg.readInt32(); // Next exp
+ 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
// (ie: "Six Castles" or "None Taken")
@@ -205,9 +205,9 @@ void GuildHandler::processGuildAlianceInfo(Net::MessageIn &msg) const
for (int i = 0; i < count; i++)
{
- msg.readInt32(); // 'Opposition'
- msg.readInt32(); // Other guild ID
- msg.readString(24); // Other guild name
+ msg.readInt32(); // 'Opposition'
+ msg.readInt32(); // Other guild ID
+ msg.readString(24); // Other guild name
}
}
@@ -227,18 +227,18 @@ void GuildHandler::processGuildMemberList(Net::MessageIn &msg) const
for (int i = 0; i < count; i++)
{
- const int id = msg.readInt32(); // Account ID
- const int charId = msg.readInt32(); // Char ID
- msg.readInt16(); // Hair
- msg.readInt16(); // Hair color
- const int gender = msg.readInt16(); // Gender
- const int race = msg.readInt16(); // Class
- const int level = msg.readInt16(); // Level
- const int exp = msg.readInt32(); // Exp
- const int online = msg.readInt32(); // Online
- const int pos = msg.readInt32(); // Position
- msg.skip(50); // 0 unused
- std::string name = msg.readString(24); // Name
+ const int id = msg.readInt32(); // Account ID
+ const int charId = msg.readInt32(); // Char ID
+ msg.readInt16(); // Hair
+ msg.readInt16(); // Hair color
+ const int gender = msg.readInt16(); // Gender
+ const int race = msg.readInt16(); // Class
+ const int level = msg.readInt16(); // Level
+ const int exp = msg.readInt32(); // Exp
+ const int online = msg.readInt32(); // Online
+ const int pos = msg.readInt32(); // Position
+ msg.skip(50); // 0 unused
+ std::string name = msg.readString(24); // Name
GuildMember *const m = taGuild->addMember(id, charId, name);
if (m)
@@ -290,8 +290,8 @@ void GuildHandler::processGuildPosNameList(Net::MessageIn &msg) const
for (int i = 0; i < count; i++)
{
- const int id = msg.readInt32(); // ID
- const std::string name = msg.readString(24); // Position name
+ const int id = msg.readInt32(); // ID
+ const std::string name = msg.readString(24); // Position name
taGuild->addPos(id, name);
}
}
@@ -305,29 +305,29 @@ void GuildHandler::processGuildPosInfoList(Net::MessageIn &msg) const
for (int i = 0; i < count; i++)
{
- msg.readInt32(); // ID
- msg.readInt32(); // Mode
- msg.readInt32(); // Same ID
- msg.readInt32(); // Exp mode
+ msg.readInt32(); // ID
+ msg.readInt32(); // Mode
+ msg.readInt32(); // Same ID
+ msg.readInt32(); // Exp mode
}
}
void GuildHandler::processGuildPositionChanged(Net::MessageIn &msg) const
{
- msg.readInt16(); // Always 44
- msg.readInt32(); // ID
- msg.readInt32(); // Mode
- msg.readInt32(); // Same ID
- msg.readInt32(); // Exp mode
- msg.readString(24); // Name
+ msg.readInt16(); // Always 44
+ msg.readInt32(); // ID
+ msg.readInt32(); // Mode
+ msg.readInt32(); // Same ID
+ msg.readInt32(); // Exp mode
+ msg.readString(24); // Name
}
void GuildHandler::processGuildMemberPosChange(Net::MessageIn &msg) const
{
- msg.readInt16(); // Always 16
- const int accountId = msg.readInt32(); // Account ID
- const int charId = msg.readInt32(); // Char ID
- const int pos = msg.readInt32(); // Position
+ msg.readInt16(); // Always 16
+ const int accountId = msg.readInt32(); // Account ID
+ const int charId = msg.readInt32(); // Char ID
+ const int pos = msg.readInt32(); // Position
if (taGuild)
{
GuildMember *const m = taGuild->getMember(accountId, charId);
@@ -340,11 +340,11 @@ void GuildHandler::processGuildEmblem(Net::MessageIn &msg) const
{
const int length = msg.readInt16();
- msg.readInt32(); // Guild ID
- msg.readInt32(); // Emblem ID
+ msg.readInt32(); // Guild ID
+ msg.readInt32(); // Emblem ID
if (length < 12)
return;
- msg.skip(length - 12); // Emblem data (unknown format)
+ msg.skip(length - 12); // Emblem data (unknown format)
}
void GuildHandler::processGuildSkillInfo(Net::MessageIn &msg) const
@@ -352,27 +352,27 @@ void GuildHandler::processGuildSkillInfo(Net::MessageIn &msg) const
const int length = msg.readInt16();
const int count = (length - 6) / 37;
- msg.readInt16(); // 'Skill point'
+ msg.readInt16(); // 'Skill point'
if (length < 6)
return;
for (int i = 0; i < count; i++)
{
- msg.readInt16(); // ID
- msg.readInt16(); // 'Info' (unknown atm)
- msg.readInt16(); // 0 unused
- msg.readInt16(); // Level
- msg.readInt16(); // SP
- msg.readInt16(); // 'Range'
- msg.skip(24); // 0 unused
- msg.readInt8(); // Can be increased
+ msg.readInt16(); // ID
+ msg.readInt16(); // 'Info' (unknown atm)
+ msg.readInt16(); // 0 unused
+ msg.readInt16(); // Level
+ msg.readInt16(); // SP
+ msg.readInt16(); // 'Range'
+ msg.skip(24); // 0 unused
+ msg.readInt8(); // Can be increased
}
}
void GuildHandler::processGuildNotice(Net::MessageIn &msg) const
{
- const std::string msg1 = msg.readString(60); // Mes1
- const std::string msg2 = msg.readString(120); // Mes2
+ const std::string msg1 = msg.readString(60); // Mes1
+ const std::string msg2 = msg.readString(120); // Mes2
if (guildTab)
{
guildTab->chatLog(msg1, BY_SERVER);
@@ -421,8 +421,8 @@ void GuildHandler::processGuildInviteAck(Net::MessageIn &msg) const
void GuildHandler::processGuildLeave(Net::MessageIn &msg) const
{
- const std::string nick = msg.readString(24); // Name
- msg.readString(40); // Message
+ const std::string nick = msg.readString(24); // Name
+ msg.readString(40); // Message
if (taGuild)
taGuild->removeMember(nick);
@@ -465,9 +465,9 @@ void GuildHandler::processGuildLeave(Net::MessageIn &msg) const
void GuildHandler::processGuildExpulsion(Net::MessageIn &msg) const
{
msg.skip(2); // size (can be many explusions in list)
- const std::string nick = msg.readString(24); // Name (of expulsed?)
- msg.skip(24); // acc
- msg.readString(44); // Message
+ const std::string nick = msg.readString(24); // Name (of expulsed?)
+ msg.skip(24); // acc
+ msg.readString(44); // Message
if (taGuild)
taGuild->removeMember(nick);
@@ -516,9 +516,9 @@ void GuildHandler::processGuildExpulsionList(Net::MessageIn &msg) const
for (int i = 0; i < count; i++)
{
- msg.readString(24); // Name (of expulsed?)
- msg.readString(24); // 'Acc' (name of expulser?)
- msg.readString(24); // Message
+ msg.readString(24); // Name (of expulsed?)
+ msg.readString(24); // 'Acc' (name of expulser?)
+ msg.readString(24); // Message
}
}
@@ -548,38 +548,38 @@ void GuildHandler::processGuildMessage(Net::MessageIn &msg) const
void GuildHandler::processGuildSkillUp(Net::MessageIn &msg) const
{
- msg.readInt16(); // Skill ID
- msg.readInt16(); // Level
- msg.readInt16(); // SP
- msg.readInt16(); // 'Range'
- msg.readInt8(); // unused? (always 1)
+ msg.readInt16(); // Skill ID
+ msg.readInt16(); // Level
+ msg.readInt16(); // SP
+ msg.readInt16(); // 'Range'
+ msg.readInt8(); // unused? (always 1)
}
void GuildHandler::processGuildReqAlliance(Net::MessageIn &msg) const
{
- msg.readInt32(); // Account ID
- msg.readString(24); // Name
+ msg.readInt32(); // Account ID
+ msg.readString(24); // Name
}
void GuildHandler::processGuildReqAllianceAck(Net::MessageIn &msg) const
{
- msg.readInt32(); // Flag
+ msg.readInt32(); // Flag
}
void GuildHandler::processGuildDelAlliance(Net::MessageIn &msg) const
{
- msg.readInt32(); // Guild ID
- msg.readInt32(); // Flag
+ msg.readInt32(); // Guild ID
+ msg.readInt32(); // Flag
}
void GuildHandler::processGuildOppositionAck(Net::MessageIn &msg) const
{
- msg.readInt8(); // Flag
+ msg.readInt8(); // Flag
}
void GuildHandler::processGuildBroken(Net::MessageIn &msg) const
{
- msg.readInt32(); // Flag
+ msg.readInt32(); // Flag
}
void GuildHandler::clear() const
@@ -592,4 +592,4 @@ ChatTab *GuildHandler::getTab() const
return guildTab;
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 6f5da6106..21087d355 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -121,11 +121,11 @@ size_t InventoryHandler::getSize(const int type) const
case Inventory::INVENTORY:
return 100;
case Inventory::STORAGE:
- return 0; // Comes from server after items
+ return 0; // Comes from server after items
case Inventory::TRADE:
return 12;
case GUILD_STORAGE:
- return 0; // Comes from server after items
+ return 0; // Comes from server after items
default:
return 0;
}
@@ -279,9 +279,9 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
msg.readInt8(); // attribute
const int refine = msg.readInt8();
for (int i = 0; i < 4; i++)
- msg.readInt16(); // cards[i]
+ msg.readInt16(); // cards[i]
const int equipType = msg.readInt16();
- msg.readInt8(); // itemType
+ msg.readInt8(); // itemType
const ItemInfo &itemInfo = ItemDB::get(itemId);
const unsigned char err = msg.readInt8();
@@ -351,7 +351,7 @@ void InventoryHandler::processPlayerInventoryUse(Net::MessageIn &msg) const
? PlayerInfo::getInventory() : nullptr;
const int index = msg.readInt16() - INVENTORY_OFFSET;
- msg.readInt16(); // item id
+ msg.readInt16(); // item id
msg.readInt32(); // id
const int amount = msg.readInt16();
msg.readInt8(); // type
@@ -402,8 +402,8 @@ void InventoryHandler::processPlayerStorageStatus(Net::MessageIn &msg)
* server. It always comes after the two SMSG_PLAYER_STORAGE_...
* packets that update storage contents.
*/
- msg.readInt16(); // Used count
- const int size = msg.readInt16(); // Max size
+ msg.readInt16(); // Used count
+ const int size = msg.readInt16(); // Max size
if (!mStorage)
mStorage = new Inventory(Inventory::STORAGE, size);
@@ -429,7 +429,7 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
msg.readInt8(); // attribute
const int refine = msg.readInt8();
for (int i = 0; i < 4; i++)
- msg.readInt16(); // card i
+ msg.readInt16(); // card i
if (Item *const item = mStorage->getItem(index))
{
@@ -483,7 +483,7 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
Inventory *const inventory = player_node
? PlayerInfo::getInventory() : nullptr;
- msg.readInt16(); // length
+ msg.readInt16(); // length
Equipment *const equipment = PlayerInfo::getEquipment();
if (equipment && !equipment->getBackend())
{ // look like SMSG_PLAYER_INVENTORY was not received
@@ -499,11 +499,11 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
const int itemType = msg.readInt8(); // type
unsigned char identified = msg.readInt8(); // identify flag
- msg.readInt16(); // equip type
+ msg.readInt16(); // equip type
const int equipType = msg.readInt16();
msg.readInt8(); // attribute
const int refine = msg.readInt8();
- msg.skip(8); // card
+ msg.skip(8); // card
if (mDebugInventory)
{
@@ -522,7 +522,6 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
if (equipType)
mEquips.setEquipment(getSlot(equipType), index);
-
}
}
@@ -540,7 +539,7 @@ void InventoryHandler::processPlayerEquip(Net::MessageIn &msg)
void InventoryHandler::processPlayerUnEquip(Net::MessageIn &msg)
{
- msg.readInt16(); // inder val - INVENTORY_OFFSET;
+ msg.readInt16(); // inder val - INVENTORY_OFFSET;
const int equipType = msg.readInt16();
const int flag = msg.readInt8();
@@ -573,4 +572,4 @@ void InventoryHandler::processPlayerArrowEquip(Net::MessageIn &msg)
miniStatusWindow->updateArrows();
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/itemhandler.cpp b/src/net/ea/itemhandler.cpp
index 3e7cfc747..6c7124e30 100644
--- a/src/net/ea/itemhandler.cpp
+++ b/src/net/ea/itemhandler.cpp
@@ -81,4 +81,4 @@ void ItemHandler::processItemRemove(Net::MessageIn &msg)
}
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index 33c9ec45f..f94771eec 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -63,7 +63,6 @@ void LoginHandler::getRegistrationDetails() const
void LoginHandler::loginAccount(LoginData *const loginData) const
{
-
if (loginData)
{
// Since we're attempting to use the tAthena protocol,
@@ -277,19 +276,16 @@ void LoginHandler::processLoginError(Net::MessageIn &msg) const
void LoginHandler::logout() const
{
- // TODO
}
void LoginHandler::changeEmail(const std::string &email A_UNUSED) const
{
- // TODO
}
void LoginHandler::unregisterAccount(const std::string &username A_UNUSED,
const std::string &password
A_UNUSED) const
{
- // TODO
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp
index c7441d579..112e16891 100644
--- a/src/net/ea/network.cpp
+++ b/src/net/ea/network.cpp
@@ -318,7 +318,7 @@ void Network::setError(const std::string &error)
uint16_t Network::readWord(const int pos) const
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- return SDL_Swap16((*(uint16_t*)(mInBuffer + (pos))));
+ return SDL_Swap16(*reinterpret_cast<uint16_t*>(mInBuffer + (pos)));
#else
return (*reinterpret_cast<uint16_t*>(mInBuffer + (pos)));
#endif
@@ -335,4 +335,4 @@ void Network::fixSendBuffer()
}
}
-} // namespace EAthena
+} // namespace Ea
diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp
index 9f8e5b87f..cacb65548 100644
--- a/src/net/ea/npchandler.cpp
+++ b/src/net/ea/npchandler.cpp
@@ -112,4 +112,4 @@ void NpcHandler::processNpcStrInput(Net::MessageIn &msg A_UNUSED)
mDialog->textRequest("");
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index 642688ddb..0c00588ce 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -276,19 +276,19 @@ void PartyHandler::processPartyMove(Net::MessageIn &msg) const
m->setX(msg.readInt16()); // x
m->setY(msg.readInt16()); // y
m->setOnline(msg.readInt8()); // online (if 0)
- msg.readString(24); // party
- msg.readString(24); // nick
+ msg.readString(24); // party
+ msg.readString(24); // nick
m->setMap(msg.readString(16)); // map
}
else
{
- msg.skip(4); // 0
- msg.readInt16(); // x
- msg.readInt16(); // y
- msg.readInt8(); // online (if 0)
- msg.readString(24); // party
- msg.readString(24); // nick
- msg.readString(16); // map
+ msg.skip(4); // 0
+ msg.readInt16(); // x
+ msg.readInt16(); // y
+ msg.readInt8(); // online (if 0)
+ msg.readString(24); // party
+ msg.readString(24); // nick
+ msg.readString(16); // map
}
}
@@ -353,11 +353,11 @@ void PartyHandler::processPartyUpdateHp(Net::MessageIn &msg) const
if (Being *const b = actorSpriteManager->findBeing(id))
b->setParty(Ea::taParty);
}
-}
+}
void PartyHandler::processPartyUpdateCoords(Net::MessageIn &msg) const
{
- const int id = msg.readInt32(); // id
+ const int id = msg.readInt32(); // id
PartyMember *m = nullptr;
if (Ea::taParty)
m = Ea::taParty->getMember(id);
@@ -402,4 +402,4 @@ ChatTab *PartyHandler::getTab()
return partyTab;
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 72de30304..1073d5075 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -86,7 +86,7 @@ namespace
}
} deathListener;
-} // anonymous namespace
+} // anonymous namespace
static const char *randomDeathMessage()
{
@@ -177,7 +177,7 @@ void PlayerHandler::processWalkResponse(Net::MessageIn &msg) const
* otherwise.
*/
uint16_t srcX, srcY, dstX, dstY;
- msg.readInt32(); //tick
+ msg.readInt32(); // tick
msg.readCoordinatePair(srcX, srcY, dstX, dstY);
if (player_node)
player_node->setRealPos(dstX, dstY);
@@ -271,7 +271,8 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) const
PlayerInfo::setStatBase(PlayerInfo::WALK_SPEED, value);
PlayerInfo::setStatMod(PlayerInfo::WALK_SPEED, 0);
break;
- case 0x0004: break; // manner
+ case 0x0004:
+ break; // manner
case 0x0005:
PlayerInfo::setAttribute(PlayerInfo::HP, value);
if (player_node->isInParty() && Party::getParty(1))
@@ -644,4 +645,4 @@ int PlayerHandler::getAttackLocation() const
return EA_ATK;
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp
index 1e517a729..0a3054527 100644
--- a/src/net/ea/skillhandler.cpp
+++ b/src/net/ea/skillhandler.cpp
@@ -83,9 +83,9 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg) const
msg.readInt16(); // target type
msg.skip(2); // skill pool flags
const int level = msg.readInt16();
- msg.readInt16(); // sp
+ msg.readInt16(); // sp
const int range = msg.readInt16();
- msg.skip(24); // 0 unused
+ msg.skip(24); // 0 unused
const int up = msg.readInt8();
const int oldLevel = PlayerInfo::getSkillLevel(skillId);
if (oldLevel && oldLevel != level)
@@ -105,7 +105,7 @@ void SkillHandler::processPlayerSkillUp(Net::MessageIn &msg) const
{
const int skillId = msg.readInt16();
const int level = msg.readInt16();
- msg.readInt16(); // sp
+ msg.readInt16(); // sp
const int range = msg.readInt16();
const int up = msg.readInt8();
@@ -125,7 +125,7 @@ void SkillHandler::processSkillFailed(Net::MessageIn &msg) const
// right level)
const int skillId = msg.readInt16();
const short bskill = msg.readInt16();
- msg.readInt16(); // btype
+ msg.readInt16(); // btype
const signed char success = msg.readInt8();
const signed char reason = msg.readInt8();
if (success != static_cast<int>(SKILL_FAILED)
@@ -234,4 +234,4 @@ void SkillHandler::processSkillFailed(Net::MessageIn &msg) const
NotifyManager::notify(NotifyManager::SKILL_FAIL_MESSAGE, txt);
}
-} // namespace Ea
+} // namespace Ea
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index b4aca1041..1da4271b1 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -57,7 +57,7 @@ namespace
Net::getTradeHandler()->respond(eventId == "yes");
}
} listener;
-}
+} // anonimous
namespace Ea
{
@@ -130,18 +130,18 @@ void TradeHandler::processTradeResponse(Net::MessageIn &msg)
switch (msg.readInt8())
{
- case 0: // Too far away
+ case 0: // Too far away
NotifyManager::notify(NotifyManager::TRADE_FAIL_FAR_AWAY,
tradePartnerName);
break;
- case 1: // Character doesn't exist
+ case 1: // Character doesn't exist
NotifyManager::notify(NotifyManager::TRADE_FAIL_CHAR_NOT_EXISTS,
tradePartnerName);
break;
- case 2: // Invite request check failed...
+ case 2: // Invite request check failed...
NotifyManager::notify(NotifyManager::TRADE_CANCELLED_ERROR);
break;
- case 3: // Trade accepted
+ case 3: // Trade accepted
if (tradeWindow)
{
tradeWindow->reset();
@@ -151,7 +151,7 @@ void TradeHandler::processTradeResponse(Net::MessageIn &msg)
tradeWindow->setVisible(true);
}
break;
- case 4: // Trade cancelled
+ case 4: // Trade cancelled
if (player_relations.hasPermission(tradePartnerName,
PlayerRelation::SPEECH_LOG))
{
@@ -167,7 +167,7 @@ void TradeHandler::processTradeResponse(Net::MessageIn &msg)
}
PlayerInfo::setTrading(false);
break;
- default: // Shouldn't happen as well, but to be sure
+ default: // Shouldn't happen as well, but to be sure
NotifyManager::notify(NotifyManager::TRADE_ERROR_UNKNOWN,
tradePartnerName);
if (tradeWindow)
@@ -284,4 +284,4 @@ void TradeHandler::processTradeComplete(Net::MessageIn &msg A_UNUSED)
PlayerInfo::setTrading(false);
}
-} // namespace Ea
+} // namespace Ea