Line | |
---|
1 | // |
---|
2 | // C++ Interface: Client |
---|
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 NETWORK_CLIENT_H |
---|
14 | #define NETWORK_CLIENT_H |
---|
15 | |
---|
16 | #include <string> |
---|
17 | |
---|
18 | #include "ClientConnection.h" |
---|
19 | #include "PacketManager.h" |
---|
20 | #include "GameStateManager.h" |
---|
21 | #include "orxonox/core/IdentifierIncludes.h" |
---|
22 | |
---|
23 | |
---|
24 | namespace network{ |
---|
25 | |
---|
26 | /** |
---|
27 | * The network/Client class |
---|
28 | * This class implements all necessary function for the network communication |
---|
29 | * It is the root class of the network module |
---|
30 | * |
---|
31 | */ |
---|
32 | class Client : PacketDecoder{ |
---|
33 | public: |
---|
34 | Client(); |
---|
35 | Client(std::string address, int port); |
---|
36 | Client(const char *address, int port); |
---|
37 | |
---|
38 | bool establishConnection(); |
---|
39 | bool closeConnection(); |
---|
40 | |
---|
41 | bool sendMouse(double x, double y); |
---|
42 | bool sendKeyboard(char key_code); |
---|
43 | |
---|
44 | bool addMouse(double x, double y); |
---|
45 | bool addKeyboard(char key_code); |
---|
46 | |
---|
47 | bool sendPackets(); |
---|
48 | |
---|
49 | void update(); |
---|
50 | |
---|
51 | private: |
---|
52 | ClientConnection client_connection; |
---|
53 | PacketGenerator pck_gen; |
---|
54 | GameStateManager gamestate; |
---|
55 | bool isConnected; |
---|
56 | |
---|
57 | // implement data processing functions of PacketDecoder |
---|
58 | void processGamestate( GameStateCompressed *data); |
---|
59 | void processClassid(classid *clid); |
---|
60 | |
---|
61 | }; |
---|
62 | |
---|
63 | } |
---|
64 | |
---|
65 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.