Last change
on this file since 2086 was
859,
checked in by landauf, 17 years ago
|
more or less a copy of the trunk
|
File size:
1.0 KB
|
Line | |
---|
1 | // |
---|
2 | // C++ Interface: Server |
---|
3 | // |
---|
4 | // Description: |
---|
5 | // |
---|
6 | // |
---|
7 | // Author: Oliver Scheuss, (C) 2007 |
---|
8 | // |
---|
9 | // Copyright: See COPYING file that comes with this distribution |
---|
10 | // |
---|
11 | // |
---|
12 | |
---|
13 | #ifndef _Server_H__ |
---|
14 | #define _Server_H__ |
---|
15 | |
---|
16 | #include <string> |
---|
17 | |
---|
18 | #include "PacketManager.h" |
---|
19 | #include "NetworkPrereqs.h" |
---|
20 | |
---|
21 | namespace network |
---|
22 | { |
---|
23 | /** |
---|
24 | * This class is the root class of the network module for a server. |
---|
25 | * It implements all functions necessary for a Server |
---|
26 | */ |
---|
27 | class _NetworkExport Server : public PacketDecoder{ |
---|
28 | public: |
---|
29 | Server(); |
---|
30 | Server(int port, std::string bindAddress); |
---|
31 | Server(int port, const char *bindAddress); |
---|
32 | void open(); |
---|
33 | void close(); |
---|
34 | bool sendMSG(std::string msg); |
---|
35 | bool sendMSG(const char *msg); |
---|
36 | void tick(float time); |
---|
37 | protected: |
---|
38 | void processQueue(); |
---|
39 | void updateGamestate(); |
---|
40 | private: |
---|
41 | bool sendGameState(); |
---|
42 | void processAck( ack *data, int clientID); |
---|
43 | ConnectionManager *connection; |
---|
44 | GameStateManager *gamestates; |
---|
45 | PacketGenerator packet_gen; |
---|
46 | |
---|
47 | ClientInformation *clients; |
---|
48 | }; |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | } |
---|
54 | |
---|
55 | #endif /* _Server_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.