summaryrefslogtreecommitdiff
path: root/src/net/eathena/loginhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-31 00:21:25 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:53 +0300
commitb2db639b28d2183d18ba189d5b937605e0a73ae1 (patch)
tree9a730bf6019b18993183a083f513fe00a4323390 /src/net/eathena/loginhandler.cpp
parentaabe4a58a300b9b9c8599b91b232542589fe0a01 (diff)
downloadmv-b2db639b28d2183d18ba189d5b937605e0a73ae1.tar.gz
mv-b2db639b28d2183d18ba189d5b937605e0a73ae1.tar.bz2
mv-b2db639b28d2183d18ba189d5b937605e0a73ae1.tar.xz
mv-b2db639b28d2183d18ba189d5b937605e0a73ae1.zip
In eathena add support for error packet 0x083e.
Also extend packets table.
Diffstat (limited to 'src/net/eathena/loginhandler.cpp')
-rw-r--r--src/net/eathena/loginhandler.cpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp
index a1843b5bf..150b47b91 100644
--- a/src/net/eathena/loginhandler.cpp
+++ b/src/net/eathena/loginhandler.cpp
@@ -25,10 +25,13 @@
#include "client.h"
#include "logger.h"
+#include "gui/windows/logindialog.h"
+
#include "net/eathena/messageout.h"
#include "net/eathena/network.h"
#include "net/eathena/protocol.h"
+#include "utils/gettext.h"
#include "utils/paths.h"
#include "debug.h"
@@ -50,6 +53,7 @@ LoginHandler::LoginHandler() :
SMSG_UPDATE_HOST2,
SMSG_LOGIN_DATA,
SMSG_LOGIN_ERROR,
+ SMSG_LOGIN_ERROR2,
SMSG_CHAR_PASSWORD_RESPONSE,
SMSG_SERVER_VERSION_RESPONSE,
0
@@ -86,6 +90,10 @@ void LoginHandler::handleMessage(Net::MessageIn &msg)
processLoginError(msg);
break;
+ case SMSG_LOGIN_ERROR2:
+ processLoginError2(msg);
+ break;
+
case SMSG_SERVER_VERSION_RESPONSE:
processServerVersion(msg);
break;
@@ -197,4 +205,78 @@ void LoginHandler::processUpdateHost2(Net::MessageIn &msg) const
client->setState(STATE_LOGIN);
}
+void LoginHandler::processLoginError2(Net::MessageIn &msg) const
+{
+ const uint32_t code = msg.readInt32();
+ logger->log("Login::error code: %u", code);
+
+ switch (code)
+ {
+ case 0:
+ // TRANSLATORS: error message
+ errorMessage = _("Unregistered ID.");
+ break;
+ case 1:
+ // TRANSLATORS: error message
+ errorMessage = _("Wrong password.");
+ LoginDialog::savedPassword.clear();
+ break;
+ case 2:
+ // TRANSLATORS: error message
+ errorMessage = _("Account expired.");
+ break;
+ case 3:
+ // TRANSLATORS: error message
+ errorMessage = _("Rejected from server.");
+ break;
+ case 4:
+ // TRANSLATORS: error message
+ errorMessage = _("You have been permanently banned from "
+ "the game. Please contact the GM team.");
+ break;
+ case 5:
+ // TRANSLATORS: error message
+ errorMessage = _("Client too old.");
+ break;
+ case 6:
+ // TRANSLATORS: error message
+ errorMessage = strprintf(_("You have been temporarily "
+ "banned from the game until "
+ "%s.\nPlease contact the GM "
+ "team via the forums."),
+ msg.readString(20).c_str());
+ break;
+ case 7:
+ // look like unused
+ // TRANSLATORS: error message
+ errorMessage = _("Server overpopulated.");
+ break;
+ case 9:
+ // look like unused
+ // TRANSLATORS: error message
+ errorMessage = _("This user name is already taken.");
+ break;
+ case 10:
+ // look like unused
+ // TRANSLATORS: error message
+ errorMessage = _("Wrong name.");
+ break;
+ case 11:
+ // look like unused
+ // TRANSLATORS: error message
+ errorMessage = _("Incorrect email.");
+ break;
+ case 99:
+ // look like unused
+ // TRANSLATORS: error message
+ errorMessage = _("Username permanently erased.");
+ break;
+ default:
+ // TRANSLATORS: error message
+ errorMessage = _("Unknown error.");
+ break;
+ }
+ client->setState(STATE_ERROR);
+}
+
} // namespace EAthena