summaryrefslogtreecommitdiff
path: root/src/net/manaserv/network.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-11-03 10:18:25 -0700
committerJared Adams <jaxad0127@gmail.com>2009-11-03 10:18:25 -0700
commitacd557f9472c711fe92b9c158ec336abf688bf7b (patch)
tree2295d13589411ee88afe16f4997bea65b4ebba94 /src/net/manaserv/network.cpp
parentc60d3a98dbbb20621742bfd82bbaaa6b7085a8ae (diff)
downloadmana-acd557f9472c711fe92b9c158ec336abf688bf7b.tar.gz
mana-acd557f9472c711fe92b9c158ec336abf688bf7b.tar.bz2
mana-acd557f9472c711fe92b9c158ec336abf688bf7b.tar.xz
mana-acd557f9472c711fe92b9c158ec336abf688bf7b.zip
Remove more _SUPPORT ifdefs and do some cleanup
Diffstat (limited to 'src/net/manaserv/network.cpp')
-rw-r--r--src/net/manaserv/network.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/net/manaserv/network.cpp b/src/net/manaserv/network.cpp
index 84b9d070..91a7ed6a 100644
--- a/src/net/manaserv/network.cpp
+++ b/src/net/manaserv/network.cpp
@@ -23,9 +23,8 @@
#include "net/manaserv/connection.h"
#include "net/manaserv/internal.h"
-
-#include "net/messagehandler.h"
-#include "net/messagein.h"
+#include "net/manaserv/messagehandler.h"
+#include "net/manaserv/messagein.h"
#include "log.h"
@@ -40,11 +39,14 @@ namespace {
ENetHost *client;
}
+namespace ManaServ
+{
+
typedef std::map<unsigned short, MessageHandler*> MessageHandlers;
typedef MessageHandlers::iterator MessageHandlerIterator;
static MessageHandlers mMessageHandlers;
-void Net::initialize()
+void initialize()
{
if (enet_initialize())
{
@@ -59,12 +61,12 @@ void Net::initialize()
}
}
-void Net::finalize()
+void finalize()
{
if (!client)
return; // Wasn't initialized at all
- if (Net::connections) {
+ if (connections) {
logger->error("Tried to shutdown the network subsystem while there "
"are network connections left!");
}
@@ -73,7 +75,7 @@ void Net::finalize()
enet_deinitialize();
}
-Net::Connection *Net::getConnection()
+Connection *getConnection()
{
if (!client)
{
@@ -81,10 +83,10 @@ Net::Connection *Net::getConnection()
"initializing the network subsystem!");
}
- return new Net::Connection(client);
+ return new Connection(client);
}
-void Net::registerHandler(MessageHandler *handler)
+void registerHandler(MessageHandler *handler)
{
for (const Uint16 *i = handler->handledMessages; *i; i++)
{
@@ -92,7 +94,7 @@ void Net::registerHandler(MessageHandler *handler)
}
}
-void Net::unregisterHandler(MessageHandler *handler)
+void unregisterHandler(MessageHandler *handler)
{
for (const Uint16 *i = handler->handledMessages; *i; i++)
{
@@ -100,7 +102,7 @@ void Net::unregisterHandler(MessageHandler *handler)
}
}
-void Net::clearHandlers()
+void clearHandlers()
{
mMessageHandlers.clear();
}
@@ -133,7 +135,7 @@ namespace
}
}
-void Net::flush()
+void flush()
{
ENetEvent event;
@@ -168,3 +170,5 @@ void Net::flush()
}
}
}
+
+}