summaryrefslogtreecommitdiff
path: root/src/net/net.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/net.cpp')
-rw-r--r--src/net/net.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/net/net.cpp b/src/net/net.cpp
index 5e7c989f..7e7395a6 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -22,6 +22,7 @@
#include "net/net.h"
#include "main.h"
+#include "log.h"
#include "net/adminhandler.h"
#include "net/charhandler.h"
@@ -41,6 +42,8 @@
#include "net/manaserv/generalhandler.h"
+#include "utils/gettext.h"
+
Net::AdminHandler *adminHandler = NULL;
Net::CharHandler *charHandler = NULL;
Net::ChatHandler *chatHandler = NULL;
@@ -124,12 +127,19 @@ namespace Net
{
ServerInfo::Type networkType = ServerInfo::UNKNOWN;
-void connectToServer(const ServerInfo &server)
+void connectToServer(ServerInfo &server)
{
if (server.type == ServerInfo::UNKNOWN)
{
// TODO: Query the server about itself and choose the netcode based on
// that
+
+ if (server.port == 6901)
+ server.type = ServerInfo::TMWATHENA;
+ else if (server.port == 9601)
+ server.type = ServerInfo::MANASERV;
+ else
+ logger->error(_("Unknown Server Type! Exiting."));
}
if (networkType == server.type && getGeneralHandler() != NULL)