From c99347bf9108367c02dcbdebadec0b978a750c57 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sat, 4 Sep 2010 23:50:20 +0200 Subject: Fixing segmentation fault if server is given on command line If server and port was given on the command line, then the server type was unknown. The command line options do work now, but only if standard ports 6901 and 9601 are used. This resolves http://bugs.manasource.org/view.php?id=177 TODO: Query the server about itself and choose the server type based on that. Reviewed-by: Jaxad0127 --- src/client.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index b63550e6..3946d0f9 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -604,11 +604,13 @@ int Client::exec() case STATE_CHOOSE_SERVER: logger->log("State: CHOOSE SERVER"); - // Allow changing this using a server choice dialog - // We show the dialog box only if the command-line - // options weren't set. - if (mOptions.serverName.empty() && mOptions.serverPort == 0 - && !branding.getValue("onlineServerList", "a").empty()) + // If a server was passed on the command line, or branding + // provides a server and a blank server list, we skip the + // server selection dialog. + if (mOptions.serverName.empty() || mOptions.serverPort == 0 + || !(!branding.getValue("defaultServer","").empty() && + branding.getValue("defaultPort",0) && + branding.getValue("onlineServerList", "").empty())) { // Don't allow an alpha opacity // lower than the default value -- cgit v1.2.3-60-g2f50 From 4092dbd156f84e00c1603274f534963d9f98667f Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Tue, 7 Sep 2010 22:22:27 +0200 Subject: Fixing logic that decides if ServerDialog shows up --- src/client.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 3946d0f9..5488d8ad 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -607,19 +607,10 @@ int Client::exec() // If a server was passed on the command line, or branding // provides a server and a blank server list, we skip the // server selection dialog. - if (mOptions.serverName.empty() || mOptions.serverPort == 0 - || !(!branding.getValue("defaultServer","").empty() && - branding.getValue("defaultPort",0) && - branding.getValue("onlineServerList", "").empty())) - { - // Don't allow an alpha opacity - // lower than the default value - Theme::instance()->setMinimumOpacity(0.8f); - - mCurrentDialog = new ServerDialog(&mCurrentServer, - mConfigDir); - } - else + if ((!mOptions.serverName.empty() && mOptions.serverPort) + || (!branding.getValue("defaultServer","").empty() && + branding.getValue("defaultPort",0) && + branding.getValue("onlineServerList", "").empty())) { mState = STATE_CONNECT_SERVER; @@ -628,6 +619,15 @@ int Client::exec() mOptions.serverName.clear(); mOptions.serverPort = 0; } + else + { + // Don't allow an alpha opacity + // lower than the default value + Theme::instance()->setMinimumOpacity(0.8f); + + mCurrentDialog = new ServerDialog(&mCurrentServer, + mConfigDir); + } break; case STATE_CONNECT_SERVER: -- cgit v1.2.3-60-g2f50 From 81dd53a536f3f76636b058250750a661911a94ea Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sat, 11 Sep 2010 20:25:24 +0200 Subject: Fixing misspelling in Setup_Video and removing empty lines from log Reviewed-by: Jaxad0127 --- src/client.cpp | 2 +- src/gui/serverdialog.cpp | 2 +- src/gui/setup_video.cpp | 6 +++--- src/net/tmwa/guildhandler.cpp | 2 +- src/net/tmwa/network.cpp | 2 +- src/net/tmwa/partyhandler.cpp | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 5488d8ad..482bb9dc 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -961,7 +961,7 @@ int Client::exec() case STATE_ERROR: logger->log("State: ERROR"); - logger->log("Error: %s\n", errorMessage.c_str()); + logger->log("Error: %s", errorMessage.c_str()); mCurrentDialog = new OkDialog(_("Error"), errorMessage); mCurrentDialog->addActionListener(&errorListener); mCurrentDialog = NULL; // OkDialog deletes itself diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 0762b00f..09ba7cd1 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -676,7 +676,7 @@ int ServerDialog::downloadUpdate(void *ptr, DownloadStatus status, } else if (status < 0) { - logger->log("Error retreiving server list: %s\n", + logger->log("Error retreiving server list: %s", sd->mDownload->getError()); sd->mDownloadStatus = DOWNLOADING_ERROR; } diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 81ce8107..b576f302 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -224,11 +224,11 @@ Setup_Video::Setup_Video(): mParticleEffectsCheckBox(new CheckBox(_("Particle effects"), mParticleEffectsEnabled)), mNameCheckBox(new CheckBox(_("Show own name"), mNameEnabled)), - mNPCLogCheckBox(new CheckBox(_("Log NPC interations"), mNPCLogEnabled)), + mNPCLogCheckBox(new CheckBox(_("Log NPC interactions"), mNPCLogEnabled)), mPickupNotifyLabel(new Label(_("Show pickup notification"))), - // TRANSLATORS: Refers to "Show own name" + // TRANSLATORS: Refers to "Show pickup notification" mPickupChatCheckBox(new CheckBox(_("in chat"), mPickupChatEnabled)), - // TRANSLATORS: Refers to "Show own name" + // TRANSLATORS: Refers to "Show pickup notification" mPickupParticleCheckBox(new CheckBox(_("as particle"), mPickupParticleEnabled)), mSpeechSlider(new Slider(0, 3)), diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index 8a106841..dac57b64 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -118,7 +118,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg) msg.readInt8(); // Unused std::string guildName = msg.readString(24); - logger->log("Guild position info: %d %d %d %s\n", guildId, + logger->log("Guild position info: %d %d %d %s", guildId, emblem, posMode, guildName.c_str()); } break; diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index ddfbbc5d..aff19b11 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -326,7 +326,7 @@ MessageIn Network::getNextMessage() len = readWord(2); #ifdef DEBUG - logger->log("Received packet 0x%x of length %d\n", msgId, len); + logger->log("Received packet 0x%x of length %d", msgId, len); #endif MessageIn msg(mInBuffer, len); diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index a88a27b6..611fe3e6 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -189,7 +189,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) partyTab->chatLog(_("Experience sharing not possible."), BY_SERVER); break; default: - logger->log("Unknown party exp option: %d\n", exp); + logger->log("Unknown party exp option: %d", exp); } switch (item) @@ -213,7 +213,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) partyTab->chatLog(_("Item sharing not possible."), BY_SERVER); break; default: - logger->log("Unknown party item option: %d\n", exp); + logger->log("Unknown party item option: %d", exp); } break; } -- cgit v1.2.3-60-g2f50 From 60f16fea6c08f419bfd3d852ec3696bedfe09196 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sun, 12 Sep 2010 00:07:55 +0200 Subject: Deactivating OpenGL by default on Windows For Linux OpenGL was already deactivated. For OSX it is still by default switched on. Reviewed-by: Jaxad0127 --- src/client.cpp | 2 +- src/gui/setup_video.cpp | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 482bb9dc..8def205b 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1090,7 +1090,7 @@ void Client::initConfiguration() { // Fill configuration with defaults config.setValue("hwaccel", false); -#if (defined __APPLE__ || defined WIN32) && defined USE_OPENGL +#if defined __APPLE__ && defined USE_OPENGL config.setValue("opengl", true); #else config.setValue("opengl", false); diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index b576f302..b14a8654 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -440,8 +440,18 @@ void Setup_Video::apply() config.setValue("opengl", mOpenGLCheckBox->isSelected()); // OpenGL can currently only be changed by restarting, notify user. - new OkDialog(_("Changing to OpenGL"), - _("Applying change to OpenGL requires restart.")); + if (mOpenGLCheckBox->isSelected()) + { + new OkDialog(_("Changing to OpenGL"), + _("Applying change to OpenGL requires restart. " + "In case OpenGL messes up your game graphics, restart " + "the game with the command line option \"--no-opengl\".")); + } + else + { + new OkDialog(_("Deactivating OpenGL"), + _("Applying change to OpenGL requires restart.")); + } } mFps = mFpsCheckBox->isSelected() ? (int) mFpsSlider->getValue() : 0; -- cgit v1.2.3-60-g2f50