summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-07-18 12:11:39 -0600
committerJared Adams <jaxad0127@gmail.com>2010-07-18 12:25:37 -0600
commit060b5d24f824de45342c8ea1bab8fc98c08b369d (patch)
tree57b304d388277310990775ee5c9bb0f67b7bb7e6 /src
parent81d8168bb5796ccb1704bcce9f5327c35e55d281 (diff)
downloadmana-060b5d24f824de45342c8ea1bab8fc98c08b369d.tar.gz
mana-060b5d24f824de45342c8ea1bab8fc98c08b369d.tar.bz2
mana-060b5d24f824de45342c8ea1bab8fc98c08b369d.tar.xz
mana-060b5d24f824de45342c8ea1bab8fc98c08b369d.zip
Replace some state-related netcode methods with events
Also move the virtual destructors of the Net handler base classes to the top of their method lists. Reviewed-by: Chuck Miller
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp4
-rw-r--r--src/game.cpp25
-rw-r--r--src/net/adminhandler.h4
-rw-r--r--src/net/charhandler.h4
-rw-r--r--src/net/chathandler.h4
-rw-r--r--src/net/gamehandler.h10
-rw-r--r--src/net/generalhandler.h6
-rw-r--r--src/net/inventoryhandler.h4
-rw-r--r--src/net/manaserv/gamehandler.cpp10
-rw-r--r--src/net/manaserv/gamehandler.h7
-rw-r--r--src/net/manaserv/generalhandler.cpp51
-rw-r--r--src/net/manaserv/generalhandler.h10
-rw-r--r--src/net/npchandler.h4
-rw-r--r--src/net/partyhandler.h4
-rw-r--r--src/net/playerhandler.h4
-rw-r--r--src/net/specialhandler.h4
-rw-r--r--src/net/tmwa/gamehandler.cpp28
-rw-r--r--src/net/tmwa/gamehandler.h13
-rw-r--r--src/net/tmwa/generalhandler.cpp81
-rw-r--r--src/net/tmwa/generalhandler.h12
-rw-r--r--src/net/tradehandler.h4
21 files changed, 144 insertions, 149 deletions
diff --git a/src/client.cpp b/src/client.cpp
index a2f70900..f78562b4 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -599,10 +599,6 @@ int Client::exec()
Mana::EventManager::trigger("Client", event);
}
- Net::GeneralHandler *generalHandler = Net::getGeneralHandler();
- if (generalHandler)
- generalHandler->stateChanged(mOldState, mState);
-
if (mOldState == STATE_GAME)
{
delete game;
diff --git a/src/game.cpp b/src/game.cpp
index 4d101fd5..955de326 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -130,6 +130,8 @@ ChatTab *localChatTab = NULL;
*/
static void initEngines()
{
+ Mana::EventManager::trigger("Game", Mana::Event("EnginesInitalizing"));
+
actorSpriteManager = new ActorSpriteManager;
commandHandler = new CommandHandler;
channelManager = new ChannelManager;
@@ -137,6 +139,8 @@ static void initEngines()
particleEngine = new Particle(NULL);
particleEngine->setupEngine();
+
+ Mana::EventManager::trigger("Game", Mana::Event("EnginesInitalized"));
}
/**
@@ -144,6 +148,8 @@ static void initEngines()
*/
static void createGuiWindows()
{
+ Mana::EventManager::trigger("Game", Mana::Event("GuiWindowsLoading"));
+
setupWindow->clearWindowsForReset();
// Create dialogs
@@ -172,7 +178,7 @@ static void createGuiWindows()
logger->setChatWindow(chatWindow);
}
- Net::getGeneralHandler()->guiWindowsLoaded();
+ Mana::EventManager::trigger("Game", Mana::Event("GuiWindowsLoaded"));
}
#define del_0(X) { delete X; X = 0; }
@@ -182,7 +188,8 @@ static void createGuiWindows()
*/
static void destroyGuiWindows()
{
- Net::getGeneralHandler()->guiWindowsUnloaded();
+ Mana::EventManager::trigger("Game", Mana::Event("GuiWindowsUnloading"));
+
logger->setChatWindow(NULL);
del_0(localChatTab) // Need to do this first, so it can remove itself
del_0(chatWindow)
@@ -200,6 +207,8 @@ static void destroyGuiWindows()
del_0(outfitWindow)
del_0(specialsWindow)
del_0(socialWindow)
+
+ Mana::EventManager::trigger("Game", Mana::Event("GuiWindowsUnloaded"));
}
Game *Game::mInstance = 0;
@@ -229,8 +238,6 @@ Game::Game():
initEngines();
- Net::getGameHandler()->inGame();
-
// Initialize beings
actorSpriteManager->setPlayer(player_node);
@@ -253,8 +260,7 @@ Game::Game():
setupWindow->setInGame(true);
- Mana::Event event("Constructed");
- Mana::EventManager::trigger("Game", event);
+ Mana::EventManager::trigger("Game", Mana::Event("Constructed"));
}
Game::~Game()
@@ -275,8 +281,7 @@ Game::~Game()
mInstance = 0;
- Mana::Event event("Destructed");
- Mana::EventManager::trigger("Game", event);
+ Mana::EventManager::trigger("Game", Mana::Event("Destructed"));
}
static bool saveScreenshot()
@@ -966,5 +971,7 @@ void Game::changeMap(const std::string &mapPath)
delete mCurrentMap;
mCurrentMap = newMap;
- Net::getGameHandler()->mapLoaded(mapPath);
+ Mana::Event event("MapLoaded");
+ event.setString("mapPath", mapPath);
+ Mana::EventManager::trigger("Game", event);
}
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index 23e9abc0..3ed96dbd 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -29,6 +29,8 @@ namespace Net {
class AdminHandler
{
public:
+ virtual ~AdminHandler() {}
+
virtual void announce(const std::string &text) = 0;
virtual void localAnnounce(const std::string &text) = 0;
@@ -49,8 +51,6 @@ class AdminHandler
virtual void mute(int playerId, int type, int limit) = 0;
- virtual ~AdminHandler() {}
-
// TODO
};
diff --git a/src/net/charhandler.h b/src/net/charhandler.h
index ba06f551..c2be5714 100644
--- a/src/net/charhandler.h
+++ b/src/net/charhandler.h
@@ -60,6 +60,8 @@ typedef std::list<Character*> Characters;
class CharHandler
{
public:
+ virtual ~CharHandler() {}
+
virtual void setCharSelectDialog(CharSelectDialog *window) = 0;
virtual void setCharCreateDialog(CharCreateDialog *window) = 0;
@@ -82,8 +84,6 @@ class CharHandler
virtual unsigned int maxSprite() const = 0;
- virtual ~CharHandler() {}
-
protected:
CharHandler():
mSelectedCharacter(0),
diff --git a/src/net/chathandler.h b/src/net/chathandler.h
index d1449698..fbaa8dba 100644
--- a/src/net/chathandler.h
+++ b/src/net/chathandler.h
@@ -28,6 +28,8 @@ namespace Net {
class ChatHandler
{
public:
+ virtual ~ChatHandler() {}
+
virtual void talk(const std::string &text) = 0;
virtual void me(const std::string &text) = 0;
@@ -53,8 +55,6 @@ class ChatHandler
virtual void kickUser(int channelId, const std::string &name) = 0;
virtual void who() = 0;
-
- virtual ~ChatHandler() {}
};
}
diff --git a/src/net/gamehandler.h b/src/net/gamehandler.h
index 8d29a55b..9b0c8d95 100644
--- a/src/net/gamehandler.h
+++ b/src/net/gamehandler.h
@@ -31,16 +31,14 @@ namespace Net {
class GameHandler
{
public:
+ virtual ~GameHandler() {}
+
virtual void connect() = 0;
virtual bool isConnected() = 0;
virtual void disconnect() = 0;
- virtual void inGame() = 0;
-
- virtual void mapLoaded(const std::string &mapName) = 0;
-
virtual void who() = 0;
virtual void quit() = 0;
@@ -50,11 +48,9 @@ class GameHandler
virtual bool removeDeadBeings() const = 0;
/**
- * Tells whether the protocol is using the MP statu bar
+ * Tells whether the protocol is using the MP status bar
*/
virtual bool canUseMagicBar() const = 0;
-
- virtual ~GameHandler() {}
};
} // namespace Net
diff --git a/src/net/generalhandler.h b/src/net/generalhandler.h
index 222b430a..1d8c66af 100644
--- a/src/net/generalhandler.h
+++ b/src/net/generalhandler.h
@@ -40,13 +40,7 @@ class GeneralHandler
virtual void flushNetwork() = 0;
- virtual void guiWindowsLoaded() = 0;
-
- virtual void guiWindowsUnloaded() = 0;
-
virtual void clearHandlers() = 0;
-
- virtual void stateChanged(State oldState, State newState) = 0;
};
} // namespace Net
diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h
index e48043a7..91257d3b 100644
--- a/src/net/inventoryhandler.h
+++ b/src/net/inventoryhandler.h
@@ -32,6 +32,8 @@ namespace Net {
class InventoryHandler
{
public:
+ virtual ~InventoryHandler() {}
+
virtual void equipItem(const Item *item) = 0;
virtual void unequipItem(const Item *item) = 0;
@@ -57,8 +59,6 @@ class InventoryHandler
// TODO: fix/remove me
virtual size_t getSize(int type) const = 0;
-
- virtual ~InventoryHandler() {}
};
} // namespace Net
diff --git a/src/net/manaserv/gamehandler.cpp b/src/net/manaserv/gamehandler.cpp
index 271fff15..65010ad3 100644
--- a/src/net/manaserv/gamehandler.cpp
+++ b/src/net/manaserv/gamehandler.cpp
@@ -109,16 +109,6 @@ void GameHandler::disconnect()
chatHandler->disconnect();
}
-void GameHandler::inGame()
-{
- // TODO
-}
-
-void GameHandler::mapLoaded(const std::string &mapName)
-{
- // TODO
-}
-
void GameHandler::who()
{
// TODO
diff --git a/src/net/manaserv/gamehandler.h b/src/net/manaserv/gamehandler.h
index 912b308e..2e9f37fe 100644
--- a/src/net/manaserv/gamehandler.h
+++ b/src/net/manaserv/gamehandler.h
@@ -42,10 +42,6 @@ class GameHandler : public MessageHandler, public Net::GameHandler
void disconnect();
- void inGame();
-
- void mapLoaded(const std::string &mapName);
-
void who();
void quit(bool reconnectAccount);
@@ -60,9 +56,8 @@ class GameHandler : public MessageHandler, public Net::GameHandler
void gameLoading();
- /** The ManaServ protocol doesn't use the Mp Main status bar. */
+ /** The ManaServ protocol doesn't use the MP status bar. */
bool canUseMagicBar() const { return false; }
-
};
} // namespace ManaServ
diff --git a/src/net/manaserv/generalhandler.cpp b/src/net/manaserv/generalhandler.cpp
index e1559d16..6fbbb954 100644
--- a/src/net/manaserv/generalhandler.cpp
+++ b/src/net/manaserv/generalhandler.cpp
@@ -22,6 +22,7 @@
#include "net/manaserv/generalhandler.h"
#include "client.h"
+#include "event.h"
#include "gui/changeemaildialog.h"
#include "gui/charselectdialog.h"
@@ -90,6 +91,9 @@ GeneralHandler::GeneralHandler():
chatServerConnection = getConnection();
generalHandler = this;
+
+ listen("Client");
+ listen("Game");
}
void GeneralHandler::load()
@@ -163,37 +167,40 @@ void GeneralHandler::flushNetwork()
}
}
-void GeneralHandler::guiWindowsLoaded()
-{
- inventoryWindow->setSplitAllowed(true);
- skillDialog->loadSkills("mana-skills.xml");
-
- PlayerInfo::setAttribute(EXP_NEEDED, 100);
-
- Stats::informStatusWindow();
-}
-
-void GeneralHandler::guiWindowsUnloaded()
-{
- // TODO
-}
-
void GeneralHandler::clearHandlers()
{
clearNetworkHandlers();
}
-void GeneralHandler::stateChanged(State oldState, State newState)
+void GeneralHandler::event(const std::string &channel,
+ const Mana::Event &event)
{
- if (newState == STATE_GAME)
+ if (channel == "Client")
{
- GameHandler *game = static_cast<GameHandler*>(Net::getGameHandler());
- game->gameLoading();
+ int newState = event.getInt("newState");
+
+ if (newState == STATE_GAME)
+ {
+ GameHandler *game = static_cast<GameHandler*>(Net::getGameHandler());
+ game->gameLoading();
+ }
+ else if (newState == STATE_LOAD_DATA)
+ {
+ Stats::load();
+ Stats::informItemDB();
+ }
}
- else if (newState == STATE_LOAD_DATA)
+ else if (channel == "Game")
{
- Stats::load();
- Stats::informItemDB();
+ if (event.getName() == "GuiWindowsLoaded")
+ {
+ inventoryWindow->setSplitAllowed(true);
+ skillDialog->loadSkills("mana-skills.xml");
+
+ PlayerInfo::setAttribute(EXP_NEEDED, 100);
+
+ Stats::informStatusWindow();
+ }
}
}
diff --git a/src/net/manaserv/generalhandler.h b/src/net/manaserv/generalhandler.h
index 58b95529..2a203e8c 100644
--- a/src/net/manaserv/generalhandler.h
+++ b/src/net/manaserv/generalhandler.h
@@ -22,6 +22,8 @@
#ifndef NET_MANASERV_GENERALHANDLER_H
#define NET_MANASERV_GENERALHANDLER_H
+#include "listener.h"
+
#include "net/generalhandler.h"
#include "net/net.h"
@@ -29,7 +31,7 @@
namespace ManaServ {
-class GeneralHandler : public Net::GeneralHandler
+class GeneralHandler : public Net::GeneralHandler, public Mana::Listener
{
public:
GeneralHandler();
@@ -42,13 +44,9 @@ class GeneralHandler : public Net::GeneralHandler
void flushNetwork();
- void guiWindowsLoaded();
-
- void guiWindowsUnloaded();
-
void clearHandlers();
- void stateChanged(State oldState, State newState);
+ void event(const std::string &channel, const Mana::Event &event);
protected:
MessageHandlerPtr mBeingHandler;
diff --git a/src/net/npchandler.h b/src/net/npchandler.h
index bba8dc31..2a9cfab5 100644
--- a/src/net/npchandler.h
+++ b/src/net/npchandler.h
@@ -29,6 +29,8 @@ namespace Net {
class NpcHandler
{
public:
+ virtual ~NpcHandler() {}
+
virtual void talk(int npcId) = 0;
virtual void nextDialog(int npcId) = 0;
@@ -55,8 +57,6 @@ class NpcHandler
virtual void sellItem(int beingId, int itemId, int amount) = 0;
virtual void endShopping(int beingId) = 0;
-
- virtual ~NpcHandler() {}
};
} // namespace Net
diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h
index ba2ed458..7ca13546 100644
--- a/src/net/partyhandler.h
+++ b/src/net/partyhandler.h
@@ -38,6 +38,8 @@ namespace Net {
class PartyHandler
{
public:
+ virtual ~PartyHandler() {}
+
virtual void create(const std::string &name = "") = 0;
virtual void join(int partyId) = 0;
@@ -69,8 +71,6 @@ class PartyHandler
// virtual void options() = 0;
// virtual void message() = 0;
-
- virtual ~PartyHandler() {}
};
} // namespace Net
diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h
index 399afb5e..b3534b83 100644
--- a/src/net/playerhandler.h
+++ b/src/net/playerhandler.h
@@ -31,6 +31,8 @@ namespace Net {
class PlayerHandler
{
public:
+ virtual ~PlayerHandler() {}
+
virtual void attack(int id) = 0;
virtual void emote(int emoteId) = 0;
@@ -62,8 +64,6 @@ class PlayerHandler
virtual int getJobLocation() = 0;
virtual Vector getDefaultWalkSpeed() = 0;
-
- virtual ~PlayerHandler() {}
};
} // namespace Net
diff --git a/src/net/specialhandler.h b/src/net/specialhandler.h
index 21e3a4b7..89fcdf7d 100644
--- a/src/net/specialhandler.h
+++ b/src/net/specialhandler.h
@@ -28,6 +28,8 @@ namespace Net {
class SpecialHandler
{
public:
+ virtual ~SpecialHandler () {}
+
virtual void use(int id) = 0;
virtual void use(int id, int level, int beingId) = 0;
@@ -35,8 +37,6 @@ class SpecialHandler
virtual void use(int id, int level, int x, int y) = 0;
virtual void use(int id, const std::string &map) = 0;
-
- virtual ~SpecialHandler () {}
};
}
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp
index 179d98e4..4810a3ea 100644
--- a/src/net/tmwa/gamehandler.cpp
+++ b/src/net/tmwa/gamehandler.cpp
@@ -22,6 +22,7 @@
#include "net/tmwa/gamehandler.h"
#include "client.h"
+#include "event.h"
#include "game.h"
#include "localplayer.h"
#include "log.h"
@@ -58,6 +59,8 @@ GameHandler::GameHandler()
};
handledMessages = _messages;
gameHandler = this;
+
+ listen("Game");
}
void GameHandler::handleMessage(Net::MessageIn &msg)
@@ -104,6 +107,21 @@ void GameHandler::handleMessage(Net::MessageIn &msg)
}
}
+void GameHandler::event(const std::string &channel, const Mana::Event &event)
+{
+ if (channel == "Game")
+ {
+ if (event.getName() == "EnginesInitalized")
+ {
+ Game::instance()->changeMap(mMap);
+ }
+ else if (event.getName() == "MapLoaded")
+ {
+ MessageOut outMsg(CMSG_MAP_LOADED);
+ }
+ }
+}
+
void GameHandler::connect()
{
mNetwork->connect(mapServer);
@@ -141,16 +159,6 @@ void GameHandler::disconnect()
mNetwork->disconnect();
}
-void GameHandler::inGame()
-{
- Game::instance()->changeMap(mMap);
-}
-
-void GameHandler::mapLoaded(const std::string &mapName)
-{
- MessageOut outMsg(CMSG_MAP_LOADED);
-}
-
void GameHandler::who()
{
}
diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h
index 101e7972..6bdcbaef 100644
--- a/src/net/tmwa/gamehandler.h
+++ b/src/net/tmwa/gamehandler.h
@@ -22,6 +22,8 @@
#ifndef NET_TA_MAPHANDLER_H
#define NET_TA_MAPHANDLER_H
+#include "listener.h"
+
#include "net/gamehandler.h"
#include "net/net.h"
#include "net/serverinfo.h"
@@ -31,23 +33,22 @@
namespace TmwAthena {
-class GameHandler : public MessageHandler, public Net::GameHandler
+class GameHandler : public MessageHandler, public Net::GameHandler,
+ public Mana::Listener
{
public:
GameHandler();
void handleMessage(Net::MessageIn &msg);
+ void event(const std::string &channel, const Mana::Event &event);
+
void connect();
bool isConnected();
void disconnect();
- void inGame();
-
- void mapLoaded(const std::string &mapName);
-
void who();
void quit();
@@ -60,7 +61,7 @@ class GameHandler : public MessageHandler, public Net::GameHandler
void setMap(const std::string map);
- /** The tmwa protocol is making use of the Mp Main status bar. */
+ /** The tmwAthena protocol is making use of the MP status bar. */
bool canUseMagicBar() const { return true; }
private:
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 14f48055..ba9b329e 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -23,6 +23,7 @@
#include "client.h"
#include "configuration.h"
+#include "event.h"
#include "log.h"
#include "gui/charselectdialog.h"
@@ -32,6 +33,10 @@
#include "gui/socialwindow.h"
#include "gui/statuswindow.h"
+#include "net/messagein.h"
+#include "net/messageout.h"
+#include "net/serverinfo.h"
+
#include "net/tmwa/adminhandler.h"
#include "net/tmwa/beinghandler.h"
#include "net/tmwa/buysellhandler.h"
@@ -53,9 +58,6 @@
#include "net/tmwa/gui/guildtab.h"
#include "net/tmwa/gui/partytab.h"
-#include "net/messagein.h"
-#include "net/messageout.h"
-
#include "resources/itemdb.h"
#include "utils/gettext.h"
@@ -106,6 +108,8 @@ GeneralHandler::GeneralHandler():
stats.push_back(ItemDB::Stat("luck", _("Luck %+d")));
ItemDB::setStatsList(stats);
+
+ listen("Game");
}
GeneralHandler::~GeneralHandler()
@@ -209,47 +213,48 @@ void GeneralHandler::flushNetwork()
}
}
-void GeneralHandler::guiWindowsLoaded()
-{
- inventoryWindow->setSplitAllowed(false);
- skillDialog->loadSkills("ea-skills.xml");
-
- statusWindow->addAttribute(STR, _("Strength"), true, "");
- statusWindow->addAttribute(AGI, _("Agility"), true, "");
- statusWindow->addAttribute(VIT, _("Vitality"), true, "");
- statusWindow->addAttribute(INT, _("Intelligence"), true, "");
- statusWindow->addAttribute(DEX, _("Dexterity"), true, "");
- statusWindow->addAttribute(LUK, _("Luck"), true, "");
-
- statusWindow->addAttribute(ATK, _("Attack"), false, "");
- statusWindow->addAttribute(DEF, _("Defense"), false, "");
- statusWindow->addAttribute(MATK, _("M.Attack"), false, "");
- statusWindow->addAttribute(MDEF, _("M.Defense"), false, "");
- statusWindow->addAttribute(HIT, _("% Accuracy"), false, "");
- statusWindow->addAttribute(FLEE, _("% Evade"), false, "");
- statusWindow->addAttribute(CRIT, _("% Critical"), false, "");
-}
-
-void GeneralHandler::guiWindowsUnloaded()
-{
- socialWindow->removeTab(taGuild);
- socialWindow->removeTab(taParty);
-
- delete guildTab;
- guildTab = 0;
-
- delete partyTab;
- partyTab = 0;
-}
-
void GeneralHandler::clearHandlers()
{
mNetwork->clearHandlers();
}
-void GeneralHandler::stateChanged(State oldState, State newState)
+void GeneralHandler::event(const std::string &channel,
+ const Mana::Event &event)
{
- //
+ if (channel == "Game")
+ {
+ if (event.getName() == "GuiWindowsLoaded")
+ {
+ inventoryWindow->setSplitAllowed(false);
+ skillDialog->loadSkills("ea-skills.xml");
+
+ statusWindow->addAttribute(STR, _("Strength"), true, "");
+ statusWindow->addAttribute(AGI, _("Agility"), true, "");
+ statusWindow->addAttribute(VIT, _("Vitality"), true, "");
+ statusWindow->addAttribute(INT, _("Intelligence"), true, "");
+ statusWindow->addAttribute(DEX, _("Dexterity"), true, "");
+ statusWindow->addAttribute(LUK, _("Luck"), true, "");
+
+ statusWindow->addAttribute(ATK, _("Attack"), false, "");
+ statusWindow->addAttribute(DEF, _("Defense"), false, "");
+ statusWindow->addAttribute(MATK, _("M.Attack"), false, "");
+ statusWindow->addAttribute(MDEF, _("M.Defense"), false, "");
+ statusWindow->addAttribute(HIT, _("% Accuracy"), false, "");
+ statusWindow->addAttribute(FLEE, _("% Evade"), false, "");
+ statusWindow->addAttribute(CRIT, _("% Critical"), false, "");
+ }
+ else if (event.getName() == "GuiWindowsUnloading")
+ {
+ socialWindow->removeTab(taGuild);
+ socialWindow->removeTab(taParty);
+
+ delete guildTab;
+ guildTab = 0;
+
+ delete partyTab;
+ partyTab = 0;
+ }
+ }
}
} // namespace TmwAthena
diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h
index d680f215..f7f78759 100644
--- a/src/net/tmwa/generalhandler.h
+++ b/src/net/tmwa/generalhandler.h
@@ -22,15 +22,17 @@
#ifndef NET_TMWA_GENERALHANDLER_H
#define NET_TMWA_GENERALHANDLER_H
+#include "listener.h"
+
#include "net/generalhandler.h"
#include "net/net.h"
-#include "net/serverinfo.h"
#include "net/tmwa/messagehandler.h"
namespace TmwAthena {
-class GeneralHandler : public MessageHandler, public Net::GeneralHandler
+class GeneralHandler : public MessageHandler, public Net::GeneralHandler,
+ public Mana::Listener
{
public:
GeneralHandler();
@@ -47,13 +49,9 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler
void flushNetwork();
- void guiWindowsLoaded();
-
- void guiWindowsUnloaded();
-
void clearHandlers();
- void stateChanged(State oldState, State newState);
+ void event(const std::string &channel, const Mana::Event &event);
protected:
MessageHandlerPtr mAdminHandler;
diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h
index 30798c41..ea3c4550 100644
--- a/src/net/tradehandler.h
+++ b/src/net/tradehandler.h
@@ -30,6 +30,8 @@ namespace Net {
class TradeHandler
{
public:
+ virtual ~TradeHandler() {}
+
virtual void request(Being *being) {}
virtual void respond(bool accept) {}
@@ -45,8 +47,6 @@ class TradeHandler
virtual void finish() {}
virtual void cancel() {}
-
- virtual ~TradeHandler() {}
};
}