Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
NetAdminServer.h
Go to the documentation of this file.
1
/* Project Starshatter 4.5
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: Stars.exe
6
FILE: NetAdminServer.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
HTTP Servlet Engine for Multiplayer Admin
13
*/
14
15
16
#ifndef NetAdminServer_h
17
#define NetAdminServer_h
18
19
#include "
HttpServletExec.h
"
20
#include "
HttpServlet.h
"
21
22
// +-------------------------------------------------------------------+
23
24
class
Mission
;
25
class
MissionElement
;
26
class
NetChatEntry
;
27
class
NetUser
;
28
29
// +-------------------------------------------------------------------+
30
31
class
NetAdminServer
:
public
HttpServletExec
32
{
33
public
:
34
virtual
~NetAdminServer
();
35
36
int
operator ==
(
const
NetAdminServer
& s)
const
{
return
this
== &s; }
37
38
virtual
HttpServlet
*
GetServlet
(
HttpRequest
& request);
39
40
virtual
void
AddUser
(
NetUser
* user);
41
virtual
void
DelUser
(
NetUser
* user);
42
virtual
int
NumUsers
();
43
virtual
bool
HasHost
();
44
virtual
List<NetUser>
&
GetUsers
();
45
46
virtual
NetUser
*
FindUserBySession
(
Text
id
);
47
48
virtual
void
AddChat
(
NetUser
* user,
const
char
* msg);
49
ListIter<NetChatEntry>
GetChat
();
50
DWORD
GetStartTime
()
const
{
return
start_time
; }
51
52
virtual
void
GameOn
() { }
53
virtual
void
GameOff
() { }
54
55
// singleton locator:
56
static
NetAdminServer
*
GetInstance
(WORD port=0);
57
58
protected
:
59
NetAdminServer
(WORD port);
60
virtual
void
DoSyncedCheck
();
61
62
DWORD
start_time
;
63
List<NetUser>
admin_users
;
64
};
65
66
// +-------------------------------------------------------------------+
67
68
class
NetAdminServlet
:
public
HttpServlet
69
{
70
public
:
71
NetAdminServlet
();
72
virtual
~NetAdminServlet
() { }
73
74
virtual
bool
DoGet
(
HttpRequest
& request,
HttpResponse
& response);
75
virtual
bool
CheckUser
(
HttpRequest
& request,
HttpResponse
& response);
76
77
virtual
Text
GetCSS
();
78
virtual
Text
GetHead
(
const
char
* title=0);
79
virtual
Text
GetBody
();
80
virtual
Text
GetTitleBar
(
const
char
* statline=0,
const
char
* onload=0);
81
virtual
Text
GetStatLine
();
82
virtual
Text
GetCopyright
();
83
virtual
Text
GetContent
();
84
virtual
Text
GetBodyClose
();
85
86
protected
:
87
NetAdminServer
*
admin
;
88
NetUser
*
user
;
89
};
90
91
#endif NetAdminServer_h
Stars45
NetAdminServer.h
Generated on Tue Jun 5 2012 20:47:02 for Starshatter_Open by
1.8.1