Last change
on this file since 670 was
620,
checked in by scheusso, 17 years ago
|
gamestatehandling, error correction
|
File size:
1.2 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" |
---|
[620] | 20 | #include "PacketTypes.h" |
---|
[413] | 21 | #include "GameStateManager.h" |
---|
[436] | 22 | #include "ClientInformation.h" |
---|
[475] | 23 | //#include "enet/enet.h" |
---|
[459] | 24 | //#include "NetworkFrameListener.h" |
---|
[230] | 25 | |
---|
[459] | 26 | |
---|
[230] | 27 | namespace network{ |
---|
[285] | 28 | |
---|
[459] | 29 | |
---|
[230] | 30 | /** |
---|
| 31 | * This class is the root class of the network module for a server. |
---|
| 32 | * It implements all functions necessary for a Server |
---|
| 33 | */ |
---|
[477] | 34 | class Server : public PacketDecoder{ |
---|
[230] | 35 | public: |
---|
| 36 | Server(); |
---|
| 37 | Server(int port, std::string bindAddress); |
---|
| 38 | Server(int port, const char *bindAddress); |
---|
[369] | 39 | void open(); |
---|
| 40 | void close(); |
---|
| 41 | bool sendMSG(std::string msg); |
---|
| 42 | bool sendMSG(const char *msg); |
---|
[459] | 43 | void tick(float time); |
---|
[440] | 44 | protected: |
---|
| 45 | void processQueue(); |
---|
| 46 | void updateGamestate(); |
---|
[230] | 47 | private: |
---|
[422] | 48 | bool sendGameState(); |
---|
[620] | 49 | void processAck( ack *data, int clientID); |
---|
[436] | 50 | ConnectionManager *connection; |
---|
| 51 | GameStateManager *gamestates; |
---|
[369] | 52 | PacketGenerator packet_gen; |
---|
[380] | 53 | |
---|
[436] | 54 | ClientInformation *clients; |
---|
[230] | 55 | }; |
---|
[459] | 56 | |
---|
[285] | 57 | |
---|
| 58 | |
---|
| 59 | |
---|
[230] | 60 | } |
---|
| 61 | |
---|
| 62 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.