summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/adminhandler.h2
-rw-r--r--src/net/tmwa/beinghandler.h2
-rw-r--r--src/net/tmwa/buysellhandler.h2
-rw-r--r--src/net/tmwa/charserverhandler.cpp14
-rw-r--r--src/net/tmwa/charserverhandler.h2
-rw-r--r--src/net/tmwa/chathandler.h5
-rw-r--r--src/net/tmwa/gamehandler.cpp2
-rw-r--r--src/net/tmwa/gamehandler.h5
-rw-r--r--src/net/tmwa/generalhandler.cpp15
-rw-r--r--src/net/tmwa/generalhandler.h2
-rw-r--r--src/net/tmwa/guildhandler.h2
-rw-r--r--src/net/tmwa/inventoryhandler.h8
-rw-r--r--src/net/tmwa/itemhandler.h2
-rw-r--r--src/net/tmwa/loginhandler.h2
-rw-r--r--src/net/tmwa/npchandler.h6
-rw-r--r--src/net/tmwa/partyhandler.h2
-rw-r--r--src/net/tmwa/playerhandler.h2
-rw-r--r--src/net/tmwa/specialhandler.h2
-rw-r--r--src/net/tmwa/tradehandler.h2
19 files changed, 34 insertions, 45 deletions
diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h
index ce74fd8d..17d547a8 100644
--- a/src/net/tmwa/adminhandler.h
+++ b/src/net/tmwa/adminhandler.h
@@ -29,7 +29,7 @@
namespace TmwAthena {
-class AdminHandler : public MessageHandler, public Net::AdminHandler
+class AdminHandler final : public MessageHandler, public Net::AdminHandler
{
public:
AdminHandler();
diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h
index 1ec1583c..f1c8887f 100644
--- a/src/net/tmwa/beinghandler.h
+++ b/src/net/tmwa/beinghandler.h
@@ -26,7 +26,7 @@
namespace TmwAthena {
-class BeingHandler : public MessageHandler
+class BeingHandler final : public MessageHandler
{
public:
BeingHandler(bool enableSync);
diff --git a/src/net/tmwa/buysellhandler.h b/src/net/tmwa/buysellhandler.h
index 6e22b4af..8f7a324f 100644
--- a/src/net/tmwa/buysellhandler.h
+++ b/src/net/tmwa/buysellhandler.h
@@ -28,7 +28,7 @@ class BuyDialog;
namespace TmwAthena {
-class BuySellHandler : public MessageHandler
+class BuySellHandler final : public MessageHandler
{
public:
BuySellHandler();
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index d6b1f5a0..636b58ce 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -74,7 +74,7 @@ void CharServerHandler::handleMessage(MessageIn &msg)
{
switch (msg.getId())
{
- case SMSG_CHAR_LOGIN:
+ case SMSG_CHAR_LOGIN:
{
msg.skip(2); // Length word
msg.skip(20); // Unused
@@ -280,12 +280,12 @@ void CharServerHandler::setCharCreateDialog(CharCreateDialog *window)
return;
std::vector<std::string> attributes;
- attributes.push_back(_("Strength:"));
- attributes.push_back(_("Agility:"));
- attributes.push_back(_("Vitality:"));
- attributes.push_back(_("Intelligence:"));
- attributes.push_back(_("Dexterity:"));
- attributes.push_back(_("Luck:"));
+ attributes.emplace_back(_("Strength:"));
+ attributes.emplace_back(_("Agility:"));
+ attributes.emplace_back(_("Vitality:"));
+ attributes.emplace_back(_("Intelligence:"));
+ attributes.emplace_back(_("Dexterity:"));
+ attributes.emplace_back(_("Luck:"));
const Token &token =
static_cast<LoginHandler*>(Net::getLoginHandler())->getToken();
diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h
index c8ba4f6f..9633c8d9 100644
--- a/src/net/tmwa/charserverhandler.h
+++ b/src/net/tmwa/charserverhandler.h
@@ -34,7 +34,7 @@ namespace TmwAthena {
/**
* Deals with incoming messages from the character server.
*/
-class CharServerHandler : public MessageHandler, public Net::CharHandler
+class CharServerHandler final : public MessageHandler, public Net::CharHandler
{
public:
CharServerHandler();
diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h
index a21692c9..9f838b2c 100644
--- a/src/net/tmwa/chathandler.h
+++ b/src/net/tmwa/chathandler.h
@@ -31,7 +31,7 @@
namespace TmwAthena {
-class ChatHandler : public MessageHandler, public Net::ChatHandler
+class ChatHandler final : public MessageHandler, public Net::ChatHandler
{
public:
ChatHandler();
@@ -67,8 +67,7 @@ class ChatHandler : public MessageHandler, public Net::ChatHandler
bool whoSupported() const override { return false; }
private:
- using WhisperQueue = std::queue<std::string>;
- WhisperQueue mSentWhispers;
+ std::queue<std::string> mSentWhispers;
};
} // namespace TmwAthena
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp
index 6f276e66..dc0644e9 100644
--- a/src/net/tmwa/gamehandler.cpp
+++ b/src/net/tmwa/gamehandler.cpp
@@ -161,7 +161,7 @@ void GameHandler::quit()
MessageOut outMsg(CMSG_CLIENT_QUIT);
}
-void GameHandler::setMap(const std::string map)
+void GameHandler::setMap(const std::string &map)
{
mMap = map.substr(0, map.rfind("."));
}
diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h
index d1722669..ecd8df2d 100644
--- a/src/net/tmwa/gamehandler.h
+++ b/src/net/tmwa/gamehandler.h
@@ -26,14 +26,13 @@
#include "net/gamehandler.h"
#include "net/net.h"
-#include "net/serverinfo.h"
#include "net/tmwa/messagehandler.h"
#include "net/tmwa/token.h"
namespace TmwAthena {
-class GameHandler : public MessageHandler, public Net::GameHandler,
+class GameHandler final : public MessageHandler, public Net::GameHandler,
public EventListener
{
public:
@@ -55,7 +54,7 @@ class GameHandler : public MessageHandler, public Net::GameHandler,
void clear();
- void setMap(const std::string map);
+ void setMap(const std::string &map);
/** The tmwAthena protocol is making use of the MP status bar. */
bool canUseMagicBar() const override { return true; }
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 4053e17c..832d6973 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -25,9 +25,7 @@
#include "configuration.h"
#include "log.h"
-#include "gui/charselectdialog.h"
#include "gui/inventorywindow.h"
-#include "gui/register.h"
#include "gui/skilldialog.h"
#include "gui/socialwindow.h"
#include "gui/statuswindow.h"
@@ -57,7 +55,6 @@
#include "net/tmwa/gui/guildtab.h"
#include "net/tmwa/gui/partytab.h"
-#include "resources/attributes.h"
#include "resources/itemdb.h"
#include "utils/gettext.h"
@@ -99,12 +96,12 @@ GeneralHandler::GeneralHandler():
generalHandler = this;
std::list<ItemStat> stats;
- stats.push_back(ItemStat("str", _("Strength %+d")));
- stats.push_back(ItemStat("agi", _("Agility %+d")));
- stats.push_back(ItemStat("vit", _("Vitality %+d")));
- stats.push_back(ItemStat("int", _("Intelligence %+d")));
- stats.push_back(ItemStat("dex", _("Dexterity %+d")));
- stats.push_back(ItemStat("luck", _("Luck %+d")));
+ stats.emplace_back("str", _("Strength %+d"));
+ stats.emplace_back("agi", _("Agility %+d"));
+ stats.emplace_back("vit", _("Vitality %+d"));
+ stats.emplace_back("int", _("Intelligence %+d"));
+ stats.emplace_back("dex", _("Dexterity %+d"));
+ stats.emplace_back("luck", _("Luck %+d"));
setStatsList(stats);
diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h
index 22c6b650..f105da96 100644
--- a/src/net/tmwa/generalhandler.h
+++ b/src/net/tmwa/generalhandler.h
@@ -31,7 +31,7 @@
namespace TmwAthena {
-class GeneralHandler : public MessageHandler, public Net::GeneralHandler,
+class GeneralHandler final : public MessageHandler, public Net::GeneralHandler,
public EventListener
{
public:
diff --git a/src/net/tmwa/guildhandler.h b/src/net/tmwa/guildhandler.h
index 4cbdd286..9bbe9b4a 100644
--- a/src/net/tmwa/guildhandler.h
+++ b/src/net/tmwa/guildhandler.h
@@ -27,7 +27,7 @@
namespace TmwAthena {
-class GuildHandler : public Net::GuildHandler, public MessageHandler
+class GuildHandler final : public Net::GuildHandler, public MessageHandler
{
public:
GuildHandler();
diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h
index 6bf11f54..2df5a699 100644
--- a/src/net/tmwa/inventoryhandler.h
+++ b/src/net/tmwa/inventoryhandler.h
@@ -43,7 +43,7 @@
namespace TmwAthena {
-class EquipBackend : public Equipment::Backend
+class EquipBackend final : public Equipment::Backend
{
public:
EquipBackend()
@@ -160,9 +160,7 @@ class InventoryItem
}
};
-using InventoryItems = std::list<InventoryItem>;
-
-class InventoryHandler : public MessageHandler, public Net::InventoryHandler,
+class InventoryHandler final : public MessageHandler, public Net::InventoryHandler,
public EventListener
{
public:
@@ -197,7 +195,7 @@ class InventoryHandler : public MessageHandler, public Net::InventoryHandler,
private:
EquipBackend mEquips;
- InventoryItems mInventoryItems;
+ std::list<InventoryItem> mInventoryItems;
Inventory *mStorage;
InventoryWindow *mStorageWindow;
};
diff --git a/src/net/tmwa/itemhandler.h b/src/net/tmwa/itemhandler.h
index 29ed8246..0c6175d8 100644
--- a/src/net/tmwa/itemhandler.h
+++ b/src/net/tmwa/itemhandler.h
@@ -26,7 +26,7 @@
namespace TmwAthena {
-class ItemHandler : public MessageHandler
+class ItemHandler final : public MessageHandler
{
public:
ItemHandler();
diff --git a/src/net/tmwa/loginhandler.h b/src/net/tmwa/loginhandler.h
index 4d137c05..25dd414d 100644
--- a/src/net/tmwa/loginhandler.h
+++ b/src/net/tmwa/loginhandler.h
@@ -33,7 +33,7 @@ class LoginData;
namespace TmwAthena {
-class LoginHandler : public MessageHandler, public Net::LoginHandler
+class LoginHandler final : public MessageHandler, public Net::LoginHandler
{
public:
LoginHandler();
diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h
index 0a0cd130..b55a8155 100644
--- a/src/net/tmwa/npchandler.h
+++ b/src/net/tmwa/npchandler.h
@@ -22,17 +22,13 @@
#ifndef NET_TA_NPCHANDLER_H
#define NET_TA_NPCHANDLER_H
-#include "eventlistener.h"
-
#include "net/npchandler.h"
#include "net/tmwa/messagehandler.h"
-#include <map>
-
namespace TmwAthena {
-class NpcHandler : public MessageHandler, public Net::NpcHandler
+class NpcHandler final : public MessageHandler, public Net::NpcHandler
{
public:
NpcHandler();
diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h
index 7b7e2420..14c6d9f3 100644
--- a/src/net/tmwa/partyhandler.h
+++ b/src/net/tmwa/partyhandler.h
@@ -29,7 +29,7 @@
namespace TmwAthena {
-class PartyHandler : public MessageHandler, public Net::PartyHandler
+class PartyHandler final : public MessageHandler, public Net::PartyHandler
{
public:
PartyHandler();
diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h
index 24284ee4..f2a1b40e 100644
--- a/src/net/tmwa/playerhandler.h
+++ b/src/net/tmwa/playerhandler.h
@@ -29,7 +29,7 @@
namespace TmwAthena {
-class PlayerHandler : public MessageHandler, public Net::PlayerHandler
+class PlayerHandler final : public MessageHandler, public Net::PlayerHandler
{
public:
PlayerHandler();
diff --git a/src/net/tmwa/specialhandler.h b/src/net/tmwa/specialhandler.h
index f43c900e..09b6ce8d 100644
--- a/src/net/tmwa/specialhandler.h
+++ b/src/net/tmwa/specialhandler.h
@@ -29,7 +29,7 @@
namespace TmwAthena {
-class SpecialHandler : public MessageHandler, public Net::SpecialHandler
+class SpecialHandler final : public MessageHandler, public Net::SpecialHandler
{
public:
SpecialHandler();
diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h
index d4f2494f..fa7ec034 100644
--- a/src/net/tmwa/tradehandler.h
+++ b/src/net/tmwa/tradehandler.h
@@ -29,7 +29,7 @@
namespace TmwAthena {
-class TradeHandler : public MessageHandler, public Net::TradeHandler
+class TradeHandler final : public MessageHandler, public Net::TradeHandler
{
public:
TradeHandler();