summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp76
1 files changed, 39 insertions, 37 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 73e0b0fe..a9206505 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -187,7 +187,7 @@ void setUpdatesDir()
if (updateHost.empty())
{
updateHost =
- config.getValue("updatehost", "http://www.aethyra.org/updates");
+ config.getValue("updatehost", "http://updates.themanaworld.org/");
}
// Remove any trailing slash at the end of the update host
@@ -201,7 +201,7 @@ void setUpdatesDir()
{
if (pos + 3 < updateHost.length())
{
- updates << "updates/" << updateHost.substr(pos + 3)
+ updates << "updates/" << updateHost.substr(pos + 3)
<< "/" << loginData.port;
updatesDir = updates.str();
}
@@ -259,18 +259,18 @@ void setUpdatesDir()
*/
void init_engine(const Options &options)
{
- homeDir = std::string(PHYSFS_getUserDir()) + "/.aethyra";
+ homeDir = std::string(PHYSFS_getUserDir()) + "/.tmw";
#if defined WIN32
if (!CreateDirectory(homeDir.c_str(), 0) &&
GetLastError() != ERROR_ALREADY_EXISTS)
#elif defined __APPLE__
- // Use Application Directory instead of .aethyra
+ // Use Application Directory instead of .tmw
homeDir = std::string(PHYSFS_getUserDir()) +
- "/Library/Application Support/Aethyra";
+ "/Library/Application Support/The Mana World";
if ((mkdir(homeDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) &&
(errno != EEXIST))
#else
- // Checking if /home/user/.Aethyra folder exists.
+ // Checking if /home/user/.tmw folder exists.
if ((mkdir(homeDir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) &&
(errno != EEXIST))
#endif
@@ -282,12 +282,12 @@ void init_engine(const Options &options)
}
// Set log file
- logger->setLogFile(homeDir + std::string("/aethyra.log"));
+ logger->setLogFile(homeDir + std::string("/tmw.log"));
#ifdef PACKAGE_VERSION
- logger->log(_("Starting Aethyra Version %s"), PACKAGE_VERSION);
+ logger->log(_("Starting The Mana World Version %s"), PACKAGE_VERSION);
#else
- logger->log(_("Starting Aethyra - Version not defined"));
+ logger->log(_("Starting The Mana World - Version not defined"));
#endif
// Initialize SDL
@@ -332,12 +332,12 @@ void init_engine(const Options &options)
strncat(path, "/data", PATH_MAX - 1);
resman->addToSearchPath(path, true);
#else
- resman->addToSearchPath(AETHYRA_DATADIR "data", true);
+ resman->addToSearchPath(TMW_DATADIR "data", true);
#endif
// Fill configuration with defaults
logger->log(_("Initializing configuration..."));
- config.setValue("host", "www.aethyra.org");
+ config.setValue("host", "www.themanaworld.org");
config.setValue("port", 21001);
config.setValue("hwaccel", 0);
#if (defined __APPLE__ || defined WIN32) && defined USE_OPENGL
@@ -352,34 +352,34 @@ void init_engine(const Options &options)
config.setValue("sfxVolume", 100);
config.setValue("musicVolume", 60);
config.setValue("fpslimit", 0);
- config.setValue("updatehost", "http://www.aethyra.org/updates");
+ config.setValue("updatehost", "http://updates.themanaworld.org");
config.setValue("customcursor", 1);
config.setValue("ChatLogLength", 128);
// Checking if the configuration file exists... otherwise creates it with
// default options !
- FILE *aethyraFile = 0;
+ FILE *configFile = 0;
std::string configPath = options.configPath;
if (configPath.empty())
configPath = homeDir + "/config.xml";
- aethyraFile = fopen(configPath.c_str(), "r");
+ configFile = fopen(configPath.c_str(), "r");
// If we can't read it, it doesn't exist !
- if (aethyraFile == NULL) {
+ if (configFile == NULL) {
// We reopen the file in write mode and we create it
- aethyraFile = fopen(configPath.c_str(), "wt");
+ configFile = fopen(configPath.c_str(), "wt");
}
- if (aethyraFile == NULL) {
+ if (configFile == NULL) {
std::cout << "Can't create " << configPath << ". "
"Using Defaults." << std::endl;
} else {
- fclose(aethyraFile);
+ fclose(configFile);
config.init(configPath);
}
- SDL_WM_SetCaption("Aethyra", NULL);
+ SDL_WM_SetCaption("The Mana World", NULL);
#ifdef WIN32
static SDL_SysWMinfo pInfo;
SDL_GetWMInfo(&pInfo);
@@ -389,7 +389,7 @@ void init_engine(const Options &options)
SetClassLong(pInfo.window, GCL_HICON, (LONG) icon);
}
#else
- SDL_Surface *icon = IMG_Load(AETHYRA_DATADIR "data/icons/aethyra.png");
+ SDL_Surface *icon = IMG_Load(TMW_DATADIR "data/icons/tmw.png");
if (icon)
{
SDL_SetAlpha(icon, SDL_SRCALPHA, SDL_ALPHA_OPAQUE);
@@ -492,7 +492,7 @@ void exit_engine()
void printHelp()
{
std::cout
- << _("aethyra") << std::endl << std::endl
+ << _("tmw") << std::endl << std::endl
<< _("Options: ") << std::endl
<< _(" -C --configfile : Configuration file to use") << std::endl
<< _(" -d --data : Directory to load game data from") << std::endl
@@ -509,11 +509,10 @@ void printHelp()
void printVersion()
{
#ifdef PACKAGE_VERSION
- std::cout << _("Aethyra version ") << PACKAGE_VERSION <<
- std::endl;
+ std::cout << _("The Mana World version ") << PACKAGE_VERSION << std::endl;
#else
- std::cout << _("Aethyra version ") <<
- _("(local build?, PACKAGE_VERSION is not defined)") << std::endl;
+ std::cout << _("The Mana World version ") <<
+ _"(local build?, PACKAGE_VERSION is not defined)") << std::endl;
#endif
}
@@ -737,11 +736,14 @@ int main(int argc, char *argv[])
#if ENABLE_NLS
#ifdef WIN32
putenv(("LANG=" + std::string(_nl_locale_name_default())).c_str());
+ // mingw doesn't like LOCALEDIR to be defined for some reason
+ bindtextdomain("tmw", "translations/");
+#else
+ bindtextdomain("tmw", LOCALEDIR);
#endif
setlocale(LC_MESSAGES, "");
- bindtextdomain("aethyra", LOCALEDIR);
- bind_textdomain_codeset("aethyra", "UTF-8");
- textdomain("aethyra");
+ bind_textdomain_codeset("tmw", "UTF-8");
+ textdomain("tmw");
#endif
// Initialize libxml2 and check for potential ABI mismatches between
@@ -796,8 +798,8 @@ int main(int argc, char *argv[])
if (!options.password.empty()) {
loginData.password = options.password;
}
- loginData.hostname = config.getValue("host", "www.aethyra.org");
- loginData.port = (short)config.getValue("port", 21001);
+ loginData.hostname = config.getValue("host", "server.themanaworld.org");
+ loginData.port = (short)config.getValue("port", 6901);
loginData.remember = config.getValue("remember", 0);
loginData.registerLogin = false;
@@ -870,7 +872,7 @@ int main(int argc, char *argv[])
if (graphics->getWidth() > login_wallpaper->getWidth() ||
graphics->getHeight() > login_wallpaper->getHeight())
{
- graphics->setColor(gcn::Color(255, 255, 255));
+ graphics->setColor(gcn::Color(64, 64, 64));
graphics->fillRectangle(gcn::Rectangle(
0, 0, graphics->getWidth(), graphics->getHeight()));
}
@@ -958,15 +960,15 @@ int main(int argc, char *argv[])
case CHAR_SERVER_STATE:
logger->log("State: CHAR_SERVER");
- if (n_server == 1)
+ if (n_server == 1)
{
SERVER_INFO *si = *server_info;
loginData.hostname = iptostring(si->address);
loginData.port = si->port;
loginData.updateHost = si->updateHost;
state = UPDATE_STATE;
- }
- else
+ }
+ else
{
int nextState = (options.skipUpdate) ?
LOADDATA_STATE : UPDATE_STATE;
@@ -974,7 +976,7 @@ int main(int argc, char *argv[])
nextState);
positionDialog(currentDialog, screenWidth,
screenHeight);
- if (options.chooseDefault || options.playername != "")
+ if (options.chooseDefault || options.playername != "")
{
((ServerSelectDialog*) currentDialog)->action(
gcn::ActionEvent(NULL, "ok"));
@@ -984,8 +986,8 @@ int main(int argc, char *argv[])
case CHAR_SELECT_STATE:
logger->log("State: CHAR_SELECT");
currentDialog = new CharSelectDialog(network, &charInfo,
- (loginData.sex == 0) ?
- GENDER_FEMALE : GENDER_MALE);
+ (loginData.sex == 0) ?
+ GENDER_FEMALE : GENDER_MALE);
positionDialog(currentDialog, screenWidth, screenHeight);
if (((CharSelectDialog*) currentDialog)->