summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-26 23:25:32 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-26 23:25:32 +0300
commit3ed2e647a7ec634a91a32e7ac493c9f2b6d693b0 (patch)
treed7f1400583c5bc6916129e05fc5e0907d1081ca9 /src/net
parent6112e911a5b702fa1a9fca7bb6300f0195cbe685 (diff)
downloadmv-3ed2e647a7ec634a91a32e7ac493c9f2b6d693b0.tar.gz
mv-3ed2e647a7ec634a91a32e7ac493c9f2b6d693b0.tar.bz2
mv-3ed2e647a7ec634a91a32e7ac493c9f2b6d693b0.tar.xz
mv-3ed2e647a7ec634a91a32e7ac493c9f2b6d693b0.zip
Fix code style.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/cashshophandler.h6
-rw-r--r--src/net/ea/adminhandler.cpp3
-rw-r--r--src/net/ea/beinghandler.cpp1
-rw-r--r--src/net/ea/buysellhandler.cpp1
-rw-r--r--src/net/ea/charserverhandler.cpp4
-rw-r--r--src/net/ea/chathandler.cpp1
-rw-r--r--src/net/ea/gui/guildtab.cpp1
-rw-r--r--src/net/ea/gui/partytab.cpp1
-rw-r--r--src/net/ea/itemhandler.cpp2
-rw-r--r--src/net/ea/skillhandler.cpp2
-rw-r--r--src/net/eathena/auctionhandler.cpp7
-rw-r--r--src/net/eathena/auctionhandler.h2
-rw-r--r--src/net/eathena/bankhandler.cpp4
-rw-r--r--src/net/eathena/bankhandler.h2
-rw-r--r--src/net/eathena/buyingstorehandler.cpp5
-rw-r--r--src/net/eathena/buyingstorehandler.h2
-rw-r--r--src/net/eathena/cashshophandler.cpp7
-rw-r--r--src/net/eathena/cashshophandler.h2
-rw-r--r--src/net/eathena/charserverhandler.cpp3
-rw-r--r--src/net/eathena/chathandler.cpp2
-rw-r--r--src/net/eathena/familyhandler.cpp4
-rw-r--r--src/net/eathena/familyhandler.h2
-rw-r--r--src/net/eathena/gamehandler.cpp2
-rw-r--r--src/net/eathena/guildhandler.cpp2
-rw-r--r--src/net/eathena/homunculushandler.cpp9
-rw-r--r--src/net/eathena/homunculushandler.h2
-rw-r--r--src/net/eathena/inventoryhandler.cpp1
-rw-r--r--src/net/eathena/loginhandler.cpp1
-rw-r--r--src/net/eathena/mailhandler.cpp6
-rw-r--r--src/net/eathena/menutype.h2
-rw-r--r--src/net/eathena/mercenaryhandler.cpp9
-rw-r--r--src/net/eathena/mercenaryhandler.h2
-rw-r--r--src/net/eathena/messagein.cpp2
-rw-r--r--src/net/eathena/network.cpp1
-rw-r--r--src/net/eathena/partyhandler.cpp2
-rw-r--r--src/net/eathena/pethandler.cpp2
-rw-r--r--src/net/eathena/playerhandler.cpp2
-rw-r--r--src/net/eathena/questhandler.cpp2
-rw-r--r--src/net/eathena/skillhandler.cpp4
-rw-r--r--src/net/mercenaryhandler.h6
-rw-r--r--src/net/messagein.cpp1
-rw-r--r--src/net/messageout.cpp2
-rw-r--r--src/net/net.cpp5
-rw-r--r--src/net/packetlimiter.cpp2
-rw-r--r--src/net/tmwa/adminhandler.cpp3
-rw-r--r--src/net/tmwa/beinghandler.cpp4
-rw-r--r--src/net/tmwa/buysellhandler.cpp1
-rw-r--r--src/net/tmwa/charserverhandler.cpp1
-rw-r--r--src/net/tmwa/chathandler.cpp5
-rw-r--r--src/net/tmwa/gamehandler.cpp2
-rw-r--r--src/net/tmwa/guildhandler.cpp1
-rw-r--r--src/net/tmwa/inventoryhandler.cpp1
-rw-r--r--src/net/tmwa/loginhandler.cpp1
-rw-r--r--src/net/tmwa/messagein.cpp2
-rw-r--r--src/net/tmwa/npchandler.cpp1
-rw-r--r--src/net/tmwa/pethandler.cpp4
-rw-r--r--src/net/tmwa/playerhandler.cpp2
-rw-r--r--src/net/tmwa/questhandler.cpp1
-rw-r--r--src/net/tmwa/serverfeatures.cpp2
59 files changed, 37 insertions, 125 deletions
diff --git a/src/net/cashshophandler.h b/src/net/cashshophandler.h
index 27ce3cfd7..18af3f7ea 100644
--- a/src/net/cashshophandler.h
+++ b/src/net/cashshophandler.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NET_CACHSHOPHANDLER_H
-#define NET_CACHSHOPHANDLER_H
+#ifndef NET_CASHSHOPHANDLER_H
+#define NET_CASHSHOPHANDLER_H
#include <string>
@@ -39,4 +39,4 @@ class CashShopHandler notfinal
extern Net::CashShopHandler *cashShopHandler;
-#endif // NET_CACHSHOPHANDLER_H
+#endif // NET_CASHSHOPHANDLER_H
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp
index 42c2eb52e..6eb413e7c 100644
--- a/src/net/ea/adminhandler.cpp
+++ b/src/net/ea/adminhandler.cpp
@@ -25,9 +25,10 @@
#include "gui/chatconsts.h"
#include "net/chathandler.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
+#include "utils/stringutils.h"
+
#include <string>
#include "debug.h"
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 7e66c5dd2..f9fdf3c38 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -26,7 +26,6 @@
#include "configuration.h"
#include "effectmanager.h"
#include "game.h"
-#include "guildmanager.h"
#include "party.h"
#include "being/localplayer.h"
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp
index b28681cb9..f2252d1fe 100644
--- a/src/net/ea/buysellhandler.cpp
+++ b/src/net/ea/buysellhandler.cpp
@@ -37,7 +37,6 @@
#include "gui/windows/shopwindow.h"
#include "net/chathandler.h"
-#include "net/net.h"
#include "net/ea/eaprotocol.h"
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp
index e142fe27d..015904918 100644
--- a/src/net/ea/charserverhandler.cpp
+++ b/src/net/ea/charserverhandler.cpp
@@ -29,18 +29,14 @@
#include "gui/windows/charcreatedialog.h"
#include "gui/windows/okdialog.h"
-#include "net/ea/loginhandler.h"
#include "net/ea/eaprotocol.h"
#include "net/character.h"
#include "net/messagein.h"
-#include "net/net.h"
#include "utils/dtor.h"
#include "utils/gettext.h"
-#include "resources/db/chardb.h"
-
#include "debug.h"
extern Net::CharServerHandler *charServerHandler;
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index b8f201229..8ac0ce6f5 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -36,7 +36,6 @@
#include "gui/widgets/tabs/gmtab.h"
#include "net/messagein.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
#include "net/ea/eaprotocol.h"
diff --git a/src/net/ea/gui/guildtab.cpp b/src/net/ea/gui/guildtab.cpp
index 996c8fd58..044df87e7 100644
--- a/src/net/ea/gui/guildtab.cpp
+++ b/src/net/ea/gui/guildtab.cpp
@@ -29,7 +29,6 @@
#include "soundmanager.h"
#include "net/guildhandler.h"
-#include "net/net.h"
#include "gui/windows/chatwindow.h"
diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp
index afc1c3845..183863f25 100644
--- a/src/net/ea/gui/partytab.cpp
+++ b/src/net/ea/gui/partytab.cpp
@@ -30,7 +30,6 @@
#include "being/localplayer.h"
-#include "net/net.h"
#include "net/partyhandler.h"
#include "net/serverfeatures.h"
diff --git a/src/net/ea/itemhandler.cpp b/src/net/ea/itemhandler.cpp
index 4a5286aee..7142ccd7f 100644
--- a/src/net/ea/itemhandler.cpp
+++ b/src/net/ea/itemhandler.cpp
@@ -24,8 +24,6 @@
#include "actormanager.h"
-#include "net/messagein.h"
-
#include "debug.h"
namespace Ea
diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp
index d723efc54..5f26a5203 100644
--- a/src/net/ea/skillhandler.cpp
+++ b/src/net/ea/skillhandler.cpp
@@ -22,8 +22,6 @@
#include "net/ea/skillhandler.h"
-#include "logger.h"
-
#include "being/playerinfo.h"
#include "gui/windows/skilldialog.h"
diff --git a/src/net/eathena/auctionhandler.cpp b/src/net/eathena/auctionhandler.cpp
index bf544f822..343ce08c3 100644
--- a/src/net/eathena/auctionhandler.cpp
+++ b/src/net/eathena/auctionhandler.cpp
@@ -20,13 +20,6 @@
#include "net/eathena/auctionhandler.h"
-#include "logger.h"
-
-#include "net/ea/eaprotocol.h"
-
-#include "net/eathena/messageout.h"
-#include "net/eathena/protocol.h"
-
#include "debug.h"
extern Net::AuctionHandler *auctionHandler;
diff --git a/src/net/eathena/auctionhandler.h b/src/net/eathena/auctionhandler.h
index e4a20d77a..b7e797cc6 100644
--- a/src/net/eathena/auctionhandler.h
+++ b/src/net/eathena/auctionhandler.h
@@ -27,8 +27,6 @@
namespace EAthena
{
-class MessageOut;
-
class AuctionHandler final : public MessageHandler, public Net::AuctionHandler
{
public:
diff --git a/src/net/eathena/bankhandler.cpp b/src/net/eathena/bankhandler.cpp
index 352aca54e..79562c515 100644
--- a/src/net/eathena/bankhandler.cpp
+++ b/src/net/eathena/bankhandler.cpp
@@ -20,10 +20,6 @@
#include "net/eathena/bankhandler.h"
-#include "logger.h"
-
-#include "net/ea/eaprotocol.h"
-
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
diff --git a/src/net/eathena/bankhandler.h b/src/net/eathena/bankhandler.h
index 025b5209c..2957caf9c 100644
--- a/src/net/eathena/bankhandler.h
+++ b/src/net/eathena/bankhandler.h
@@ -27,8 +27,6 @@
namespace EAthena
{
-class MessageOut;
-
class BankHandler final : public MessageHandler,
public Net::BankHandler
{
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index 346f81b07..6206ead4e 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -20,11 +20,6 @@
#include "net/eathena/buyingstorehandler.h"
-#include "logger.h"
-
-#include "net/ea/eaprotocol.h"
-
-#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
#include "debug.h"
diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h
index 2b64adf64..3887c77cb 100644
--- a/src/net/eathena/buyingstorehandler.h
+++ b/src/net/eathena/buyingstorehandler.h
@@ -27,8 +27,6 @@
namespace EAthena
{
-class MessageOut;
-
class BuyingStoreHandler final : public MessageHandler,
public Net::BuyingStoreHandler
{
diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp
index 6c2273d3a..5e105babe 100644
--- a/src/net/eathena/cashshophandler.cpp
+++ b/src/net/eathena/cashshophandler.cpp
@@ -20,13 +20,6 @@
#include "net/eathena/cashshophandler.h"
-#include "logger.h"
-
-#include "net/ea/eaprotocol.h"
-
-#include "net/eathena/messageout.h"
-#include "net/eathena/protocol.h"
-
#include "debug.h"
extern Net::CashShopHandler *cashShopHandler;
diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h
index 7a6f354a8..4b16d99d5 100644
--- a/src/net/eathena/cashshophandler.h
+++ b/src/net/eathena/cashshophandler.h
@@ -27,8 +27,6 @@
namespace EAthena
{
-class MessageOut;
-
class CashShopHandler final : public MessageHandler,
public Net::CashShopHandler
{
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index d0c0247ca..35d64e70f 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -32,7 +32,6 @@
#include "net/character.h"
#include "net/logindata.h"
-#include "net/net.h"
#include "net/eathena/attrs.h"
#include "net/eathena/gamehandler.h"
@@ -44,11 +43,9 @@
#include "resources/iteminfo.h"
-#include "resources/db/chardb.h"
#include "resources/db/itemdb.h"
#include "utils/dtor.h"
-#include "utils/gettext.h"
#include "debug.h"
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 758bd37d4..cff13879f 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -28,8 +28,6 @@
#include "gui/chatconsts.h"
-#include "gui/widgets/tabs/chattab.h"
-
#include "gui/windows/chatwindow.h"
#include "net/mercenaryhandler.h"
diff --git a/src/net/eathena/familyhandler.cpp b/src/net/eathena/familyhandler.cpp
index 543870328..b222977ff 100644
--- a/src/net/eathena/familyhandler.cpp
+++ b/src/net/eathena/familyhandler.cpp
@@ -20,12 +20,8 @@
#include "net/eathena/familyhandler.h"
-#include "logger.h"
-
#include "being/being.h"
-#include "net/ea/eaprotocol.h"
-
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
diff --git a/src/net/eathena/familyhandler.h b/src/net/eathena/familyhandler.h
index 5d3062e22..365a129ba 100644
--- a/src/net/eathena/familyhandler.h
+++ b/src/net/eathena/familyhandler.h
@@ -27,8 +27,6 @@
namespace EAthena
{
-class MessageOut;
-
class FamilyHandler final : public MessageHandler,
public Net::FamilyHandler
{
diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp
index d8f3f5c0e..d1ff0f955 100644
--- a/src/net/eathena/gamehandler.cpp
+++ b/src/net/eathena/gamehandler.cpp
@@ -26,8 +26,6 @@
#include "being/localplayer.h"
-#include "net/net.h"
-
#include "net/eathena/loginhandler.h"
#include "net/eathena/messageout.h"
#include "net/eathena/network.h"
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index 10fba3be8..5508b13d9 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -200,7 +200,7 @@ void GuildHandler::create(const std::string &name) const
}
void GuildHandler::invite(const int guildId A_UNUSED,
- const std::string &name A_UNUSED) const
+ const std::string &name) const
{
if (!actorManager)
return;
diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp
index f96ad006b..948da91f2 100644
--- a/src/net/eathena/homunculushandler.cpp
+++ b/src/net/eathena/homunculushandler.cpp
@@ -21,7 +21,6 @@
#include "net/eathena/homunculushandler.h"
#include "actormanager.h"
-#include "logger.h"
#include "notifymanager.h"
#include "being/homunculusinfo.h"
@@ -29,8 +28,6 @@
#include "gui/windows/skilldialog.h"
-#include "net/ea/eaprotocol.h"
-
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
@@ -258,7 +255,9 @@ void HomunculusHandler::move(const int x, const int y) const
return;
createOutPacket(CMSG_HOMMERC_MOVE_TO);
outMsg.writeInt32(id);
- outMsg.writeCoordinates(x, y, 0U);
+ outMsg.writeCoordinates(static_cast<uint16_t>(x),
+ static_cast<uint16_t>(y),
+ 0U);
}
void HomunculusHandler::attack(const int targetId, const bool keep) const
@@ -269,7 +268,7 @@ void HomunculusHandler::attack(const int targetId, const bool keep) const
createOutPacket(CMSG_HOMMERC_ATTACK);
outMsg.writeInt32(id);
outMsg.writeInt32(targetId);
- outMsg.writeInt8(keep ? 1 : 0);
+ outMsg.writeInt8(static_cast<int8_t>(keep ? 1 : 0));
}
void HomunculusHandler::feed() const
diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h
index 94e3807f0..08acc9e94 100644
--- a/src/net/eathena/homunculushandler.h
+++ b/src/net/eathena/homunculushandler.h
@@ -27,8 +27,6 @@
namespace EAthena
{
-class MessageOut;
-
class HomunculusHandler final : public MessageHandler,
public Net::HomunculusHandler
{
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index c028a472e..f0b0d7a1d 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -29,7 +29,6 @@
#include "listeners/arrowslistener.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
#include "net/eathena/menu.h"
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp
index b5f2ed07d..f25b9a29c 100644
--- a/src/net/eathena/loginhandler.cpp
+++ b/src/net/eathena/loginhandler.cpp
@@ -32,7 +32,6 @@
#include "net/eathena/protocol.h"
#include "utils/gettext.h"
-#include "utils/paths.h"
#include "debug.h"
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp
index 00fa5fac5..24eb24a66 100644
--- a/src/net/eathena/mailhandler.cpp
+++ b/src/net/eathena/mailhandler.cpp
@@ -71,7 +71,7 @@ void MailHandler::processMailOpen(Net::MessageIn &msg) const
break;
default:
- logger->log("unknown mail window open flag: %u", flag);
+ logger->log("unknown mail window open flag: %d", flag);
break;
}
}
@@ -128,10 +128,10 @@ void MailHandler::send(const std::string &name,
const int sz = static_cast<int>(message.size());
createOutPacket(CMSG_MAIL_SEND);
- outMsg.writeInt16(69 + sz);
+ outMsg.writeInt16(static_cast<int16_t>(69 + sz));
outMsg.writeString(name, 24, "name");
outMsg.writeString(title, 40, "title");
- outMsg.writeInt8(sz);
+ outMsg.writeInt8(static_cast<int8_t>(sz));
outMsg.writeString(message, sz, "message");
}
diff --git a/src/net/eathena/menutype.h b/src/net/eathena/menutype.h
index 5ca671e1d..1481642fd 100644
--- a/src/net/eathena/menutype.h
+++ b/src/net/eathena/menutype.h
@@ -43,7 +43,7 @@ namespace EAthena
RepairWespon,
Teleport,
Warp,
- WeaponeRefine,
+ WeaponeRefine
};
} // namespace MenuType
} // namespace EAthena
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp
index 6ac4072c5..aa6152035 100644
--- a/src/net/eathena/mercenaryhandler.cpp
+++ b/src/net/eathena/mercenaryhandler.cpp
@@ -21,7 +21,6 @@
#include "net/eathena/mercenaryhandler.h"
#include "actormanager.h"
-#include "logger.h"
#include "notifymanager.h"
#include "being/being.h"
@@ -31,8 +30,6 @@
#include "gui/windows/skilldialog.h"
-#include "net/ea/eaprotocol.h"
-
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
@@ -202,7 +199,9 @@ void MercenaryHandler::move(const int x, const int y) const
return;
createOutPacket(CMSG_HOMMERC_MOVE_TO);
outMsg.writeInt32(id);
- outMsg.writeCoordinates(x, y, 0U);
+ outMsg.writeCoordinates(static_cast<uint16_t>(x),
+ static_cast<uint16_t>(y),
+ 0U);
}
void MercenaryHandler::attack(const int targetId, const bool keep) const
@@ -213,7 +212,7 @@ void MercenaryHandler::attack(const int targetId, const bool keep) const
createOutPacket(CMSG_HOMMERC_ATTACK);
outMsg.writeInt32(id);
outMsg.writeInt32(targetId);
- outMsg.writeInt8(keep ? 1 : 0);
+ outMsg.writeInt8(static_cast<int8_t>(keep ? 1 : 0));
}
} // namespace EAthena
diff --git a/src/net/eathena/mercenaryhandler.h b/src/net/eathena/mercenaryhandler.h
index 6ef3c02f5..695bb35a7 100644
--- a/src/net/eathena/mercenaryhandler.h
+++ b/src/net/eathena/mercenaryhandler.h
@@ -27,8 +27,6 @@
namespace EAthena
{
-class MessageOut;
-
class MercenaryHandler final : public MessageHandler,
public Net::MercenaryHandler
{
diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp
index f0715e5cb..fd406a79a 100644
--- a/src/net/eathena/messagein.cpp
+++ b/src/net/eathena/messagein.cpp
@@ -27,8 +27,6 @@
#include "logger.h"
-#include "utils/stringutils.h"
-
#include <SDL_endian.h>
#include "debug.h"
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 78ff3377e..ff4bfce14 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -27,7 +27,6 @@
#include "net/eathena/messagehandler.h"
#include "net/eathena/messagein.h"
#include "net/eathena/packets.h"
-#include "net/eathena/protocol.h"
#include "utils/delete2.h"
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index d90b82248..d63aa69cc 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -459,7 +459,7 @@ void PartyHandler::changeLeader(const std::string &name) const
void PartyHandler::allowInvite(const bool allow) const
{
createOutPacket(CMSG_PARTY_ALLOW_INVITES);
- outMsg.writeInt8(allow ? 1 : 0);
+ outMsg.writeInt8(static_cast<int8_t>(allow ? 1 : 0));
}
} // namespace EAthena
diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp
index 00dc27c07..50fd3d53c 100644
--- a/src/net/eathena/pethandler.cpp
+++ b/src/net/eathena/pethandler.cpp
@@ -35,7 +35,6 @@
#include "gui/widgets/tabs/chattab.h"
#include "net/chathandler.h"
-#include "net/net.h"
#include "net/ea/eaprotocol.h"
@@ -268,6 +267,7 @@ void PetHandler::processPetStatus(Net::MessageIn &msg)
PetInfo *const info = PlayerInfo::getPet();
if (!info)
return;
+ info->name = name;
info->level = level;
info->hungry = hungry;
info->intimacy = intimacy;
diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp
index 209284504..3a4f46a2c 100644
--- a/src/net/eathena/playerhandler.cpp
+++ b/src/net/eathena/playerhandler.cpp
@@ -27,8 +27,6 @@
#include "gui/windows/statuswindow.h"
-#include "net/net.h"
-
#include "net/eathena/attrs.h"
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
diff --git a/src/net/eathena/questhandler.cpp b/src/net/eathena/questhandler.cpp
index 87a84d5ee..dcdf726f2 100644
--- a/src/net/eathena/questhandler.cpp
+++ b/src/net/eathena/questhandler.cpp
@@ -187,7 +187,7 @@ void QuestHandler::setQeustActiveState(const int questId,
{
createOutPacket(CMSG_QUEST_ACTIVATE);
outMsg.writeInt32(questId, "quest id");
- outMsg.writeInt8(active ? 1 : 0, "activate");
+ outMsg.writeInt8(static_cast<int8_t>(active ? 1 : 0), "activate");
}
} // namespace EAthena
diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp
index e4e6c8101..b6e2b2cd2 100644
--- a/src/net/eathena/skillhandler.cpp
+++ b/src/net/eathena/skillhandler.cpp
@@ -202,8 +202,8 @@ void SkillHandler::processSkillFailed(Net::MessageIn &msg)
{
// Action failed (ex. sit because you have not reached the
// right level)
- const int skillId = msg.readInt16("skill id");
- const int16_t bskill = msg.readInt32("btype");
+ const int skillId = msg.readInt16("skill id");
+ const int bskill = msg.readInt32("btype");
const signed char success = msg.readUInt8("success");
const signed char reason = msg.readUInt8("reason");
if (success != static_cast<int>(SKILL_FAILED)
diff --git a/src/net/mercenaryhandler.h b/src/net/mercenaryhandler.h
index 8fcc4bb3a..fbd7cb79a 100644
--- a/src/net/mercenaryhandler.h
+++ b/src/net/mercenaryhandler.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NET_MECENARYHANDLER_H
-#define NET_MECENARYHANDLER_H
+#ifndef NET_MERCENARYHANDLER_H
+#define NET_MERCENARYHANDLER_H
#include <string>
@@ -49,4 +49,4 @@ class MercenaryHandler notfinal
extern Net::MercenaryHandler *mercenaryHandler;
-#endif // NET_MECENARYHANDLER_H
+#endif // NET_MERCENARYHANDLER_H
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index dee3c2c64..fbe5359e8 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -22,6 +22,7 @@
#include "net/messagein.h"
+#include "net/net.h"
#include "net/packetcounters.h"
#include "utils/stringutils.h"
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp
index 807cff66a..e2476813d 100644
--- a/src/net/messageout.cpp
+++ b/src/net/messageout.cpp
@@ -27,8 +27,6 @@
#include "logger.h"
-#include "utils/stringutils.h"
-
#include <cstring>
#include <string>
diff --git a/src/net/net.cpp b/src/net/net.cpp
index 3baec6059..fc5c109ea 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -36,8 +36,6 @@
#include "net/eathena/generalhandler.h"
#endif
-#include "utils/stringutils.h"
-
#include "debug.h"
namespace Net
@@ -57,7 +55,6 @@ namespace Net
class GuildHandler;
class HomunculusHandler;
class InventoryHandler;
- class LoginHandler;
class MailHandler;
class MercenaryHandler;
class NpcHandler;
@@ -68,7 +65,7 @@ namespace Net
class ServerFeatures;
class SkillHandler;
class TradeHandler;
-}
+} // namespace Net
Net::AdminHandler *adminHandler = nullptr;
Net::CharServerHandler *charServerHandler = nullptr;
diff --git a/src/net/packetlimiter.cpp b/src/net/packetlimiter.cpp
index b5dfd159a..f14daff77 100644
--- a/src/net/packetlimiter.cpp
+++ b/src/net/packetlimiter.cpp
@@ -23,7 +23,7 @@
#include "configuration.h"
#include "settings.h"
-#include "utils/stringutils.h"
+//#include "utils/stringutils.h"
#include "utils/timer.h"
#include <fstream>
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index 5a35ed3c4..a7b3ceb5c 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -27,13 +27,14 @@
#include "gui/chatconsts.h"
#include "net/chathandler.h"
-#include "net/net.h"
#include "net/tmwa/messageout.h"
#include "net/tmwa/protocol.h"
#include "resources/notifytypes.h"
+#include "utils/stringutils.h"
+
#include <string>
#include "debug.h"
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 7108f8ac8..863c4420f 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -26,7 +26,6 @@
#include "guild.h"
#include "guildmanager.h"
#include "party.h"
-#include "position.h"
#include "being/localplayer.h"
@@ -36,11 +35,10 @@
#include "gui/windows/outfitwindow.h"
#include "gui/windows/socialwindow.h"
-#include "net/net.h"
+#include "net/serverfeatures.h"
#include "net/tmwa/messageout.h"
#include "net/tmwa/protocol.h"
-#include "net/tmwa/serverfeatures.h"
#include "net/tmwa/sprite.h"
#include "resources/iteminfo.h"
diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp
index 5de7b0556..2f1f23adc 100644
--- a/src/net/tmwa/buysellhandler.cpp
+++ b/src/net/tmwa/buysellhandler.cpp
@@ -29,7 +29,6 @@
#include "gui/windows/buydialog.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
#include "net/tmwa/protocol.h"
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 512ef6e44..c687739e2 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -32,7 +32,6 @@
#include "net/character.h"
#include "net/logindata.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
#include "net/tmwa/attrs.h"
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index c2ffca0e3..73e651da2 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -30,7 +30,6 @@
#include "gui/windows/chatwindow.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
#include "net/tmwa/messageout.h"
@@ -282,7 +281,7 @@ void ChatHandler::battleTalk(const std::string &text A_UNUSED) const
void ChatHandler::processChat(Net::MessageIn &msg)
{
BLOCK_START("ChatHandler::processChat")
- int chatMsgLength = msg.readInt16("len") - 4;
+ const int chatMsgLength = msg.readInt16("len") - 4;
if (chatMsgLength <= 0)
{
BLOCK_END("ChatHandler::processChat")
@@ -295,7 +294,7 @@ void ChatHandler::processChat(Net::MessageIn &msg)
void ChatHandler::processChat2(Net::MessageIn &msg)
{
BLOCK_START("ChatHandler::processChat")
- int chatMsgLength = msg.readInt16("len") - 4 - 3;
+ const int chatMsgLength = msg.readInt16("len") - 4 - 3;
std::string channel;
channel = msg.readUInt8("channel byte 0");
channel += msg.readUInt8("channel byte 1");
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp
index cad7a12dc..c7399e9f1 100644
--- a/src/net/tmwa/gamehandler.cpp
+++ b/src/net/tmwa/gamehandler.cpp
@@ -26,8 +26,6 @@
#include "being/localplayer.h"
-#include "net/net.h"
-
#include "net/tmwa/loginhandler.h"
#include "net/tmwa/messageout.h"
#include "net/tmwa/network.h"
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index 35b25364b..d6ee27680 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -26,7 +26,6 @@
#include "being/localplayer.h"
#include "being/playerinfo.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
#include "net/tmwa/messageout.h"
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index a64efd571..d76f4b990 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -29,7 +29,6 @@
#include "listeners/arrowslistener.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
#include "net/tmwa/messageout.h"
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 4e9120eae..c58e7687e 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -25,7 +25,6 @@
#include "client.h"
#include "logger.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
#include "net/tmwa/messageout.h"
diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp
index 660548bd6..55c42324e 100644
--- a/src/net/tmwa/messagein.cpp
+++ b/src/net/tmwa/messagein.cpp
@@ -27,8 +27,6 @@
#include "logger.h"
-#include "utils/stringutils.h"
-
#include <SDL_endian.h>
#include "debug.h"
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index d7b453058..0cc7c6dbf 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -28,7 +28,6 @@
#include "gui/windows/npcdialog.h"
-#include "net/net.h"
#include "net/serverfeatures.h"
#include "net/tmwa/messageout.h"
diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp
index c5e7f481c..1f278e016 100644
--- a/src/net/tmwa/pethandler.cpp
+++ b/src/net/tmwa/pethandler.cpp
@@ -22,10 +22,10 @@
#include "gui/chatconsts.h"
-#include "net/net.h"
-
#include "net/chathandler.h"
+#include "utils/stringutils.h"
+
#include "debug.h"
extern Net::PetHandler *petHandler;
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 08be2f53a..3c3173d47 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -32,8 +32,6 @@
#include "gui/windows/statuswindow.h"
-#include "net/net.h"
-
#include "net/tmwa/attrs.h"
#include "net/tmwa/inventoryhandler.h"
#include "net/tmwa/messageout.h"
diff --git a/src/net/tmwa/questhandler.cpp b/src/net/tmwa/questhandler.cpp
index fc3f7eee1..995792da0 100644
--- a/src/net/tmwa/questhandler.cpp
+++ b/src/net/tmwa/questhandler.cpp
@@ -23,7 +23,6 @@
#include "gui/windows/skilldialog.h"
#include "gui/windows/questswindow.h"
-#include "net/tmwa/messageout.h"
#include "net/tmwa/protocol.h"
#include "resources/skillconsts.h"
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 5177ac7cb..611a22fc4 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -23,7 +23,7 @@
#include "debug.h"
extern int serverVersion;
-extern int tmwServerVersion;
+extern unsigned int tmwServerVersion;
extern Net::ServerFeatures *serverFeatures;
namespace TmwAthena