diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-09-30 19:54:06 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-09-30 19:54:06 -0600 |
commit | d4f32a38fd498c180d562ced38a9129e0abf2252 (patch) | |
tree | e655b59ff686ad5fe2bdd11d6e072f5c3a4493b7 /src/net/net.cpp | |
parent | 6707d108790ab1fe1d4a3ef52d717966990fdf0a (diff) | |
download | mana-client-d4f32a38fd498c180d562ced38a9129e0abf2252.tar.gz mana-client-d4f32a38fd498c180d562ced38a9129e0abf2252.tar.bz2 mana-client-d4f32a38fd498c180d562ced38a9129e0abf2252.tar.xz mana-client-d4f32a38fd498c180d562ced38a9129e0abf2252.zip |
Merge login state machines for both clients
Also do some cleanup and refactoring of related code.
Diffstat (limited to 'src/net/net.cpp')
-rw-r--r-- | src/net/net.cpp | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/src/net/net.cpp b/src/net/net.cpp index 7df336c6..6a9c072a 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -21,6 +21,8 @@ #include "net/net.h" +#include "main.h" + #include "net/adminhandler.h" #include "net/charhandler.h" #include "net/chathandler.h" @@ -28,22 +30,26 @@ #include "net/guildhandler.h" #include "net/inventoryhandler.h" #include "net/loginhandler.h" -#include "net/logouthandler.h" -#include "net/maphandler.h" +#include "net/gamehandler.h" #include "net/npchandler.h" #include "net/partyhandler.h" #include "net/playerhandler.h" #include "net/specialhandler.h" #include "net/tradehandler.h" +#ifdef TMWSERV_SUPPORT +#include "net/tmwserv/generalhandler.h" +#else +#include "net/ea/generalhandler.h" +#endif + extern Net::AdminHandler *adminHandler; extern Net::CharHandler *charHandler; extern Net::ChatHandler *chatHandler; extern Net::GeneralHandler *generalHandler; extern Net::InventoryHandler *inventoryHandler; extern Net::LoginHandler *loginHandler; -extern Net::LogoutHandler *logoutHandler; -extern Net::MapHandler *mapHandler; +extern Net::GameHandler *gameHandler; extern Net::NpcHandler *npcHandler; extern Net::PartyHandler *partyHandler; extern Net::PlayerHandler *playerHandler; @@ -65,6 +71,11 @@ Net::ChatHandler *Net::getChatHandler() return chatHandler; } +Net::GameHandler *Net::getGameHandler() +{ + return gameHandler; +} + Net::GeneralHandler *Net::getGeneralHandler() { return generalHandler; @@ -86,16 +97,6 @@ Net::LoginHandler *Net::getLoginHandler() return loginHandler; } -Net::LogoutHandler *Net::getLogoutHandler() -{ - return logoutHandler; -} - -Net::MapHandler *Net::getMapHandler() -{ - return mapHandler; -} - Net::NpcHandler *Net::getNpcHandler() { return npcHandler; @@ -120,3 +121,21 @@ Net::TradeHandler *Net::getTradeHandler() { return tradeHandler; } + +void Net::connectToServer(const ServerInfo &server) +{ + // TODO: Actually query the server about itself and choose the netcode + // based on that + +#ifdef TMWSERV_SUPPORT + new TmwServ::GeneralHandler; +#else + new EAthena::GeneralHandler; +#endif + + Net::getGeneralHandler()->load(); + + Net::getLoginHandler()->setServer(server); + + Net::getLoginHandler()->connect(); +} |