summaryrefslogtreecommitdiff
path: root/src/net/charserverhandler.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-09 23:47:02 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-09 23:47:02 +0100
commitfa2f3ac593a792c32095c2e885665ec91bb4019d (patch)
treef44aee845f0229dfcc6b2ad3c74613e0352f36c2 /src/net/charserverhandler.cpp
parent07f7d52f661a74e6d0c780ca53e724651e3dcc48 (diff)
parent40edf4e91558cffd83d9015a2cf4a16360e27855 (diff)
downloadmana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.gz
mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.bz2
mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.xz
mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.zip
Merged with Aethyra master as of 2009-02-09
Conflicts: A lot of files...
Diffstat (limited to 'src/net/charserverhandler.cpp')
-rw-r--r--src/net/charserverhandler.cpp45
1 files changed, 18 insertions, 27 deletions
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp
index b04fb94a..932cf705 100644
--- a/src/net/charserverhandler.cpp
+++ b/src/net/charserverhandler.cpp
@@ -21,10 +21,8 @@
#include "charserverhandler.h"
#include "messagein.h"
-#include "network.h"
#include "protocol.h"
-#include "../extensions.h"
#include "../game.h"
#include "../localplayer.h"
#include "../log.h"
@@ -34,10 +32,8 @@
#include "../gui/char_select.h"
#include "../gui/ok_dialog.h"
-/*
- * Yeah, this is a global. Get over it.
- */
-struct EXTENSIONS extensions;
+#include "../utils/gettext.h"
+#include "../utils/tostring.h"
CharServerHandler::CharServerHandler():
mCharCreateDialog(0)
@@ -58,9 +54,7 @@ CharServerHandler::CharServerHandler():
void CharServerHandler::handleMessage(MessageIn *msg)
{
- int slot;
- int flags;
- int code;
+ int slot, flags, code;
LocalPlayer *tempPlayer;
logger->log("CharServerHandler: Packet ID: %x, Length: %d",
@@ -73,22 +67,22 @@ void CharServerHandler::handleMessage(MessageIn *msg)
switch (code) {
case 0:
- errorMessage = "Authentication failed";
+ errorMessage = _("Authentication failed");
break;
case 1:
- errorMessage = "Map server(s) offline";
+ errorMessage = _("Map server(s) offline");
break;
case 2:
- errorMessage = "This account is already logged in";
+ errorMessage = _("This account is already logged in");
break;
case 3:
- errorMessage = "Speed hack detected";
+ errorMessage = _("Speed hack detected");
break;
case 8:
- errorMessage = "Duplicated login";
+ errorMessage = _("Duplicated login");
break;
default:
- errorMessage = "Unknown connection error";
+ errorMessage = _("Unknown connection error");
break;
}
state = ERROR_STATE;
@@ -96,11 +90,8 @@ void CharServerHandler::handleMessage(MessageIn *msg)
case 0x006b:
msg->skip(2); // Length word
- flags = msg->readInt32(); // Aethyra extensions flags
+ flags = msg->readInt32(); // Aethyra extensions flags
logger->log("Server flags are: %x", flags);
- extensions.aethyra_inventory = (bool)(flags & 0x01);
- extensions.aethyra_spells = (bool)(flags & 0x02);
- extensions.aethyra_misc = (bool)(flags & 0x04);
msg->skip(16); // Unused
// Derive number of characters from message length
@@ -112,7 +103,7 @@ void CharServerHandler::handleMessage(MessageIn *msg)
mCharInfo->select(slot);
mCharInfo->setEntry(tempPlayer);
logger->log("CharServer: Player: %s (%d)",
- tempPlayer->getName().c_str(), slot);
+ tempPlayer->getName().c_str(), slot);
}
state = CHAR_SELECT_STATE;
@@ -121,13 +112,13 @@ void CharServerHandler::handleMessage(MessageIn *msg)
case 0x006c:
switch (msg->readInt8()) {
case 0:
- errorMessage = "Access denied";
+ errorMessage = _("Access denied");
break;
case 1:
- errorMessage = "Cannot use this ID";
+ errorMessage = _("Cannot use this ID");
break;
default:
- errorMessage = "Unknown failure to select character";
+ errorMessage = _("Unknown failure to select character");
break;
}
mCharInfo->unlock();
@@ -149,8 +140,8 @@ void CharServerHandler::handleMessage(MessageIn *msg)
break;
case 0x006e:
- new OkDialog("Error", "Failed to create character. Most likely"
- " the name is already taken.");
+ new OkDialog(_("Error"), _("Failed to create character. Most likely"
+ " the name is already taken."));
if (mCharCreateDialog)
mCharCreateDialog->unlock();
@@ -161,12 +152,12 @@ void CharServerHandler::handleMessage(MessageIn *msg)
mCharInfo->setEntry(0);
mCharInfo->unlock();
n_character--;
- new OkDialog("Info", "Player deleted");
+ new OkDialog(_("Info"), _("Player deleted"));
break;
case 0x0070:
mCharInfo->unlock();
- new OkDialog("Error", "Failed to delete character.");
+ new OkDialog(_("Error"), _("Failed to delete character."));
break;
case 0x0071: