summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/adminhandler.h4
-rw-r--r--src/net/beinghandler.h4
-rw-r--r--src/net/buysellhandler.h4
-rw-r--r--src/net/charserverhandler.cpp2
-rw-r--r--src/net/charserverhandler.h4
-rw-r--r--src/net/chathandler.h3
-rw-r--r--src/net/download.cpp23
-rw-r--r--src/net/download.h4
-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
-rw-r--r--src/net/eathena/adminhandler.cpp4
-rw-r--r--src/net/eathena/beinghandler.cpp58
-rw-r--r--src/net/eathena/buysellhandler.cpp5
-rw-r--r--src/net/eathena/charserverhandler.cpp20
-rw-r--r--src/net/eathena/chathandler.cpp4
-rw-r--r--src/net/eathena/gamehandler.cpp4
-rw-r--r--src/net/eathena/generalhandler.cpp2
-rw-r--r--src/net/eathena/gui/guildtab.cpp2
-rw-r--r--src/net/eathena/gui/partytab.cpp2
-rw-r--r--src/net/eathena/guildhandler.cpp42
-rw-r--r--src/net/eathena/inventoryhandler.cpp4
-rw-r--r--src/net/eathena/itemhandler.cpp2
-rw-r--r--src/net/eathena/loginhandler.cpp4
-rw-r--r--src/net/eathena/messagehandler.cpp2
-rw-r--r--src/net/eathena/messagein.cpp4
-rw-r--r--src/net/eathena/messageout.cpp2
-rw-r--r--src/net/eathena/network.cpp2
-rw-r--r--src/net/eathena/npchandler.cpp28
-rw-r--r--src/net/eathena/partyhandler.cpp6
-rw-r--r--src/net/eathena/playerhandler.cpp14
-rw-r--r--src/net/eathena/skillhandler.cpp2
-rw-r--r--src/net/eathena/tradehandler.cpp2
-rw-r--r--src/net/gamehandler.h4
-rw-r--r--src/net/generalhandler.h4
-rw-r--r--src/net/guildhandler.h4
-rw-r--r--src/net/inventoryhandler.h4
-rw-r--r--src/net/logindata.h2
-rw-r--r--src/net/loginhandler.h4
-rw-r--r--src/net/messagehandler.h4
-rw-r--r--src/net/messagein.cpp4
-rw-r--r--src/net/messagein.h4
-rw-r--r--src/net/messageout.cpp2
-rw-r--r--src/net/messageout.h4
-rw-r--r--src/net/net.cpp2
-rw-r--r--src/net/net.h4
-rw-r--r--src/net/npchandler.h4
-rw-r--r--src/net/partyhandler.h4
-rw-r--r--src/net/playerhandler.h4
-rw-r--r--src/net/sdltcpnet.h2
-rw-r--r--src/net/serverinfo.h2
-rw-r--r--src/net/skillhandler.h5
-rw-r--r--src/net/tmwa/adminhandler.cpp4
-rw-r--r--src/net/tmwa/beinghandler.cpp26
-rw-r--r--src/net/tmwa/buysellhandler.cpp2
-rw-r--r--src/net/tmwa/charserverhandler.cpp29
-rw-r--r--src/net/tmwa/chathandler.cpp4
-rw-r--r--src/net/tmwa/gamehandler.cpp2
-rw-r--r--src/net/tmwa/generalhandler.cpp3
-rw-r--r--src/net/tmwa/gui/guildtab.cpp2
-rw-r--r--src/net/tmwa/gui/partytab.cpp2
-rw-r--r--src/net/tmwa/guildhandler.cpp44
-rw-r--r--src/net/tmwa/inventoryhandler.cpp4
-rw-r--r--src/net/tmwa/itemhandler.cpp2
-rw-r--r--src/net/tmwa/loginhandler.cpp16
-rw-r--r--src/net/tmwa/messagehandler.cpp2
-rw-r--r--src/net/tmwa/messagein.cpp4
-rw-r--r--src/net/tmwa/messageout.cpp2
-rw-r--r--src/net/tmwa/network.cpp2
-rw-r--r--src/net/tmwa/npchandler.cpp34
-rw-r--r--src/net/tmwa/partyhandler.cpp6
-rw-r--r--src/net/tmwa/playerhandler.cpp6
-rw-r--r--src/net/tmwa/questhandler.cpp5
-rw-r--r--src/net/tmwa/skillhandler.cpp5
-rw-r--r--src/net/tmwa/tradehandler.cpp2
-rw-r--r--src/net/tradehandler.h5
-rw-r--r--src/net/worldinfo.h2
92 files changed, 417 insertions, 466 deletions
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index a7820a832..dc249c137 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -60,6 +60,6 @@ class AdminHandler
const int x, const int y) const = 0;
};
-} // namespace Net
+} // namespace Net
-#endif // ADMINHANDLER_H
+#endif // ADMINHANDLER_H
diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h
index fcbf0bb5a..332d2e81c 100644
--- a/src/net/beinghandler.h
+++ b/src/net/beinghandler.h
@@ -41,6 +41,6 @@ class BeingHandler
virtual void undress(Being *const being) const = 0;
};
-} // namespace Net
+} // namespace Net
-#endif // BEINGHANDLER_H
+#endif // BEINGHANDLER_H
diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h
index 1f5578ed7..1b9984647 100644
--- a/src/net/buysellhandler.h
+++ b/src/net/buysellhandler.h
@@ -51,6 +51,6 @@ class BuySellHandler
const int amount) const = 0;
};
-} // namespace Net
+} // namespace Net
-#endif // BUYSELLHANDLER_H
+#endif // BUYSELLHANDLER_H
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp
index dc8b306f9..0e8add107 100644
--- a/src/net/charserverhandler.cpp
+++ b/src/net/charserverhandler.cpp
@@ -40,4 +40,4 @@ void CharServerHandler::unlockCharSelectDialog()
mCharSelectDialog->unlock();
}
-}
+} // namespace Net
diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h
index c12a969aa..9bbba0ab4 100644
--- a/src/net/charserverhandler.h
+++ b/src/net/charserverhandler.h
@@ -116,6 +116,6 @@ class CharServerHandler
CharCreateDialog *mCharCreateDialog;
};
-} // namespace Net
+} // namespace Net
-#endif // CHARSERVERHANDLER_H
+#endif // CHARSERVERHANDLER_H
diff --git a/src/net/chathandler.h b/src/net/chathandler.h
index e4fe2deb7..fe113b6d5 100644
--- a/src/net/chathandler.h
+++ b/src/net/chathandler.h
@@ -53,6 +53,7 @@ class ChatHandler
virtual void unIgnoreAll() const = 0;
};
+
}
-#endif // CHATHANDLER_H
+#endif // CHATHANDLER_H
diff --git a/src/net/download.cpp b/src/net/download.cpp
index 05cbd110a..afec61d0f 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -219,7 +219,7 @@ int Download::downloadThread(void *ptr)
if (d->mOptions.cancel)
{
- //need terminate thread?
+ // need terminate thread?
d->mThread = nullptr;
return 0;
}
@@ -233,7 +233,6 @@ int Download::downloadThread(void *ptr)
curl_easy_setopt(d->mCurl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(d->mCurl, CURLOPT_HTTPHEADER, d->mHeaders);
-// curl_easy_setopt(d->mCurl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
if (d->mOptions.memoryWrite)
{
@@ -320,7 +319,7 @@ int Download::downloadThread(void *ptr)
d->mFileName.c_str(),
adler, d->mAdler);
attempts++;
- continue; // Bail out here to avoid the renaming
+ continue; // Bail out here to avoid the renaming
}
}
if (file)
@@ -362,7 +361,7 @@ int Download::downloadThread(void *ptr)
if (d->mOptions.cancel)
{
- //need ternibate thread?
+ // need ternibate thread?
d->mThread = nullptr;
return 0;
}
@@ -399,33 +398,33 @@ void Download::addProxy(CURL *const curl)
}
switch (mode)
{
- case 1: // direct connection
+ case 1: // direct connection
default:
curl_easy_setopt(curl, CURLOPT_PROXY, "");
break;
- case 2: // HTTP
+ case 2: // HTTP
break;
- case 3: // HTTP 1.0
+ case 3: // HTTP 1.0
#if CURLVERSION_ATLEAST(7, 19, 4)
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP_1_0);
#endif
break;
- case 4: // SOCKS4
+ case 4: // SOCKS4
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
break;
- case 5: // SOCKS4A
+ case 5: // SOCKS4A
#if CURLVERSION_ATLEAST(7, 18, 0)
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
#else
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
#endif
break;
- case 6: // SOCKS5
+ case 6: // SOCKS5
#if CURLVERSION_ATLEAST(7, 18, 0)
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
#endif
break;
- case 7: // SOCKS5 hostname
+ case 7: // SOCKS5 hostname
#if CURLVERSION_ATLEAST(7, 18, 0)
curl_easy_setopt(curl, CURLOPT_PROXYTYPE,
CURLPROXY_SOCKS5_HOSTNAME);
@@ -450,4 +449,4 @@ void Download::secureCurl(CURL *const curl)
#endif
}
-} // namespace Net
+} // namespace Net
diff --git a/src/net/download.h b/src/net/download.h
index 53ecf4171..d351a8355 100644
--- a/src/net/download.h
+++ b/src/net/download.h
@@ -124,6 +124,6 @@ class Download final
bool mIgnoreError;
};
-} // namespace Net
+} // namespace Net
-#endif // NET_DOWNLOAD_H
+#endif // NET_DOWNLOAD_H
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
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index 615cffa28..4661cd5b8 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -85,7 +85,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
@@ -94,4 +94,4 @@ void AdminHandler::kick(const int playerId) const
outMsg.writeInt32(playerId);
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 6fb7ee087..6de4bf1b7 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -102,14 +102,14 @@ 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)
{
switch (msg.getId())
{
- case SMSG_BEING_VISIBLE: // changed
+ case SMSG_BEING_VISIBLE: // changed
case SMSG_BEING_MOVE:
processBeingVisibleOrMove(msg, msg.getId() == SMSG_BEING_VISIBLE);
break;
@@ -118,7 +118,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
processBeingMove2(msg);
break;
- case SMSG_BEING_SPAWN: // changed
+ case SMSG_BEING_SPAWN: // changed
processBeingSpawn(msg);
break;
@@ -433,10 +433,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);
@@ -474,7 +474,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();
@@ -483,9 +483,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
msg.readInt8();
msg.readInt8();
msg.readInt8();
- msg.readInt8(); //unused
-// shoes = msg.readInt16();
-// gloves = msg.readInt16(); //sd->head_dir
+ msg.readInt8(); // unused
const int guild = msg.readInt32(); // guild
@@ -508,14 +506,9 @@ 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);
dstBeing->setSprite(SPRITE_BOTTOMCLOTHES, headBottom);
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));
@@ -552,7 +545,6 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
}
else
{
-// uint8_t dir;
uint16_t x, y;
msg.readCoordinates(x, y, dir);
dstBeing->setTileCoords(x, y);
@@ -590,7 +582,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
break;
default:
- //need set stay state?
+ // need set stay state?
logger->log("QQQ2 SMSG_PLAYER_UPDATE_1:"
+ toString(id) + " " + toString(type));
logger->log("dstBeing id:" + toString(dstBeing->getId()));
@@ -601,21 +593,20 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
}
else if (msgType == 3)
{
- msg.readInt8(); // unknown
+ msg.readInt8(); // unknown
}
- const int level = msg.readInt8(); // Lv
+ 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);
@@ -634,7 +625,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
return;
if (visible)
- msg.readInt8(); // padding?
+ msg.readInt8(); // padding?
// Information about a being in range
const int id = msg.readInt32();
@@ -646,7 +637,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
mSpawnId = 0;
short speed = msg.readInt16();
const uint16_t stunMode = msg.readInt16(); // opt1
- uint32_t statusEffects = msg.readInt16(); // opt2
+ uint32_t statusEffects = msg.readInt16(); // opt2
statusEffects |= (static_cast<uint32_t>(msg.readInt16())) << 16; // option
const short job = msg.readInt16(); // class
@@ -712,14 +703,11 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
const uint16_t weapon = msg.readInt16();
const uint16_t headBottom = msg.readInt16();
-// if (!visible)
-// 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)
@@ -731,24 +719,15 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
else
{
gloves = msg.readInt16(); // head dir - "abused" as gloves
- msg.readInt32(); // guild
- msg.readInt16(); // guild emblem
+ msg.readInt32(); // guild
+ msg.readInt16(); // guild emblem
}
-// logger->log("being guild: " + toString(guild));
-/*
- if (guild == 0)
- dstBeing->clearGuilds();
- else
- dstBeing->setGuild(Guild::getGuild(static_cast<short>(guild)));
-*/
msg.readInt16(); // manner
dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3
msg.readInt8(); // karma
short gender = msg.readInt8();
- // reserving bits for future usage
-
if (dstBeing->getType() == ActorSprite::PLAYER)
{
gender &= 3;
@@ -818,13 +797,12 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
msg.readInt8(); // unknown
msg.readInt8(); // state / sit
- msg.readInt16(); // level
+ msg.readInt16(); // level
dstBeing->setStunMode(stunMode);
dstBeing->setStatusEffectBlock(0, static_cast<uint16_t>(
(statusEffects >> 16) & 0xffff));
dstBeing->setStatusEffectBlock(16, statusEffects & 0xffff);
-
}
} // namespace EAthena
diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp
index b96d2c382..0b1c4ad06 100644
--- a/src/net/eathena/buysellhandler.cpp
+++ b/src/net/eathena/buysellhandler.cpp
@@ -95,7 +95,6 @@ void BuySellHandler::handleMessage(Net::MessageIn &msg)
default:
break;
}
-
}
void BuySellHandler::processNpcBuy(Net::MessageIn &msg)
@@ -110,7 +109,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg)
{
const int value = msg.readInt32();
msg.readInt32(); // DCvalue
- msg.readInt8(); // type
+ msg.readInt8(); // type
const int itemId = msg.readInt16();
const unsigned char color = 1;
mBuyDialog->addItem(itemId, color, 0, value);
@@ -137,4 +136,4 @@ void BuySellHandler::processNpcSellResponse(Net::MessageIn &msg) const
}
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index ca4275ebe..ffb83ea73 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -154,8 +154,8 @@ 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();
@@ -163,11 +163,11 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
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();
tempPlayer->setSprite(SPRITE_HAIR, hairStyle * -1,
@@ -186,16 +186,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)
@@ -273,7 +273,7 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg)
if (slots > 0 && slots < 30)
loginData.characterSlots = static_cast<short unsigned int>(slots);
- msg.skip(18); // 0 Unused
+ msg.skip(18); // 0 Unused
delete_all(mCharacters);
mCharacters.clear();
@@ -296,4 +296,4 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg)
Client::setState(STATE_CHAR_SELECT);
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index ae13a47b7..940227b3c 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -55,7 +55,7 @@ ChatHandler::ChatHandler() :
SMSG_WHISPER,
SMSG_WHISPER_RESPONSE,
SMSG_GM_CHAT,
- SMSG_MVP, // MVP
+ SMSG_MVP, // MVP
SMSG_IGNORE_ALL_RESPONSE,
0
};
@@ -261,4 +261,4 @@ void ChatHandler::unIgnoreAll() const
outMsg.writeInt8(1);
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp
index 00cfcc827..74f2a89ea 100644
--- a/src/net/eathena/gamehandler.cpp
+++ b/src/net/eathena/gamehandler.cpp
@@ -171,7 +171,7 @@ void GameHandler::disconnect2() const
void GameHandler::processMapCharId(Net::MessageIn &msg)
{
- msg.readInt32(); // char id
+ msg.readInt32(); // char id
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp
index 637bd7369..b75044bb3 100644
--- a/src/net/eathena/generalhandler.cpp
+++ b/src/net/eathena/generalhandler.cpp
@@ -285,4 +285,4 @@ void GeneralHandler::gameEnded() const
Ea::partyTab = nullptr;
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/gui/guildtab.cpp b/src/net/eathena/gui/guildtab.cpp
index e3cf1b662..f946e1f8e 100644
--- a/src/net/eathena/gui/guildtab.cpp
+++ b/src/net/eathena/gui/guildtab.cpp
@@ -47,4 +47,4 @@ GuildTab::~GuildTab()
{
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/gui/partytab.cpp b/src/net/eathena/gui/partytab.cpp
index bf40c3e01..157869a96 100644
--- a/src/net/eathena/gui/partytab.cpp
+++ b/src/net/eathena/gui/partytab.cpp
@@ -50,4 +50,4 @@ PartyTab::~PartyTab()
{
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index 481a74236..e9d4109dc 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -194,7 +194,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);
}
@@ -210,8 +210,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
}
}
@@ -223,8 +223,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,
@@ -233,8 +233,8 @@ void GuildHandler::inviteResponse(const int guildId,
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
@@ -244,9 +244,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(player_node->getId()); // Account ID
msg.writeInt32(PlayerInfo::getCharId()); // Char ID
- msg.writeString("", 40); // Message
+ msg.writeString("", 40); // Message
}
void GuildHandler::kick(const GuildMember *const member,
@@ -257,9 +257,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,
@@ -285,7 +285,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)
@@ -299,7 +299,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,
@@ -309,10 +309,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,
@@ -320,8 +320,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 EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 79219cb42..b19419407 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -164,7 +164,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
@@ -202,4 +202,4 @@ void InventoryHandler::moveItem2(const int source, const int slot,
}
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/itemhandler.cpp b/src/net/eathena/itemhandler.cpp
index 0e2a1e003..c1f157160 100644
--- a/src/net/eathena/itemhandler.cpp
+++ b/src/net/eathena/itemhandler.cpp
@@ -64,4 +64,4 @@ void ItemHandler::handleMessage(Net::MessageIn &msg)
}
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp
index cda6c0c1a..91900b623 100644
--- a/src/net/eathena/loginhandler.cpp
+++ b/src/net/eathena/loginhandler.cpp
@@ -133,7 +133,7 @@ void LoginHandler::sendLoginRegister(const std::string &username,
const std::string &email A_UNUSED) const
{
MessageOut outMsg(0x0064);
- outMsg.writeInt32(0); // client version
+ outMsg.writeInt32(0); // client version
outMsg.writeString(username, 24);
outMsg.writeStringNoLog(password, 24);
@@ -197,4 +197,4 @@ void LoginHandler::processUpdateHost2(Net::MessageIn &msg) const
Client::setState(STATE_LOGIN);
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/messagehandler.cpp b/src/net/eathena/messagehandler.cpp
index 1a031c4b2..791660283 100644
--- a/src/net/eathena/messagehandler.cpp
+++ b/src/net/eathena/messagehandler.cpp
@@ -48,4 +48,4 @@ void MessageHandler::setNetwork(Network *network)
mNetwork = network;
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp
index cb5f2ecfd..1acbd4665 100644
--- a/src/net/eathena/messagein.cpp
+++ b/src/net/eathena/messagein.cpp
@@ -33,7 +33,7 @@
#include "debug.h"
-namespace EAthena
+namespace EAthena
{
MessageIn::MessageIn(const char *const data, const unsigned int length) :
@@ -81,4 +81,4 @@ int32_t MessageIn::readInt32()
return value;
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp
index 734ce4057..210717503 100644
--- a/src/net/eathena/messageout.cpp
+++ b/src/net/eathena/messageout.cpp
@@ -143,4 +143,4 @@ void MessageOut::writeCoordinates(const unsigned short x,
PacketCounters::incOutBytes(3);
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index e03554ee2..42d16396d 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -241,4 +241,4 @@ Network *Network::instance()
return mInstance;
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index e2d5a003a..4730067fd 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -116,7 +116,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
@@ -162,21 +162,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,
const int amount) const
{
MessageOut outMsg(CMSG_NPC_BUY_REQUEST);
- 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));
}
@@ -193,7 +193,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));
}
@@ -247,18 +247,18 @@ int NpcHandler::getNpc(Net::MessageIn &msg, const bool haveLength)
void NpcHandler::processNpcCutin(Net::MessageIn &msg A_UNUSED,
int npcId A_UNUSED) const
{
- msg.readString(64); // image name
- msg.readInt8(); // type
+ msg.readString(64); // image name
+ msg.readInt8(); // type
}
void NpcHandler::processNpcViewPoint(Net::MessageIn &msg A_UNUSED,
int npcId A_UNUSED) const
{
- msg.readInt32(); // type
- msg.readInt32(); // x
- msg.readInt32(); // y
- msg.readInt8(); // byte
- msg.readInt32(); // color
+ msg.readInt32(); // type
+ msg.readInt32(); // x
+ msg.readInt32(); // y
+ msg.readInt8(); // byte
+ msg.readInt32(); // color
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index b128d3879..26e5ed981 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -153,7 +153,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
}
}
@@ -171,7 +171,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
@@ -201,4 +201,4 @@ void PartyHandler::setShareItems(const PartyShare share) const
outMsg.writeInt16(share);
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp
index 3d80c2e1e..c5f3c3a0f 100644
--- a/src/net/eathena/playerhandler.cpp
+++ b/src/net/eathena/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;
@@ -230,15 +230,15 @@ void PlayerHandler::processPlayerShortcuts(Net::MessageIn &msg) const
{
for (int f = 0; f < 27; f ++)
{
- msg.readInt8(); // type 0: item, 1: skill
- msg.readInt32(); // item or skill id
- msg.readInt16(); // lvl
+ msg.readInt8(); // type 0: item, 1: skill
+ msg.readInt32(); // item or skill id
+ msg.readInt16(); // lvl
}
}
void PlayerHandler::processPlayerShowEquip(Net::MessageIn &msg) const
{
- msg.readInt8(); // show equip
+ msg.readInt8(); // show equip
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp
index 75aae7608..e14d89e4e 100644
--- a/src/net/eathena/skillhandler.cpp
+++ b/src/net/eathena/skillhandler.cpp
@@ -95,4 +95,4 @@ void SkillHandler::useMap(const int id, const std::string &map) const
outMsg.writeString(map, 16);
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp
index aa11b1233..df0364af5 100644
--- a/src/net/eathena/tradehandler.cpp
+++ b/src/net/eathena/tradehandler.cpp
@@ -144,4 +144,4 @@ void TradeHandler::cancel() const
MessageOut outMsg(CMSG_TRADE_CANCEL_REQUEST);
}
-} // namespace EAthena
+} // namespace EAthena
diff --git a/src/net/gamehandler.h b/src/net/gamehandler.h
index 89111d241..cd32b5420 100644
--- a/src/net/gamehandler.h
+++ b/src/net/gamehandler.h
@@ -63,6 +63,6 @@ class GameHandler
virtual void clear() = 0;
};
-} // namespace Net
+} // namespace Net
-#endif // MAPHANDLER_H
+#endif // MAPHANDLER_H
diff --git a/src/net/generalhandler.h b/src/net/generalhandler.h
index a243d2c9b..3860267aa 100644
--- a/src/net/generalhandler.h
+++ b/src/net/generalhandler.h
@@ -49,6 +49,6 @@ class GeneralHandler
virtual void gameEnded() const = 0;
};
-} // namespace Net
+} // namespace Net
-#endif // GENERALHANDLER_H
+#endif // GENERALHANDLER_H
diff --git a/src/net/guildhandler.h b/src/net/guildhandler.h
index 23b4048cc..113b0d869 100644
--- a/src/net/guildhandler.h
+++ b/src/net/guildhandler.h
@@ -84,6 +84,6 @@ class GuildHandler
virtual ChatTab *getTab() const = 0;
};
-}
+} // namespace Net
-#endif // GUILDHANDLER_H
+#endif // GUILDHANDLER_H
diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h
index 3b8a24aa5..48e6e7afe 100644
--- a/src/net/inventoryhandler.h
+++ b/src/net/inventoryhandler.h
@@ -69,6 +69,6 @@ class InventoryHandler
virtual int convertFromServerSlot(const int eAthenaSlot) const = 0;
};
-} // namespace Net
+} // namespace Net
-#endif // INVENTORYHANDLER_H
+#endif // INVENTORYHANDLER_H
diff --git a/src/net/logindata.h b/src/net/logindata.h
index 76d4e3711..a88879310 100644
--- a/src/net/logindata.h
+++ b/src/net/logindata.h
@@ -107,4 +107,4 @@ class LoginData final
}
};
-#endif // LOGINDATA_H
+#endif // LOGINDATA_H
diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h
index fbac1ee79..e72c9f761 100644
--- a/src/net/loginhandler.h
+++ b/src/net/loginhandler.h
@@ -110,6 +110,6 @@ class LoginHandler
ServerInfo mServer;
};
-} // namespace Net
+} // namespace Net
-#endif // LOGINHANDLER_H
+#endif // LOGINHANDLER_H
diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h
index c2f4307b4..fdf552403 100644
--- a/src/net/messagehandler.h
+++ b/src/net/messagehandler.h
@@ -46,6 +46,6 @@ class MessageHandler
{ }
};
-}
+} // namespace Net
-#endif // NET_MESSAGEHANDLER_H
+#endif // NET_MESSAGEHANDLER_H
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index a833c6cde..4ea6c7415 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -247,7 +247,7 @@ unsigned char *MessageIn::readBytes(int length)
unsigned char *const buf = new unsigned char[length + 2];
- memcpy (buf, mData + mPos, length);
+ memcpy(buf, mData + mPos, length);
buf[length] = 0;
buf[length + 1] = 0;
mPos += length;
@@ -271,4 +271,4 @@ unsigned char *MessageIn::readBytes(int length)
return buf;
}
-}
+} // namespace Net
diff --git a/src/net/messagein.h b/src/net/messagein.h
index 2f152924d..ecd6e2dea 100644
--- a/src/net/messagein.h
+++ b/src/net/messagein.h
@@ -126,6 +126,6 @@ class MessageIn
unsigned int mPos;
};
-}
+} // namespace Net
-#endif // NET_MESSAGEIN_H
+#endif // NET_MESSAGEIN_H
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp
index 3c20bce00..76e2085ee 100644
--- a/src/net/messageout.cpp
+++ b/src/net/messageout.cpp
@@ -120,4 +120,4 @@ unsigned int MessageOut::getDataSize() const
return mDataSize;
}
-}
+} // namespace Net
diff --git a/src/net/messageout.h b/src/net/messageout.h
index 4fd647218..b69a91b75 100644
--- a/src/net/messageout.h
+++ b/src/net/messageout.h
@@ -95,6 +95,6 @@ class MessageOut
unsigned int mPos; /**< Position in the data. */
};
-}
+} // namespace Net
-#endif // NET_MESSAGEOUT_H
+#endif // NET_MESSAGEOUT_H
diff --git a/src/net/net.cpp b/src/net/net.cpp
index 8e997b35b..bb3160cda 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -214,4 +214,4 @@ ServerInfo::Type getNetworkType()
return networkType;
}
-} // namespace Net
+} // namespace Net
diff --git a/src/net/net.h b/src/net/net.h
index c2d19ac72..2d3c9995a 100644
--- a/src/net/net.h
+++ b/src/net/net.h
@@ -77,6 +77,6 @@ void connectToServer(const ServerInfo &server);
void unload();
-} // namespace Net
+} // namespace Net
-#endif // NET_H
+#endif // NET_H
diff --git a/src/net/npchandler.h b/src/net/npchandler.h
index 685e04c57..b1e954a26 100644
--- a/src/net/npchandler.h
+++ b/src/net/npchandler.h
@@ -69,6 +69,6 @@ class NpcHandler
virtual void clearDialogs() = 0;
};
-} // namespace Net
+} // namespace Net
-#endif // NPCHANDLER_H
+#endif // NPCHANDLER_H
diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h
index 4929fc6da..54b30c106 100644
--- a/src/net/partyhandler.h
+++ b/src/net/partyhandler.h
@@ -80,6 +80,6 @@ class PartyHandler
virtual ChatTab *getTab() = 0;
};
-} // namespace Net
+} // namespace Net
-#endif // PARTYHANDLER_H
+#endif // PARTYHANDLER_H
diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h
index a536bbf18..ad3d50f4a 100644
--- a/src/net/playerhandler.h
+++ b/src/net/playerhandler.h
@@ -79,6 +79,6 @@ class PlayerHandler
virtual void updateStatus(const uint8_t status) const = 0;
};
-} // namespace Net
+} // namespace Net
-#endif // PLAYERHANDLER_H
+#endif // PLAYERHANDLER_H
diff --git a/src/net/sdltcpnet.h b/src/net/sdltcpnet.h
index eaa5801a5..c13b84063 100644
--- a/src/net/sdltcpnet.h
+++ b/src/net/sdltcpnet.h
@@ -57,6 +57,6 @@ namespace TcpNet
int delSocket(TcpNet::SocketSet set, TcpNet::Socket sock);
void freeSocketSet(TcpNet::SocketSet set);
-}
+} // namespace TcpNet
#endif
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h
index de82b1ec4..af36c27e6 100644
--- a/src/net/serverinfo.h
+++ b/src/net/serverinfo.h
@@ -129,4 +129,4 @@ public:
typedef std::vector<ServerInfo> ServerInfos;
-#endif // SERVERINFO_H
+#endif // SERVERINFO_H
diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h
index 6e8b786a9..97f7415b7 100644
--- a/src/net/skillhandler.h
+++ b/src/net/skillhandler.h
@@ -41,6 +41,7 @@ class SkillHandler
virtual void useMap(const int id, const std::string &map) const = 0;
};
-}
-#endif // SKILLHANDLER_H
+} // namespace Net
+
+#endif // SKILLHANDLER_H
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
diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h
index 3adc3265f..90708de45 100644
--- a/src/net/tradehandler.h
+++ b/src/net/tradehandler.h
@@ -63,6 +63,7 @@ class TradeHandler
virtual void cancel() const
{ }
};
-}
-#endif // TRADEHANDLER_H
+} // namespace Net
+
+#endif // TRADEHANDLER_H
diff --git a/src/net/worldinfo.h b/src/net/worldinfo.h
index 8388a4406..65f8ae978 100644
--- a/src/net/worldinfo.h
+++ b/src/net/worldinfo.h
@@ -37,4 +37,4 @@ struct WorldInfo final
typedef std::vector<WorldInfo*> Worlds;
-#endif // WORLD_INFO_H
+#endif // WORLD_INFO_H