Mana
Loading...
Searching...
No Matches
loginhandler.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "net/loginhandler.h"
25
27
28class LoginData;
29
30namespace ManaServ {
31
32class LoginHandler final : public MessageHandler, public Net::LoginHandler
33{
34 public:
36
37 void handleMessage(MessageIn &msg) override;
38
39 void connect() override;
40
41 bool isConnected() override;
42
43 void disconnect() override;
44
45 int supportedOptionalActions() const override
47
48 bool isRegistrationEnabled() override;
49
50 void getRegistrationDetails() override;
51
52 unsigned int getMinUserNameLength() const override;
53
54 unsigned int getMaxUserNameLength() const override;
55
56 void loginAccount(LoginData *loginData) override;
57
58 void logout() override;
59
60 void changeEmail(const std::string &email) override;
61
62 void changePassword(const std::string &username,
63 const std::string &oldPassword,
64 const std::string &newPassword) override;
65
66 void chooseServer(unsigned int server) override;
67
68 void registerAccount(LoginData *loginData) override;
69
70 void unregisterAccount(const std::string &username,
71 const std::string &password) override;
72
73 Worlds getWorlds() const override;
74
75 void reconnect();
76
77 private:
81
82 void readServerInfo(MessageIn &msg);
83
85
87 std::string mTmpPassword;
88 unsigned int mMinUserNameLength;
89 unsigned int mMaxUserNameLength;
90};
91
92} // namespace ManaServ
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
int supportedOptionalActions() 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 connect() override
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.
Definition messagein.h:37
LoginData loginData
Definition client.cpp:95
std::vector< WorldInfo * > Worlds
Definition worldinfo.h:35