Last change
on this file since 448 was
440,
checked in by scheusso, 17 years ago
|
added dummyserver3.cc (implements a chatserver, including main)
|
File size:
1.0 KB
|
Rev | Line | |
---|
[230] | 1 | // |
---|
| 2 | // C++ Interface: Server |
---|
| 3 | // |
---|
[285] | 4 | // Description: |
---|
[230] | 5 | // |
---|
| 6 | // |
---|
| 7 | // Author: Oliver Scheuss, (C) 2007 |
---|
| 8 | // |
---|
| 9 | // Copyright: See COPYING file that comes with this distribution |
---|
| 10 | // |
---|
| 11 | // |
---|
| 12 | |
---|
| 13 | #ifndef NETWORK_SERVER_H |
---|
| 14 | #define NETWORK_SERVER_H |
---|
| 15 | |
---|
| 16 | #include <string> |
---|
| 17 | |
---|
[285] | 18 | #include "ConnectionManager.h" |
---|
| 19 | #include "PacketManager.h" |
---|
[413] | 20 | #include "GameStateManager.h" |
---|
[369] | 21 | #include "enet/enet.h" |
---|
[436] | 22 | #include "ClientInformation.h" |
---|
[230] | 23 | |
---|
| 24 | namespace network{ |
---|
[285] | 25 | |
---|
[230] | 26 | /** |
---|
| 27 | * This class is the root class of the network module for a server. |
---|
| 28 | * It implements all functions necessary for a Server |
---|
| 29 | */ |
---|
| 30 | class Server : PacketDecoder{ |
---|
| 31 | public: |
---|
| 32 | Server(); |
---|
| 33 | Server(int port, std::string bindAddress); |
---|
| 34 | Server(int port, const char *bindAddress); |
---|
[369] | 35 | void open(); |
---|
| 36 | void close(); |
---|
| 37 | bool sendMSG(std::string msg); |
---|
| 38 | bool sendMSG(const char *msg); |
---|
| 39 | void tick(); |
---|
[440] | 40 | protected: |
---|
| 41 | void processQueue(); |
---|
| 42 | void updateGamestate(); |
---|
[230] | 43 | private: |
---|
[422] | 44 | bool sendGameState(); |
---|
[436] | 45 | ConnectionManager *connection; |
---|
| 46 | GameStateManager *gamestates; |
---|
[369] | 47 | PacketGenerator packet_gen; |
---|
[380] | 48 | |
---|
[436] | 49 | ClientInformation *clients; |
---|
[230] | 50 | }; |
---|
[285] | 51 | |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | |
---|
[230] | 56 | } |
---|
| 57 | |
---|
| 58 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.