@@ -71,25 +71,27 @@ class CAccount
71
71
const std::string& strIP = " " , const std::string& strSerial = " " , const SString& strHttpPassAppend = " " );
72
72
~CAccount ();
73
73
74
- bool IsRegistered () { return m_AccountType != EAccountType::Guest; }
75
- bool IsConsoleAccount () { return m_AccountType == EAccountType::Console; }
74
+ bool IsRegistered () const { return m_AccountType != EAccountType::Guest; }
75
+ bool IsConsoleAccount () const { return m_AccountType == EAccountType::Console; }
76
76
void OnLoginSuccess (const SString& strSerial, const SString& strIp);
77
77
void OnLoginHttpSuccess (const SString& strIp);
78
78
79
- const SString& GetName () { return m_strName; }
79
+ const SString& GetName () const { return m_strName; }
80
80
void SetName (const std::string& strName);
81
81
82
+ const EAccountType GetType () const { return m_AccountType; }
83
+
82
84
void SetPassword (const SString& strPassword);
83
85
bool IsPassword (const SString& strPassword, bool * pbUsedHttpPassAppend = nullptr );
84
86
SString GetPasswordHash ();
85
- const SString& GetHttpPassAppend () { return m_strHttpPassAppend; }
87
+ const SString& GetHttpPassAppend () const { return m_strHttpPassAppend; }
86
88
void SetHttpPassAppend (const SString& strHttpPassAppend);
87
89
88
- const std::string& GetIP () { return m_strIP; }
89
- const std::string& GetSerial () { return m_strSerial; }
90
- int GetID () { return m_iUserID; }
90
+ const std::string& GetIP () const { return m_strIP; }
91
+ const std::string& GetSerial () const { return m_strSerial; }
92
+ const int GetID () const { return m_iUserID; }
91
93
92
- bool HasLoadedSerialUsage ();
94
+ bool HasLoadedSerialUsage () const ;
93
95
void EnsureLoadedSerialUsage ();
94
96
std::vector<SSerialUsage>& GetSerialUsageList ();
95
97
SSerialUsage* GetSerialUsage (const SString& strSerial);
@@ -100,19 +102,19 @@ class CAccount
100
102
bool RemoveSerial (const SString& strSerial);
101
103
void RemoveUnauthorizedSerials ();
102
104
103
- CClient* GetClient () { return m_pClient; }
105
+ CClient* GetClient () const { return m_pClient; }
104
106
void SetClient (CClient* pClient);
105
107
106
108
void SetChanged (bool bChanged) { m_bChanged = bChanged; }
107
- bool HasChanged () { return m_bChanged; }
109
+ bool HasChanged () const { return m_bChanged; }
108
110
uint GetScriptID () const { return m_uiScriptID; }
109
111
110
112
std::shared_ptr<CLuaArgument> GetData (const std::string& strKey);
111
113
bool SetData (const std::string& strKey, const std::string& strValue, int iType);
112
114
bool HasData (const std::string& strKey);
113
115
void RemoveData (const std::string& strKey);
114
- std::map<SString, CAccountData>::iterator DataBegin () { return m_Data.begin (); }
115
- std::map<SString, CAccountData>::iterator DataEnd () { return m_Data.end (); }
116
+ std::map<SString, CAccountData>::iterator begin () { return m_Data.begin (); }
117
+ std::map<SString, CAccountData>::iterator end () { return m_Data.end (); }
116
118
117
119
protected:
118
120
CAccountData* GetDataPointer (const std::string& strKey);
@@ -147,9 +149,9 @@ class CAccountData
147
149
m_iType = iType;
148
150
}
149
151
150
- const std::string& GetKey () { return m_strKey; }
151
- const std::string& GetStrValue () { return m_strValue; }
152
- int GetType () { return m_iType; }
152
+ const std::string& GetKey () const { return m_strKey; }
153
+ const std::string& GetStrValue () const { return m_strValue; }
154
+ int GetType () const { return m_iType; }
153
155
void SetStrValue (const std::string& strValue) { m_strValue = strValue; }
154
156
void SetType (int iType) { m_iType = iType; }
155
157
0 commit comments