summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2008-04-18 20:01:21 +0000
committerYohann Ferreira <bertram@cegetel.net>2008-04-18 20:01:21 +0000
commitdacb4895bd1985c1ac969767fc483f9200b343c8 (patch)
tree40562d6e1dcaed9956152089db98316974a99e99 /src/main.cpp
parent4371c8c1ffcf24e8d5a7cf2ec126be239cab3d76 (diff)
downloadmana-dacb4895bd1985c1ac969767fc483f9200b343c8.tar.gz
mana-dacb4895bd1985c1ac969767fc483f9200b343c8.tar.bz2
mana-dacb4895bd1985c1ac969767fc483f9200b343c8.tar.xz
mana-dacb4895bd1985c1ac969767fc483f9200b343c8.zip
Added a change password dialog. State code is to be reworked.
(Once again, I need feedback. Thanks!)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a1146c27..55a3d425 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -552,6 +552,14 @@ void accountUnRegister(LoginData *loginData)
}
+void accountChangePassword(LoginData *loginData)
+{
+ Net::registerHandler(&loginHandler);
+
+ Net::AccountServer::Account::changePassword(loginData->password,
+ loginData->newPassword);
+}
+
void switchCharacter(std::string* passToken)
{
Net::registerHandler(&logoutHandler);
@@ -721,7 +729,7 @@ int main(int argc, char *argv[])
gcn::Container *top = static_cast<gcn::Container*>(gui->getTop());
#ifdef PACKAGE_VERSION
gcn::Label *versionLabel = new gcn::Label(PACKAGE_VERSION);
- top->add(versionLabel, 2, 2);
+ top->add(versionLabel, 25, 2);
#endif
sound.playMusic("Magick - Real.ogg");
@@ -967,6 +975,20 @@ int main(int argc, char *argv[])
break;
+ case STATE_CHANGEPASSWORD_ATTEMPT:
+ logger->log("State: CHANGE PASSWORD ATTEMPT");
+ accountChangePassword(&loginData);
+ break;
+
+ case STATE_CHANGEPASSWORD:
+ logger->log("State: CHANGE PASSWORD");
+ currentDialog = new OkDialog("Password change",
+ "Password changed successfully!");
+ loginData.password = loginData.newPassword;
+ loginData.newPassword = "";
+ state = STATE_LOGIN;
+ break;
+
case STATE_UNREGISTER_ATTEMPT:
logger->log("State: UNREGISTER ATTEMPT");
accountUnRegister(&loginData);
@@ -976,7 +998,7 @@ int main(int argc, char *argv[])
case STATE_UNREGISTER:
logger->log("State: UNREGISTER");
accountServerConnection->disconnect();
- currentDialog = new OkDialog("Unregister succesfull",
+ currentDialog = new OkDialog("Unregister successful",
"Farewell, come back any time ....");
//The errorlistener sets the state to STATE_CHOOSE_SERVER