Mana
Loading...
Searching...
No Matches
loginhandler.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 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/logindata.h"
25#include "net/serverinfo.h"
26#include "net/worldinfo.h"
27
28namespace Net {
29
31{
32 public:
44
45 void setServer(const ServerInfo &server)
46 { mServer = server; }
47
49 { return mServer; }
50
51 virtual void connect() = 0;
52
53 virtual bool isConnected() = 0;
54
55 virtual void disconnect() = 0;
56
60 virtual int supportedOptionalActions() const = 0;
61
62 virtual bool isRegistrationEnabled() = 0;
63
64 virtual void getRegistrationDetails() = 0;
65
66 virtual unsigned int getMinUserNameLength() const { return 4; }
67
68 virtual unsigned int getMaxUserNameLength() const { return 25; }
69
70 virtual unsigned int getMinPasswordLength() const { return 4; }
71
72 virtual unsigned int getMaxPasswordLength() const { return 255; }
73
74 virtual void loginAccount(LoginData *loginData) = 0;
75
76 virtual void logout() = 0;
77
78 virtual void changeEmail(const std::string &email) = 0;
79
80 virtual void changePassword(const std::string &username,
81 const std::string &oldPassword,
82 const std::string &newPassword) = 0;
83
84 virtual void chooseServer(unsigned int server) = 0;
85
87
88 virtual void unregisterAccount(const std::string &username,
89 const std::string &password) = 0;
90
91 virtual Worlds getWorlds() const = 0;
92
93 virtual ~LoginHandler () = default;
94
95 protected:
97};
98
99} // namespace Net
virtual unsigned int getMinUserNameLength() const
virtual void connect()=0
virtual void changePassword(const std::string &username, const std::string &oldPassword, const std::string &newPassword)=0
ServerInfo mServer
virtual bool isConnected()=0
virtual void registerAccount(LoginData *loginData)=0
void setServer(const ServerInfo &server)
virtual unsigned int getMaxPasswordLength() const
virtual void disconnect()=0
virtual void logout()=0
virtual bool isRegistrationEnabled()=0
ServerInfo getServer() const
OptionalAction
This enum describes options specific to either eAthena or Manaserv.
virtual void changeEmail(const std::string &email)=0
virtual int supportedOptionalActions() const =0
virtual Worlds getWorlds() const =0
virtual unsigned int getMaxUserNameLength() const
virtual void unregisterAccount(const std::string &username, const std::string &password)=0
virtual unsigned int getMinPasswordLength() const
virtual ~LoginHandler()=default
virtual void chooseServer(unsigned int server)=0
virtual void getRegistrationDetails()=0
virtual void loginAccount(LoginData *loginData)=0
LoginData loginData
Definition client.cpp:95
The network communication layer.
std::vector< WorldInfo * > Worlds
Definition worldinfo.h:35