46 static const Uint16 _messages[] = {
129 errorMessage =
_(
"Account not connected. Please login first.");
160 errorMessage =
_(
"Account not connected. Please login first.");
213 "Accountserver: Wrong username or password";
233 std::string captchaInstructions = msg.
readString();
235 printf(
"%s: %s\n", captchaURL.c_str(), captchaInstructions.c_str());
245 "Please contact server administration.");
314 errorMessage =
_(
"Wrong username, password or email address.");
323 errorMessage =
_(
"You took too long with the captcha or your "
324 "response was incorrect.");
341 const std::string updateHost = msg.
readString();
342 if (!updateHost.empty())
345 Log::warn(
"Server does not have an update host set!");
436 const std::string &oldPassword,
437 const std::string &newPassword)
470 const std::string &password)
static void setState(State state)
unsigned short characterSlots
The number of character slots.
std::string captchaResponse
bool isConnected()
Returns whether the server is connected.
void send(const ManaServ::MessageOut &msg)
Sends a message.
bool connect(const std::string &address, enet_uint16 port)
Connects to the given server with the specified address and port.
void disconnect()
Disconnects from the given server.
void handleMessage(MessageIn &msg) override
void unregisterAccount(const std::string &username, const std::string &password) override
void disconnect() override
unsigned int mMinUserNameLength
void loginAccount(LoginData *loginData) override
unsigned int getMaxUserNameLength() const override
unsigned int getMinUserNameLength() const override
void handleLoginRandomResponse(MessageIn &msg)
void getRegistrationDetails() override
void changePassword(const std::string &username, const std::string &oldPassword, const std::string &newPassword) override
bool isRegistrationEnabled() override
void chooseServer(unsigned int server) override
void loginAccountContinue()
void handleRegisterResponse(MessageIn &msg)
void handleLoginResponse(MessageIn &msg)
void registerAccount(LoginData *loginData) override
unsigned int mMaxUserNameLength
void readServerInfo(MessageIn &msg)
bool isConnected() override
void changeEmail(const std::string &email) override
Worlds getWorlds() const override
Used for parsing an incoming message from manaserv.
unsigned int getUnreadLength() const
Returns the length of unread data.
std::string readString(int length=-1)
Reads a string.
uint16_t getId() const
Returns the message ID.
uint8_t readInt8()
Reads an unsigned 8-bit integer from the message.
Used for building an outgoing message to manaserv.
void writeInt32(uint32_t value)
Writes an unsigned 32-bit integer to the message.
void writeString(const std::string &string, int length=-1)
Writes a string.
const uint16_t * handledMessages
@ STATE_CHANGEPASSWORD_SUCCESS
@ STATE_CHANGEEMAIL_SUCCESS
@ STATE_ACCOUNTCHANGE_ERROR
@ STATE_UNREGISTER_SUCCESS
ManaServ::LoginHandler * loginHandler
Net::LoginHandler * loginHandler
void warn(const char *log_text,...) LOG_PRINTF_ATTR
@ REGISTER_INVALID_VERSION
@ REGISTER_EXISTS_USERNAME
Connection * accountServerConnection
@ ERRMSG_INVALID_ARGUMENT
@ ERRMSG_EMAIL_ALREADY_EXISTS
@ APMSG_REGISTER_INFO_RESPONSE
@ APMSG_PASSWORD_CHANGE_RESPONSE
@ APMSG_UNREGISTER_RESPONSE
@ APMSG_EMAIL_CHANGE_RESPONSE
@ PAMSG_REQUEST_REGISTER_INFO
@ APMSG_LOGIN_RNDTRGR_RESPONSE
@ APMSG_RECONNECT_RESPONSE
@ APMSG_REGISTER_RESPONSE
std::string sha256(const std::string &string)
Returns the SHA-256 hash for the given string.
std::vector< WorldInfo * > Worlds