diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-12-02 14:35:42 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-12-02 14:35:42 -0700 |
commit | 91761b7926c2503664c4db24c5aa44f817384227 (patch) | |
tree | a6c1c5d31593048326f1026fa52997b3003df471 /src/net/ea | |
parent | d12c93d4d6fc38eb86b5cb8515f4b8f8a7e96b54 (diff) | |
download | mana-91761b7926c2503664c4db24c5aa44f817384227.tar.gz mana-91761b7926c2503664c4db24c5aa44f817384227.tar.bz2 mana-91761b7926c2503664c4db24c5aa44f817384227.tar.xz mana-91761b7926c2503664c4db24c5aa44f817384227.zip |
Centralize netcode handler instances in Net
Instead of each netcode making the global variables and Net referencing them, Net now makes them and the netcodes reference them.
Also remove an innappropriate ChatHandler reference from eA's AdminHandler.
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/adminhandler.cpp | 8 | ||||
-rw-r--r-- | src/net/ea/charserverhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/gamehandler.cpp | 3 | ||||
-rw-r--r-- | src/net/ea/generalhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/guildhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/loginhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/npchandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/partyhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/specialhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/tradehandler.cpp | 2 |
13 files changed, 15 insertions, 18 deletions
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp index 62fe9ea8..a58154f6 100644 --- a/src/net/ea/adminhandler.cpp +++ b/src/net/ea/adminhandler.cpp @@ -38,9 +38,7 @@ #include <string> -extern Net::ChatHandler *chatHandler; - -Net::AdminHandler *adminHandler; +extern Net::AdminHandler *adminHandler; namespace EAthena { @@ -97,7 +95,7 @@ void AdminHandler::kick(int playerId) void AdminHandler::kick(const std::string &name) { - chatHandler->talk("@kick " + name); + Net::getChatHandler()->talk("@kick " + name); } void AdminHandler::ban(int playerId) @@ -107,7 +105,7 @@ void AdminHandler::ban(int playerId) void AdminHandler::ban(const std::string &name) { - chatHandler->talk("@ban " + name); + Net::getChatHandler()->talk("@ban " + name); } void AdminHandler::unban(int playerId) diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index 47eddc12..8dacb06f 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -42,7 +42,7 @@ #include "utils/gettext.h" #include "utils/stringutils.h" -Net::CharHandler *charHandler; +extern Net::CharHandler *charHandler; namespace EAthena { diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 913cfacf..b3104e36 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -39,7 +39,7 @@ #include <string> -Net::ChatHandler *chatHandler; +extern Net::ChatHandler *chatHandler; namespace EAthena { diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index 5becfe1b..41c86d4d 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -40,8 +40,7 @@ #include "utils/gettext.h" #include "utils/stringutils.h" -Net::GameHandler *gameHandler; -extern Game *game; +extern Net::GameHandler *gameHandler; namespace EAthena { diff --git a/src/net/ea/generalhandler.cpp b/src/net/ea/generalhandler.cpp index dc022557..3818afec 100644 --- a/src/net/ea/generalhandler.cpp +++ b/src/net/ea/generalhandler.cpp @@ -62,7 +62,7 @@ #include <assert.h> #include <list> -Net::GeneralHandler *generalHandler = NULL; +extern Net::GeneralHandler *generalHandler; namespace EAthena { diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp index 0cccd8f4..c61e88ac 100644 --- a/src/net/ea/guildhandler.cpp +++ b/src/net/ea/guildhandler.cpp @@ -27,7 +27,7 @@ #include "localplayer.h" #include "log.h" -Net::GuildHandler *guildHandler; +extern Net::GuildHandler *guildHandler; namespace EAthena { diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index f24b2d0a..fbd5c9b3 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -46,7 +46,7 @@ #include <SDL_types.h> -Net::InventoryHandler *inventoryHandler; +extern Net::InventoryHandler *inventoryHandler; namespace EAthena { diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index a57eee8a..e91925de 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -35,7 +35,7 @@ #include "utils/gettext.h" #include "utils/stringutils.h" -Net::LoginHandler *loginHandler; +extern Net::LoginHandler *loginHandler; namespace EAthena { diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp index 24d8fb64..5800504c 100644 --- a/src/net/ea/npchandler.cpp +++ b/src/net/ea/npchandler.cpp @@ -36,7 +36,7 @@ #include <SDL_types.h> -Net::NpcHandler *npcHandler; +extern Net::NpcHandler *npcHandler; namespace EAthena { diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 21d63ae5..de17855f 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -38,7 +38,7 @@ #include "utils/stringutils.h" PartyTab *partyTab = 0; -Net::PartyHandler *partyHandler = 0; +extern Net::PartyHandler *partyHandler; namespace EAthena { diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index dd0d099a..5db4acbe 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -140,7 +140,7 @@ static const char *randomDeathMessage() return gettext(deadMsg[random]); } -Net::PlayerHandler *playerHandler; +extern Net::PlayerHandler *playerHandler; namespace EAthena { diff --git a/src/net/ea/specialhandler.cpp b/src/net/ea/specialhandler.cpp index 5def63b7..b9335553 100644 --- a/src/net/ea/specialhandler.cpp +++ b/src/net/ea/specialhandler.cpp @@ -67,7 +67,7 @@ /** should always be zero if failed */ #define SKILL_FAILED 0x00 -Net::SpecialHandler *specialHandler; +extern Net::SpecialHandler *specialHandler; namespace EAthena { diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index bfd01f89..2f5186df 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -55,7 +55,7 @@ namespace { } listener; } -Net::TradeHandler *tradeHandler; +extern Net::TradeHandler *tradeHandler; namespace EAthena { |