summaryrefslogtreecommitdiff
path: root/src/net/tmwa/loginhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-16 13:38:32 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-16 13:38:32 +0300
commit3232aa8610c62b7e047dcf175b7d33e09bf77284 (patch)
treeac1481b4330d10c9e978e7916b964778e12c5f0a /src/net/tmwa/loginhandler.cpp
parent6010904f60d62b8f9e2861e6556374a5edd3c67a (diff)
downloadmanaverse-3232aa8610c62b7e047dcf175b7d33e09bf77284.tar.gz
manaverse-3232aa8610c62b7e047dcf175b7d33e09bf77284.tar.bz2
manaverse-3232aa8610c62b7e047dcf175b7d33e09bf77284.tar.xz
manaverse-3232aa8610c62b7e047dcf175b7d33e09bf77284.zip
Move processCharPasswordResponse from ea namespace into tmwa.
Diffstat (limited to 'src/net/tmwa/loginhandler.cpp')
-rw-r--r--src/net/tmwa/loginhandler.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 6bb484433..f3922d3f8 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -31,6 +31,8 @@
#include "net/tmwa/network.h"
#include "net/tmwa/protocol.h"
+#include "utils/gettext.h"
+
#include "debug.h"
extern Net::LoginHandler *loginHandler;
@@ -252,4 +254,40 @@ void LoginHandler::sendVersion() const
{
}
+void LoginHandler::processCharPasswordResponse(Net::MessageIn &msg)
+{
+ // 0: acc not found, 1: success, 2: password mismatch, 3: pass too short
+ const uint8_t errMsg = msg.readUInt8("result code");
+ // Successful pass change
+ if (errMsg == 1)
+ {
+ client->setState(STATE_CHANGEPASSWORD_SUCCESS);
+ }
+ // pass change failed
+ else
+ {
+ switch (errMsg)
+ {
+ case 0:
+ errorMessage =
+ // TRANSLATORS: error message
+ _("Account was not found. Please re-login.");
+ break;
+ case 2:
+ // TRANSLATORS: error message
+ errorMessage = _("Old password incorrect.");
+ break;
+ case 3:
+ // TRANSLATORS: error message
+ errorMessage = _("New password too short.");
+ break;
+ default:
+ // TRANSLATORS: error message
+ errorMessage = _("Unknown error.");
+ break;
+ }
+ client->setState(STATE_ACCOUNTCHANGE_ERROR);
+ }
+}
+
} // namespace TmwAthena