From 34f13f39c61fbfc0a41e5b5d49f9d9619e3f75a3 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Fri, 25 Apr 2008 23:47:50 +0000 Subject: Made the Email address change work more nicely with the server. --- src/net/accountserver/account.cpp | 3 +-- src/net/accountserver/account.h | 3 +-- src/net/loginhandler.cpp | 3 +++ src/net/protocol.h | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/net') diff --git a/src/net/accountserver/account.cpp b/src/net/accountserver/account.cpp index 2d8065b5..d1fe6863 100644 --- a/src/net/accountserver/account.cpp +++ b/src/net/accountserver/account.cpp @@ -83,8 +83,7 @@ void Net::AccountServer::Account::unregister(const std::string &username, Net::AccountServer::connection->send(msg); } -void Net::AccountServer::Account::changeEmail(const std::string &username, - const std::string &email) +void Net::AccountServer::Account::changeEmail(const std::string &email) { MessageOut msg(PAMSG_EMAIL_CHANGE); diff --git a/src/net/accountserver/account.h b/src/net/accountserver/account.h index c8604717..0cf0758e 100644 --- a/src/net/accountserver/account.h +++ b/src/net/accountserver/account.h @@ -44,8 +44,7 @@ namespace Net void unregister(const std::string &username, const std::string &password); - void changeEmail(const std::string &username, - const std::string &email); + void changeEmail(const std::string &email); void changePassword(const std::string &username, const std::string &oldPassword, diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 3a5b1c64..6840d90c 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -190,6 +190,9 @@ void LoginHandler::handleMessage(MessageIn &msg) case ERRMSG_NO_LOGIN: errorMessage = "Account not connected. Please login first."; break; + case ERRMSG_EMAIL_ALREADY_EXISTS: + errorMessage = "The new Email Address already exists."; + break; default: errorMessage = "Unknown error"; break; diff --git a/src/net/protocol.h b/src/net/protocol.h index 76610635..10c89689 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -191,7 +191,8 @@ enum { ERRMSG_NO_LOGIN, // the user is not yet logged ERRMSG_NO_CHARACTER_SELECTED, // the user needs a character ERRMSG_INSUFFICIENT_RIGHTS, // the user is not privileged - ERRMSG_INVALID_ARGUMENT // part of the received message was invalid + ERRMSG_INVALID_ARGUMENT, // part of the received message was invalid + ERRMSG_EMAIL_ALREADY_EXISTS // The Email Address already exists }; // Login specific return values -- cgit v1.2.3-70-g09d2