Planeshift
authentserver.h
Go to the documentation of this file.
1
/*
2
* AuthentServer.h by Keith Fulton <keith@paqrat.com>
3
*
4
* Copyright (C) 2001 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5
*
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation (version 2 of the License)
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
*
18
*/
19
#ifndef __AUTHENTICATIONSERVER_H__
20
#define __AUTHENTICATIONSERVER_H__
21
22
//=============================================================================
23
// Crystal Space Includes
24
//=============================================================================
25
#include <csutil/ref.h>
26
#include <csutil/hash.h>
27
28
//=============================================================================
29
// Local Includes
30
//=============================================================================
31
#include "
msgmanager.h
"
// Parent class
32
33
class
psMsgStringsMessage
;
34
class
ClientConnectionSet
;
35
class
UserManager
;
36
class
GuildManager
;
37
class
Client
;
38
39
struct
BanEntry
40
{
41
AccountID
account
;
42
csString
ipRange
;
43
time_t
start
;
44
time_t
end
;
45
csString
reason
;
46
bool
banIP
;
47
};
48
50
class
BanManager
51
{
52
public
:
53
BanManager
();
54
~
BanManager
();
55
56
bool
RemoveBan(AccountID
account
);
57
bool
AddBan(AccountID account, csString
ipRange
, time_t duration, csString
reason
,
bool
banIP
);
58
BanEntry
* GetBanByAccount(AccountID account);
59
BanEntry
* GetBanByIPRange(csString IPRange);
60
61
protected
:
62
csHash<BanEntry*, AccountID>
banList_IDHash
;
63
csArray<BanEntry*>
banList_IPRList
;
64
};
65
76
class
AuthenticationServer
:
public
MessageManager
<AuthenticationServer>
77
{
78
public
:
79
96
AuthenticationServer
(
ClientConnectionSet
* pCCS,
97
UserManager
* usermgr,
98
GuildManager
* gm);
99
107
virtual
~
AuthenticationServer
();
108
121
void
SendDisconnect(
Client
* client,
const
char
*
reason
);
122
127
void
SendMsgStrings(
int
cnum,
bool
send_digest);
128
132
void
HandleStatusUpdate(
MsgEntry
* me,
Client
* client);
133
137
BanManager
*
GetBanManager
()
138
{
139
return
&banmanager;
140
}
141
142
143
protected
:
144
146
ClientConnectionSet
*
clients
;
147
149
UserManager
*
usermanager
;
150
152
GuildManager
*
guildmanager
;
153
155
BanManager
banmanager
;
156
160
bool
CheckAuthenticationPreCondition(
int
clientnum,
bool
netversionok,
const
char
* sUser);
161
174
void
HandleAuthent(
MsgEntry
* me,
Client
* notused);
175
179
void
HandleStringsRequest(
MsgEntry
* me,
Client
* notused);
180
186
void
HandlePreAuthent(
MsgEntry
* me,
Client
* notused);
187
197
void
HandleDisconnect(
MsgEntry
* me,
Client
* notused);
198
204
void
HandleAuthCharacter(
MsgEntry
* me,
Client
* notused);
205
};
206
207
#endif
208
BanEntry::ipRange
csString ipRange
Definition:
authentserver.h:42
AuthenticationServer::banmanager
BanManager banmanager
Manages banned users and IP ranges.
Definition:
authentserver.h:155
UserManager
Used to manage incoming user commands from a client.
Definition:
usermanager.h:53
msgmanager.h
AuthenticationServer::guildmanager
GuildManager * guildmanager
Is a manager for the guilds.
Definition:
authentserver.h:152
AuthenticationServer::usermanager
UserManager * usermanager
Is the user manager.
Definition:
authentserver.h:149
MsgEntry
The structure of 1 queue entry (pointer to a message)
Definition:
message.h:143
BanEntry::start
time_t start
Definition:
authentserver.h:43
BanEntry::end
time_t end
Definition:
authentserver.h:44
BanManager
Holds list of banned accounts and IP ranges.
Definition:
authentserver.h:50
AuthenticationServer::GetBanManager
BanManager * GetBanManager()
Get the Ban Manager that hold information regarding baned clients.
Definition:
authentserver.h:137
AuthenticationServer
Authentication handling.
Definition:
authentserver.h:76
BanEntry::banIP
bool banIP
Definition:
authentserver.h:46
psMsgStringsMessage
Message sent from server to client containing the message strings hash table.
Definition:
messages.h:2586
BanEntry::account
AccountID account
Definition:
authentserver.h:41
GuildManager
Definition:
guildmanager.h:67
Client
This class collects data of a netclient.
Definition:
client.h:95
AuthenticationServer::clients
ClientConnectionSet * clients
Holds a list of all the currently connect clients.
Definition:
authentserver.h:146
BanEntry
Definition:
authentserver.h:39
BanEntry::reason
csString reason
Definition:
authentserver.h:45
BanManager::banList_IDHash
csHash< BanEntry *, AccountID > banList_IDHash
Definition:
authentserver.h:62
ClientConnectionSet
This class is a list of several CLient objects, it's designed for finding clients very fast based on ...
Definition:
clients.h:58
BanManager::banList_IPRList
csArray< BanEntry * > banList_IPRList
Full list of all active bans.
Definition:
authentserver.h:63
MessageManager
Provides a manager to facilitate subscriptions.
Definition:
msgmanager.h:106
server
authentserver.h
Generated on Sat Jun 19 2021 05:00:33 for Planeshift by
1.8.11