source:
code/trunk/src/network/Server.h
@
1053
Last change on this file since 1053 was 1021, checked in by bknecht, 17 years ago | |
---|---|
File size: 1.1 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 | ||
[673] | 13 | #ifndef _Server_H__ |
14 | #define _Server_H__ | |
[230] | 15 | |
16 | #include <string> | |
17 | ||
[777] | 18 | #include "NetworkPrereqs.h" |
[230] | 19 | |
[1021] | 20 | #include "core/Tickable.h" |
21 | #include "PacketManager.h" | |
22 | ||
23 | ||
24 | ||
[777] | 25 | namespace network |
26 | { | |
[230] | 27 | /** |
[777] | 28 | * This class is the root class of the network module for a server. |
29 | * It implements all functions necessary for a Server | |
30 | */ | |
[1021] | 31 | class _NetworkExport Server : public PacketDecoder, public orxonox::Tickable{ |
[777] | 32 | public: |
[230] | 33 | Server(); |
34 | Server(int port, std::string bindAddress); | |
35 | Server(int port, const char *bindAddress); | |
[369] | 36 | void open(); |
37 | void close(); | |
38 | bool sendMSG(std::string msg); | |
39 | bool sendMSG(const char *msg); | |
[459] | 40 | void tick(float time); |
[777] | 41 | protected: |
[440] | 42 | void processQueue(); |
43 | void updateGamestate(); | |
[777] | 44 | private: |
[422] | 45 | bool sendGameState(); |
[620] | 46 | void processAck( ack *data, int clientID); |
[436] | 47 | ConnectionManager *connection; |
48 | GameStateManager *gamestates; | |
[369] | 49 | PacketGenerator packet_gen; |
[777] | 50 | |
[436] | 51 | ClientInformation *clients; |
[230] | 52 | }; |
[285] | 53 | |
54 | ||
55 | ||
[777] | 56 | |
[230] | 57 | } |
58 | ||
[673] | 59 | #endif /* _Server_H__ */ |
Note: See TracBrowser
for help on using the repository browser.