ManaPlus
logindata.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef NET_LOGINDATA_H
25 #define NET_LOGINDATA_H
26 
27 #include "enums/being/gender.h"
28 
29 #include "enums/net/updatetype.h"
30 
31 #include "utils/stringvector.h"
32 
33 #include "localconsts.h"
34 
36 {
37  public:
39  username(),
40  password(),
41  newPassword(),
42  updateHost(),
43  updateHosts(),
44  lastLogin(),
46  email(),
48  registerUrl(),
50  packetVersion(0),
51  remember(false),
52  registerLogin(false),
54  {
55  }
56 
58 
59  std::string username;
60  std::string password;
61  std::string newPassword;
62  std::string updateHost;
64  std::string lastLogin;
66 
67  std::string email;
69  std::string registerUrl;
70 
72 
74  bool remember; // Whether to store the username.
75  bool registerLogin; // Whether an account is being registered.
76 
77  uint16_t characterSlots; // The number of character slots
78 
79  void clear()
80  {
81  username.clear();
82  password.clear();
83  newPassword.clear();
84  updateHost.clear();
85  updateHosts.clear();
87  email.clear();
88  captchaResponse.clear();
89  registerUrl.clear();
91  packetVersion = 0;
92  lastLogin.clear();
94  }
95 
97  {
98  updateHost.clear();
99  updateHosts.clear();
100  }
101 
106  {
107  characterSlots = 9; // Default value, used for TmwAthena.
108  }
109 };
110 
111 #endif // NET_LOGINDATA_H
GenderT gender
Definition: logindata.h:71
std::string registerUrl
Definition: logindata.h:69
std::string email
Definition: logindata.h:67
std::string updateHost
Definition: logindata.h:62
std::string lastLogin
Definition: logindata.h:64
StringVect updateHosts
Definition: logindata.h:63
int packetVersion
Definition: logindata.h:73
std::string username
Definition: logindata.h:59
void clear()
Definition: logindata.h:79
std::string password
Definition: logindata.h:60
uint16_t characterSlots
Definition: logindata.h:77
std::string newPassword
Definition: logindata.h:61
UpdateTypeT updateType
Definition: logindata.h:65
std::string captchaResponse
Definition: logindata.h:68
void resetCharacterSlots()
Definition: logindata.h:105
bool remember
Definition: logindata.h:74
LoginData()
Definition: logindata.h:38
void clearUpdateHost()
Definition: logindata.h:96
bool registerLogin
Definition: logindata.h:75
Gender ::T GenderT
Definition: gender.h:35
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
Definition: gender.h:29
@ UNSPECIFIED
Definition: gender.h:33
std::vector< std::string > StringVect
Definition: stringvector.h:29
UpdateType ::T UpdateTypeT
Definition: updatetype.h:36