diff options
125 files changed, 78 insertions, 259 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index f1c62441d..b2a455a8d 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -67,7 +67,6 @@ #include "net/gamehandler.h" #include "net/ipc.h" #include "net/mercenaryhandler.h" -#include "net/net.h" #include "net/pethandler.h" #include "net/playerhandler.h" #include "net/uploadcharinfo.h" diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 8e210a155..122dd7dbe 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -35,12 +35,11 @@ #include "net/chathandler.h" #include "net/guildhandler.h" -#include "net/net.h" #include "net/partyhandler.h" #include "net/serverfeatures.h" #include "utils/booleanoptions.h" -#include "utils/gettext.h" +#include "utils/stringutils.h" #include "debug.h" @@ -261,7 +260,8 @@ impHandler(createParty) if (event.args.empty()) { // TRANSLATORS: create party message - event.tab->chatLog(_("Party name is missing."), ChatMsgType::BY_SERVER); + event.tab->chatLog(_("Party name is missing."), + ChatMsgType::BY_SERVER); } else { @@ -278,7 +278,8 @@ impHandler(createGuild) if (event.args.empty()) { // TRANSLATORS: create guild message - event.tab->chatLog(_("Guild name is missing."), ChatMsgType::BY_SERVER); + event.tab->chatLog(_("Guild name is missing."), + ChatMsgType::BY_SERVER); } else { @@ -299,7 +300,8 @@ impHandler(party) else { // TRANSLATORS: party invite message - event.tab->chatLog(_("Please specify a name."), ChatMsgType::BY_SERVER); + event.tab->chatLog(_("Please specify a name."), + ChatMsgType::BY_SERVER); } return true; } diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 5b3e4c69a..4f3e05f86 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -41,7 +41,6 @@ #include "net/chathandler.h" #include "net/guildhandler.h" #include "net/homunculushandler.h" -#include "net/net.h" #include "net/pethandler.h" #include "net/serverfeatures.h" diff --git a/src/actions/move.cpp b/src/actions/move.cpp index cc4c27b6c..0fa4d4897 100644 --- a/src/actions/move.cpp +++ b/src/actions/move.cpp @@ -30,7 +30,6 @@ #include "gui/windows/npcdialog.h" #include "gui/windows/outfitwindow.h" -#include "net/net.h" #include "net/playerhandler.h" #include "debug.h" diff --git a/src/actormanager.cpp b/src/actormanager.cpp index 18f9ff211..a27cd0f34 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -38,7 +38,6 @@ #include "gui/windows/botcheckerwindow.h" #include "gui/windows/chatwindow.h" #include "gui/windows/equipmentwindow.h" -#include "gui/windows/skilldialog.h" #include "gui/windows/socialwindow.h" #include "gui/windows/questswindow.h" @@ -49,7 +48,6 @@ #include "net/beinghandler.h" #include "net/charserverhandler.h" -#include "net/net.h" #include "net/packetlimiter.h" #include "net/playerhandler.h" diff --git a/src/auctionmanager.cpp b/src/auctionmanager.cpp index b9029c25c..38def08c7 100644 --- a/src/auctionmanager.cpp +++ b/src/auctionmanager.cpp @@ -24,7 +24,6 @@ #include "configuration.h" #include "net/chathandler.h" -#include "net/net.h" #include "debug.h" diff --git a/src/being/being.cpp b/src/being/being.cpp index 2626ca13a..0779be63b 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -25,7 +25,6 @@ #include "actormanager.h" #include "animatedsprite.h" #include "beingequipbackend.h" -#include "client.h" #include "configuration.h" #include "effectmanager.h" #include "guild.h" @@ -56,7 +55,6 @@ #include "net/charserverhandler.h" #include "net/gamehandler.h" -#include "net/net.h" #include "net/npchandler.h" #include "net/packetlimiter.h" #include "net/pethandler.h" diff --git a/src/being/homunculusinfo.h b/src/being/homunculusinfo.h index 1f644c404..23e64f3bf 100644 --- a/src/being/homunculusinfo.h +++ b/src/being/homunculusinfo.h @@ -21,6 +21,8 @@ #ifndef BEING_HOMUNCULUSINFO_H #define BEING_HOMUNCULUSINFO_H +#include <string> + #include "localconsts.h" struct HomunculusInfo final diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 819032af7..3f775b321 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -24,7 +24,6 @@ #include "actormanager.h" #include "animatedsprite.h" -#include "client.h" #include "configuration.h" #include "dropshortcut.h" #include "gamemodifiers.h" @@ -64,7 +63,6 @@ #include "net/beinghandler.h" #include "net/chathandler.h" #include "net/inventoryhandler.h" -#include "net/net.h" #include "net/packetlimiter.h" #include "net/pethandler.h" #include "net/playerhandler.h" diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index 07696b66c..359069471 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -42,7 +42,6 @@ #include "net/homunculushandler.h" #include "net/inventoryhandler.h" #include "net/mercenaryhandler.h" -#include "net/net.h" #include "net/playerhandler.h" #include "utils/delete2.h" diff --git a/src/beingequipbackend.cpp b/src/beingequipbackend.cpp index e6b618ade..f6d50ea64 100644 --- a/src/beingequipbackend.cpp +++ b/src/beingequipbackend.cpp @@ -23,7 +23,6 @@ #include "being/being.h" #include "net/inventoryhandler.h" -#include "net/net.h" #include "utils/delete2.h" diff --git a/src/flooritem.cpp b/src/flooritem.cpp index ae88c41b8..369dfd704 100644 --- a/src/flooritem.cpp +++ b/src/flooritem.cpp @@ -37,7 +37,6 @@ #include "resources/map/map.h" -#include "net/net.h" #include "net/serverfeatures.h" #include "debug.h" diff --git a/src/game.cpp b/src/game.cpp index de6282cdc..9835d242e 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -95,7 +95,6 @@ #include "net/generalhandler.h" #include "net/gamehandler.h" -#include "net/net.h" #include "net/packetcounters.h" #include "net/serverfeatures.h" diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp index 28c3ae616..0b515c2f3 100644 --- a/src/gui/dialogsmanager.cpp +++ b/src/gui/dialogsmanager.cpp @@ -37,7 +37,6 @@ #include "gui/windows/updaterwindow.h" #include "net/inventoryhandler.h" -#include "net/net.h" #include "utils/gettext.h" diff --git a/src/gui/models/typelistmodel.h b/src/gui/models/typelistmodel.h index bd27fce39..7a50c6905 100644 --- a/src/gui/models/typelistmodel.h +++ b/src/gui/models/typelistmodel.h @@ -60,13 +60,14 @@ class TypeListModel final : public ListModel else if (elementIndex == 2) return "eAthena"; #endif // EATHENA_SUPPORT + else #else // TMWA_SUPPORT #ifdef EATHENA_SUPPORT if (elementIndex == 0) return "eAthena"; + else #endif // EATHENA_SUPPORT #endif // TMWA_SUPPORT - else return "Unknown"; } }; diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp index cf471ba3e..b241a057f 100644 --- a/src/gui/popups/itempopup.cpp +++ b/src/gui/popups/itempopup.cpp @@ -41,7 +41,6 @@ #include "resources/iteminfo.h" #include "resources/resourcemanager.h" -#include "net/net.h" #include "net/serverfeatures.h" #include "debug.h" diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 91c09002b..4771e4209 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -73,7 +73,6 @@ #include "net/homunculushandler.h" #include "net/inventoryhandler.h" #include "net/mercenaryhandler.h" -#include "net/net.h" #include "net/npchandler.h" #include "net/partyhandler.h" #include "net/pethandler.h" diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 73cb5b884..ed717af4f 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -816,14 +816,12 @@ void Viewport::mouseMoved(MouseEvent &event A_UNUSED) switch (type) { case ActorType::Npc: - gui->setCursorType(mHoverBeing->getHoverCursor()); - break; - case ActorType::Monster: - gui->setCursorType(mHoverBeing->getHoverCursor()); - break; - case ActorType::Portal: + case ActorType::LocalPet: + case ActorType::Pet: + case ActorType::Mercenary: + case ActorType::Homunculus: gui->setCursorType(mHoverBeing->getHoverCursor()); break; @@ -831,7 +829,6 @@ void Viewport::mouseMoved(MouseEvent &event A_UNUSED) case ActorType::FloorItem: case ActorType::Unknown: case ActorType::Player: - case ActorType::LocalPet: default: gui->setCursorType(Cursor::CURSOR_POINTER); break; diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 1d18c3e2e..0ea19ea59 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -41,11 +41,11 @@ #include "gui/windows/shopwindow.h" #include "gui/windows/shortcutwindow.h" -#include "net/net.h" #include "net/inventoryhandler.h" #include "net/tradehandler.h" #include "utils/gettext.h" +#include "utils/stringutils.h" #include "resources/image.h" #include "resources/iteminfo.h" diff --git a/src/gui/widgets/selldialog.cpp b/src/gui/widgets/selldialog.cpp index 611850398..2d45c39f8 100644 --- a/src/gui/widgets/selldialog.cpp +++ b/src/gui/widgets/selldialog.cpp @@ -25,11 +25,7 @@ #include "shopitem.h" #include "units.h" -#include "being/playerinfo.h" - -#include "gui/windows/confirmdialog.h" #include "gui/windows/setupwindow.h" -#include "gui/windows/tradewindow.h" #include "gui/models/shopitems.h" @@ -42,14 +38,9 @@ #include "gui/widgets/shoplistbox.h" #include "gui/widgets/slider.h" -#include "net/buysellhandler.h" -#include "net/net.h" -#include "net/npchandler.h" - -#include "resources/iteminfo.h" - #include "utils/delete2.h" #include "utils/gettext.h" +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp index 54d675a85..fe4bd9187 100644 --- a/src/gui/widgets/tabs/chattab.cpp +++ b/src/gui/widgets/tabs/chattab.cpp @@ -45,7 +45,6 @@ #include "input/inputmanager.h" #include "net/chathandler.h" -#include "net/net.h" #include "resources/iteminfo.h" diff --git a/src/gui/widgets/tabs/whispertab.cpp b/src/gui/widgets/tabs/whispertab.cpp index 6c89a887b..03b90ca18 100644 --- a/src/gui/widgets/tabs/whispertab.cpp +++ b/src/gui/widgets/tabs/whispertab.cpp @@ -27,12 +27,13 @@ #include "being/localplayer.h" #include "net/chathandler.h" -#include "net/net.h" #include "gui/windows/chatwindow.h" #include "gui/widgets/windowcontainer.h" +#include "utils/stringutils.h" + #include "debug.h" WhisperTab::WhisperTab(const Widget2 *const widget, diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 0bd452c1b..dbc6dd59b 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -45,7 +45,6 @@ #include "net/adminhandler.h" #include "net/buysellhandler.h" -#include "net/net.h" #include "net/npchandler.h" #include "resources/iteminfo.h" diff --git a/src/gui/windows/buyselldialog.cpp b/src/gui/windows/buyselldialog.cpp index 701eb96bc..2de5841bc 100644 --- a/src/gui/windows/buyselldialog.cpp +++ b/src/gui/windows/buyselldialog.cpp @@ -23,7 +23,6 @@ #include "gui/windows/buyselldialog.h" #include "net/buysellhandler.h" -#include "net/net.h" #include "net/npchandler.h" #include "gui/windows/setupwindow.h" diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp index 408fdf9d4..d099c73fe 100644 --- a/src/gui/windows/changeemaildialog.cpp +++ b/src/gui/windows/changeemaildialog.cpp @@ -36,7 +36,6 @@ #include "net/logindata.h" #include "net/loginhandler.h" -#include "net/net.h" #include "utils/delete2.h" #include "utils/gettext.h" diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp index a5f97becb..cc8ca77a6 100644 --- a/src/gui/windows/changepassworddialog.cpp +++ b/src/gui/windows/changepassworddialog.cpp @@ -37,7 +37,6 @@ #include "net/logindata.h" #include "net/loginhandler.h" -#include "net/net.h" #include "utils/delete2.h" #include "utils/gettext.h" diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index def290047..b34f8f50a 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -40,7 +40,6 @@ #include "gui/widgets/slider.h" #include "gui/widgets/textfield.h" -#include "net/net.h" #include "net/serverfeatures.h" #include "resources/iteminfo.h" @@ -51,6 +50,7 @@ #include "utils/delete2.h" #include "utils/gettext.h" +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index e2211d3fb..b9d8e4cd6 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -52,7 +52,6 @@ #include "net/character.h" #include "net/logindata.h" #include "net/loginhandler.h" -#include "net/net.h" #include "net/registrationoptions.h" #include "debug.h" diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index bf839e058..7b497e747 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -68,7 +68,6 @@ #include "net/chathandler.h" #include "net/playerhandler.h" -#include "net/net.h" #include "utils/copynpaste.h" #include "utils/delete2.h" diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 3dd7dd72b..5e5997985 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -223,6 +223,7 @@ void EditServerDialog::action(const ActionEvent &event) mPortField->getText().c_str())); mServer.persistentIp = mPersistentIp->isSelected(); +#if defined(TMWA_SUPPORT) || defined(EATHENA_SUPPORT) if (mTypeField) { switch (mTypeField->getSelected()) @@ -252,6 +253,7 @@ void EditServerDialog::action(const ActionEvent &event) } } else +#endif // defined(TMWA_SUPPORT) || defined(EATHENA_SUPPORT) { mServer.type = ServerInfo::TMWATHENA; } diff --git a/src/gui/windows/eggselectiondialog.cpp b/src/gui/windows/eggselectiondialog.cpp index b4149b6b3..0f3ad1c0b 100644 --- a/src/gui/windows/eggselectiondialog.cpp +++ b/src/gui/windows/eggselectiondialog.cpp @@ -23,24 +23,11 @@ #include "gui/windows/eggselectiondialog.h" #include "shopitem.h" -#include "units.h" - -#include "being/playerinfo.h" - -#include "gui/windows/confirmdialog.h" -#include "gui/windows/setupwindow.h" -#include "gui/windows/tradewindow.h" #include "gui/models/shopitems.h" #include "gui/widgets/button.h" -#include "gui/widgets/containerplacer.h" -#include "gui/widgets/label.h" -#include "gui/widgets/layout.h" -#include "gui/widgets/layouttype.h" -#include "gui/widgets/scrollarea.h" #include "gui/widgets/shoplistbox.h" -#include "gui/widgets/slider.h" #include "net/inventoryhandler.h" @@ -72,7 +59,7 @@ void EggSelectionDialog::sellAction(const ActionEvent &event A_UNUSED) return; const int selectedItem = mShopItemList->getSelected(); - ShopItem *const item = mShopItems->at(selectedItem); + const ShopItem *const item = mShopItems->at(selectedItem); if (!item) return; inventoryHandler->selectEgg(item); diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index e44f9e087..390b0400b 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -58,7 +58,6 @@ #include "gui/widgets/textfield.h" #include "net/inventoryhandler.h" -#include "net/net.h" #include "resources/iteminfo.h" diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 86cfd973c..03bb4feb1 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -30,7 +30,6 @@ #include "input/keyboardconfig.h" #include "net/inventoryhandler.h" -#include "net/net.h" #include "gui/viewport.h" #include "gui/models/itemsmodel.h" diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index 0b642f224..8f6256616 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -45,7 +45,6 @@ #include "net/charserverhandler.h" #include "net/loginhandler.h" -#include "net/net.h" #include "utils/delete2.h" #include "utils/paths.h" diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index e242b7401..815639e67 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -333,6 +333,9 @@ void Minimap::draw(Graphics *graphics) case ActorType::FloorItem: case ActorType::Portal: case ActorType::LocalPet: + case ActorType::Pet: + case ActorType::Mercenary: + case ActorType::Homunculus: default: continue; } diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index a02ea3f1e..dcf60d021 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -41,7 +41,6 @@ #include "gui/widgets/progressbar.h" -#include "net/net.h" #include "net/playerhandler.h" #include "net/gamehandler.h" diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index b9917461b..cca950a66 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -57,7 +57,6 @@ #include "resources/db/avatardb.h" #include "resources/db/npcdb.h" -#include "net/net.h" #include "net/npchandler.h" #include "net/packetlimiter.h" diff --git a/src/gui/windows/npcpostdialog.cpp b/src/gui/windows/npcpostdialog.cpp index b037c718e..dfd8b7041 100644 --- a/src/gui/windows/npcpostdialog.cpp +++ b/src/gui/windows/npcpostdialog.cpp @@ -32,7 +32,6 @@ #include "gui/widgets/tabs/chattab.h" -#include "net/net.h" #include "net/npchandler.h" #include "utils/gettext.h" diff --git a/src/gui/windows/npcselldialog.cpp b/src/gui/windows/npcselldialog.cpp index 2e4cd6d07..517c97320 100644 --- a/src/gui/windows/npcselldialog.cpp +++ b/src/gui/windows/npcselldialog.cpp @@ -23,33 +23,22 @@ #include "gui/windows/npcselldialog.h" #include "shopitem.h" -#include "units.h" #include "being/playerinfo.h" #include "gui/windows/confirmdialog.h" -#include "gui/windows/setupwindow.h" -#include "gui/windows/tradewindow.h" #include "gui/models/shopitems.h" -#include "gui/widgets/button.h" -#include "gui/widgets/containerplacer.h" -#include "gui/widgets/label.h" -#include "gui/widgets/layout.h" -#include "gui/widgets/layouttype.h" -#include "gui/widgets/scrollarea.h" #include "gui/widgets/shoplistbox.h" #include "gui/widgets/slider.h" -#include "net/buysellhandler.h" -#include "net/net.h" #include "net/npchandler.h" #include "resources/iteminfo.h" -#include "utils/delete2.h" #include "utils/gettext.h" +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp index f5481070a..c5cd311a3 100644 --- a/src/gui/windows/quitdialog.cpp +++ b/src/gui/windows/quitdialog.cpp @@ -40,7 +40,6 @@ #include "net/charserverhandler.h" #include "net/gamehandler.h" -#include "net/net.h" #include "resources/map/map.h" diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index 4c582d9f2..3b4ee0539 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -43,7 +43,6 @@ #include "net/logindata.h" #include "net/loginhandler.h" -#include "net/net.h" #include "net/registrationoptions.h" #include "net/serverfeatures.h" diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 23a066ade..30b4e600e 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -28,8 +28,6 @@ #include "main.h" #include "settings.h" -#include "events/keyevent.h" - #include "input/inputaction.h" #include "net/download.h" diff --git a/src/gui/windows/shopselldialog.cpp b/src/gui/windows/shopselldialog.cpp index a48a83b75..c988c2418 100644 --- a/src/gui/windows/shopselldialog.cpp +++ b/src/gui/windows/shopselldialog.cpp @@ -23,33 +23,16 @@ #include "gui/windows/shopselldialog.h" #include "shopitem.h" -#include "units.h" #include "being/playerinfo.h" -#include "gui/windows/confirmdialog.h" -#include "gui/windows/setupwindow.h" #include "gui/windows/tradewindow.h" #include "gui/models/shopitems.h" -#include "gui/widgets/button.h" -#include "gui/widgets/containerplacer.h" -#include "gui/widgets/label.h" -#include "gui/widgets/layout.h" -#include "gui/widgets/layouttype.h" -#include "gui/widgets/scrollarea.h" #include "gui/widgets/shoplistbox.h" -#include "gui/widgets/slider.h" #include "net/buysellhandler.h" -#include "net/net.h" -#include "net/npchandler.h" - -#include "resources/iteminfo.h" - -#include "utils/delete2.h" -#include "utils/gettext.h" #include "debug.h" diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 8e5a847c0..540d5f65a 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -57,7 +57,6 @@ #include "being/playerinfo.h" #include "being/playerrelations.h" -#include "net/net.h" #include "net/chathandler.h" #include "net/tradehandler.h" diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 0fa3e6bbb..5ae89301a 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -42,7 +42,6 @@ #include "gui/widgets/tabs/skilltab.h" -#include "net/net.h" #include "net/playerhandler.h" #include "net/skillhandler.h" diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 6407e8fa6..513337767 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -52,7 +52,6 @@ #include "gui/popups/createpartypopup.h" -#include "net/net.h" #include "net/serverfeatures.h" #include "debug.h" diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index 072e915ee..b2825c1e7 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -50,7 +50,6 @@ #include "gui/widgets/vertcontainer.h" #include "gui/widgets/windowcontainer.h" -#include "net/net.h" #include "net/playerhandler.h" #include "net/gamehandler.h" diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 7f6e78a9b..857ace024 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -51,7 +51,6 @@ #include "gui/widgets/tabs/chattab.h" -#include "net/net.h" #include "net/tradehandler.h" #include "utils/gettext.h" diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp index 018b583fa..c4e8c8167 100644 --- a/src/gui/windows/unregisterdialog.cpp +++ b/src/gui/windows/unregisterdialog.cpp @@ -36,7 +36,6 @@ #include "net/logindata.h" #include "net/loginhandler.h" -#include "net/net.h" #include "utils/delete2.h" #include "utils/gettext.h" diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 4216303e5..12d1297d5 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -47,7 +47,6 @@ #include "being/playerrelations.h" #include "net/download.h" -#include "net/net.h" #include "net/packetlimiter.h" #include "net/playerhandler.h" #include "net/serverfeatures.h" diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp index 7cfb0319b..61bff8987 100644 --- a/src/gui/windows/worldselectdialog.cpp +++ b/src/gui/windows/worldselectdialog.cpp @@ -35,7 +35,6 @@ #include "gui/models/worldlistmodel.h" #include "net/loginhandler.h" -#include "net/net.h" #include "utils/delete2.h" #include "utils/gettext.h" diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp index 446e55801..bfc6ab1d8 100644 --- a/src/guildmanager.cpp +++ b/src/guildmanager.cpp @@ -34,7 +34,6 @@ #include "gui/widgets/tabs/guildchattab.h" #include "net/chathandler.h" -#include "net/net.h" #include "net/packetlimiter.h" #include "utils/delete2.h" diff --git a/src/inventory.cpp b/src/inventory.cpp index b4a30d0a8..6656f2266 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -26,7 +26,6 @@ #include "logger.h" #include "net/inventoryhandler.h" -#include "net/net.h" #include "resources/iteminfo.h" @@ -34,6 +33,7 @@ #include "utils/delete2.h" #include "utils/gettext.h" +#include "utils/stringutils.h" #include <algorithm> #include <functional> diff --git a/src/item.cpp b/src/item.cpp index b8c2194f3..8b9253822 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -31,7 +31,6 @@ #include "resources/resourcemanager.h" #include "configuration.h" -#include "net/net.h" #include "net/serverfeatures.h" #include "debug.h" diff --git a/src/listeners/pincodelistener.cpp b/src/listeners/pincodelistener.cpp index 12b1e98e2..cc17025bd 100644 --- a/src/listeners/pincodelistener.cpp +++ b/src/listeners/pincodelistener.cpp @@ -21,7 +21,6 @@ #include "listeners/pincodelistener.h" #include "net/charserverhandler.h" -#include "net/net.h" #include "gui/windows/editdialog.h" 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 diff --git a/src/notifymanager.cpp b/src/notifymanager.cpp index 3ec039260..08245dcd9 100644 --- a/src/notifymanager.cpp +++ b/src/notifymanager.cpp @@ -28,7 +28,6 @@ #include "gui/widgets/tabs/chattab.h" #include "net/guildhandler.h" -#include "net/net.h" #include "net/partyhandler.h" #include "resources/notifications.h" @@ -36,6 +35,8 @@ #include "resources/db/sounddb.h" +#include "utils/stringutils.h" + #include "debug.h" namespace NotifyManager diff --git a/src/particle/textparticle.cpp b/src/particle/textparticle.cpp index 12942fa4c..823dcec5e 100644 --- a/src/particle/textparticle.cpp +++ b/src/particle/textparticle.cpp @@ -26,8 +26,6 @@ #include "gui/theme.h" -#include "gui/color.h" - #include "gui/fonts/font.h" #include "debug.h" diff --git a/src/resources/beingcommon.cpp b/src/resources/beingcommon.cpp index 4b685f8bf..4f5bee935 100644 --- a/src/resources/beingcommon.cpp +++ b/src/resources/beingcommon.cpp @@ -24,7 +24,6 @@ #include "logger.h" #include "utils/files.h" -#include "utils/stringutils.h" #include "resources/beinginfo.h" #include "resources/spritereference.h" @@ -69,7 +68,7 @@ void BeingCommon::getIncludeFiles(const std::string &dir, std::sort(list.begin(), list.end()); } -bool BeingCommon::readObjectNodes(XmlNodePtr &spriteNode, +bool BeingCommon::readObjectNodes(XmlNodePtrConst &spriteNode, SpriteDisplay &display, BeingInfo *const currentInfo, const std::string &dbName) diff --git a/src/resources/beingcommon.h b/src/resources/beingcommon.h index 301dc284e..da5de53a4 100644 --- a/src/resources/beingcommon.h +++ b/src/resources/beingcommon.h @@ -58,10 +58,10 @@ namespace BeingCommon StringVect &list, const std::string &ext); - bool readObjectNodes(XmlNodePtr &node, + bool readObjectNodes(XmlNodePtrConst &spriteNode, SpriteDisplay &display, BeingInfo *const currentInfo, const std::string &dbName); -} +} // namespace BeingCommon #endif // RESOURCES_BEINGCOMMON_H diff --git a/src/resources/db/homunculusdb.cpp b/src/resources/db/homunculusdb.cpp index 317d0c2df..291fa8262 100644 --- a/src/resources/db/homunculusdb.cpp +++ b/src/resources/db/homunculusdb.cpp @@ -26,12 +26,10 @@ #include "resources/beingcommon.h" #include "resources/beinginfo.h" -#include "resources/spritereference.h" #include "resources/map/blockmask.h" #include "utils/dtor.h" -#include "utils/gettext.h" #include "configuration.h" @@ -76,7 +74,8 @@ void HomunculusDB::loadXmlFile(const std::string &fileName) { if (xmlNameEqual(homunculusNode, "include")) { - const std::string name = XML::getProperty(homunculusNode, "name", ""); + const std::string name = XML::getProperty( + homunculusNode, "name", ""); if (!name.empty()) loadXmlFile(name); continue; @@ -95,7 +94,8 @@ void HomunculusDB::loadXmlFile(const std::string &fileName) currentInfo = new BeingInfo; currentInfo->setBlockType(BlockType::MONSTER); - BeingCommon::readBasicAttributes(currentInfo, homunculusNode, "attack"); + BeingCommon::readBasicAttributes(currentInfo, + homunculusNode, "attack"); currentInfo->setMaxHP(XML::getProperty(homunculusNode, "maxHP", 0)); diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index b50fc3944..f4e4116ac 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -35,7 +35,6 @@ #include "resources/db/itemdbstat.h" -#include "net/net.h" #include "net/serverfeatures.h" #include "utils/delete2.h" diff --git a/src/resources/db/mercenarydb.cpp b/src/resources/db/mercenarydb.cpp index 432b64006..f1fb26a64 100644 --- a/src/resources/db/mercenarydb.cpp +++ b/src/resources/db/mercenarydb.cpp @@ -26,12 +26,10 @@ #include "resources/beingcommon.h" #include "resources/beinginfo.h" -#include "resources/spritereference.h" #include "resources/map/blockmask.h" #include "utils/dtor.h" -#include "utils/gettext.h" #include "configuration.h" @@ -76,7 +74,8 @@ void MercenaryDB::loadXmlFile(const std::string &fileName) { if (xmlNameEqual(mercenaryNode, "include")) { - const std::string name = XML::getProperty(mercenaryNode, "name", ""); + const std::string name = XML::getProperty( + mercenaryNode, "name", ""); if (!name.empty()) loadXmlFile(name); continue; diff --git a/src/resources/db/monsterdb.cpp b/src/resources/db/monsterdb.cpp index 1cbfe66c5..1021804a5 100644 --- a/src/resources/db/monsterdb.cpp +++ b/src/resources/db/monsterdb.cpp @@ -26,7 +26,6 @@ #include "resources/beingcommon.h" #include "resources/beinginfo.h" -#include "resources/spritereference.h" #include "resources/map/blockmask.h" diff --git a/src/shopitem.cpp b/src/shopitem.cpp index 386583170..ecb129112 100644 --- a/src/shopitem.cpp +++ b/src/shopitem.cpp @@ -28,7 +28,6 @@ #include "utils/stringutils.h" -#include "net/net.h" #include "net/serverfeatures.h" #include "debug.h" diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index b569ba7eb..fbf372de7 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -30,7 +30,6 @@ #include "gui/windows/chatwindow.h" -#include "net/net.h" #include "net/playerhandler.h" #include "utils/dtor.h" diff --git a/src/utils/chatutils.cpp b/src/utils/chatutils.cpp index 1bc08ad4e..d03cdd764 100644 --- a/src/utils/chatutils.cpp +++ b/src/utils/chatutils.cpp @@ -33,10 +33,11 @@ #include "net/chathandler.h" #include "net/guildhandler.h" -#include "net/net.h" #include "net/partyhandler.h" #include "net/serverfeatures.h" +#include "utils/stringutils.h" + #include "debug.h" void outStringNormal(ChatTab *const tab, |