summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-09-29 23:03:41 +0000
committerIra Rice <irarice@gmail.com>2008-09-29 23:03:41 +0000
commit7aa0b5cadf9f37c7d9395aa44e0c461e2b539763 (patch)
treeea85dcc9415c031d3f2a28e74b8f4ec38f2b1747
parent9ae618b143023609a1f085162ca935167677e1ca (diff)
downloadmana-7aa0b5cadf9f37c7d9395aa44e0c461e2b539763.tar.gz
mana-7aa0b5cadf9f37c7d9395aa44e0c461e2b539763.tar.bz2
mana-7aa0b5cadf9f37c7d9395aa44e0c461e2b539763.tar.xz
mana-7aa0b5cadf9f37c7d9395aa44e0c461e2b539763.zip
Modified the client so that it displays both servers as server choices,
as well as changing the default server to point to www.aethyra.org instead of Slinker's IP address now.
-rw-r--r--src/gui/login.cpp26
-rw-r--r--src/gui/login.h4
-rw-r--r--src/main.cpp6
3 files changed, 20 insertions, 16 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index 6a4cfeb7..c553d56e 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -24,6 +24,7 @@
#include "login.h"
#include <string>
+#include <vector>
#include <guichan/widgets/label.hpp>
@@ -50,9 +51,13 @@ LoginDialog::LoginDialog(LoginData *loginData):
gcn::Label *passLabel = new gcn::Label("Password:");
gcn::Label *serverLabel = new gcn::Label("Server:");
gcn::Label *portLabel = new gcn::Label("Port:");
- mServerList = new DropDownList("MostRecent00",
- "209.168.213.109",
- "21001",
+ std::vector<std::string> dfltServer;
+ dfltServer.push_back("www.aethyra.org");
+ dfltServer.push_back("www.aethyra.org");
+ std::vector<std::string> dfltPort;
+ dfltPort.push_back("22001");
+ dfltPort.push_back("21001");
+ mServerList = new DropDownList("MostRecent00", dfltServer, dfltPort,
MAX_SERVER_LIST_SIZE);
mServerListBox = new gcn::ListBox(mServerList);
mServerScrollArea = new ScrollArea();
@@ -193,8 +198,8 @@ LoginDialog::action(const gcn::ActionEvent &event)
}
else
{
- mLoginData->port = 6901;
- }
+ mLoginData->port = 6901;
+ }
mLoginData->username = mUserField->getText();
mLoginData->password = mPassField->getText();
@@ -271,8 +276,8 @@ LoginDialog::DropDownList::saveEntry(const std::string &server,
}
LoginDialog::DropDownList::DropDownList(std::string prefix,
- std::string dflt,
- std::string dfltPort,
+ std::vector<std::string> dflt,
+ std::vector<std::string> dfltPort,
int maxEntries) :
mConfigPrefix(prefix),
mMaxEntries(maxEntries)
@@ -287,7 +292,7 @@ LoginDialog::DropDownList::DropDownList(std::string prefix,
toString(i), "");
}
std::string port = config.getValue(mConfigPrefix + "Port" +
- toString(i), dfltPort);
+ toString(i), dfltPort.front());
if (server != "")
{
@@ -297,10 +302,9 @@ LoginDialog::DropDownList::DropDownList(std::string prefix,
}
if (mServers.size() == 0)
{
- mServers.push_back(dflt);
- mPorts.push_back(dfltPort);
+ mServers.assign(dflt.begin(), dflt.end());
+ mPorts.assign(dfltPort.begin(), dfltPort.end());
}
-
}
void
diff --git a/src/gui/login.h b/src/gui/login.h
index 8a228b5f..3550d82b 100644
--- a/src/gui/login.h
+++ b/src/gui/login.h
@@ -124,8 +124,8 @@ class LoginDialog : public Window, public gcn::ActionListener,
const std::string &port, int &saved);
public:
DropDownList(std::string prefix,
- std::string dfltServer,
- std::string dfltPort,
+ std::vector<std::string> dfltServer,
+ std::vector<std::string> dfltPort,
int maxEntries);
void save(const std::string &server, const std::string &port);
int getNumberOfElements();
diff --git a/src/main.cpp b/src/main.cpp
index fb4e8f76..4427b4d4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -166,7 +166,7 @@ void setUpdatesDir()
// If updatesHost is currently empty, fill it from config file
if (updateHost.empty()) {
updateHost =
- config.getValue("updatehost", "http://209.168.213.109/updates");
+ config.getValue("updatehost", "http://www.aethyra.org/updates");
}
// Parse out any "http://" or "ftp://", and set the updates directory
@@ -279,7 +279,7 @@ void init_engine(const Options &options)
// Fill configuration with defaults
logger->log("Initializing configuration...");
- config.setValue("host", "209.168.213.109");
+ config.setValue("host", "www.aethyra.org");
config.setValue("port", 21001);
config.setValue("hwaccel", 0);
#if (defined __APPLE__ || defined WIN32) && defined USE_OPENGL
@@ -294,7 +294,7 @@ void init_engine(const Options &options)
config.setValue("sfxVolume", 100);
config.setValue("musicVolume", 60);
config.setValue("fpslimit", 60);
- config.setValue("updatehost", "http://209.168.213.109/updates");
+ config.setValue("updatehost", "http://www.aethyra.org/updates");
config.setValue("customcursor", 1);
config.setValue("ChatLogLength", 128);