summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-05-19 14:00:01 +0000
committerFate <fate-tmw@googlemail.com>2009-05-19 14:00:01 +0000
commit3dd404ee8a02958089bf2c6901fb877d2fae760e (patch)
tree470aa876623b4a9f7d2f404ebca72edac48d6659 /src/main.cpp
parent06ee3ce2a54d5bb481e27f9d61be75b7f9d0fa45 (diff)
downloadmana-3dd404ee8a02958089bf2c6901fb877d2fae760e.tar.gz
mana-3dd404ee8a02958089bf2c6901fb877d2fae760e.tar.bz2
mana-3dd404ee8a02958089bf2c6901fb877d2fae760e.tar.xz
mana-3dd404ee8a02958089bf2c6901fb877d2fae760e.zip
Default port consistently uses 6901 on eAthena. branding.xml also defaults to 6901 now since most players play on eAthena, so the -P client parameter finally works out of the box again.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f15eeccc..7c48e728 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -126,6 +126,12 @@
#include <sys/stat.h>
#endif
+#ifdef TWMSERV_SUPPORT
+#define DEFAULT_PORT 9601
+#else
+#define DEFAULT_PORT 6901
+#endif
+
namespace
{
struct SetupListener : public gcn::ActionListener
@@ -347,11 +353,7 @@ static void initConfiguration(const Options &options)
std::string defaultHost = branding.getValue("defaultServer",
"server.themanaworld.org");
config.setValue("host", defaultHost);
-#ifdef TWMSERV_SUPPORT
- int defaultPort = (int)branding.getValue("defaultPort", 9601);
-#else
- int defaultPort = (int)branding.getValue("defaultPort", 6901);
-#endif
+ int defaultPort = (int)branding.getValue("defaultPort", DEFAULT_PORT);
config.setValue("port", defaultPort);
config.setValue("hwaccel", false);
#if (defined __APPLE__ || defined WIN32) && defined USE_OPENGL
@@ -953,7 +955,7 @@ int main(int argc, char *argv[])
"server.themanaworld.org").c_str();
}
if (options.serverPort == 0) {
- loginData.port = (short) branding.getValue("defaultPort", 9601);
+ loginData.port = (short) branding.getValue("defaultPort", DEFAULT_PORT);
}
if (loginData.username.empty() && loginData.remember) {
loginData.username = config.getValue("username", "");