Rev | Line | |
---|
[229] | 1 | // |
---|
| 2 | // C++ Interface: Client |
---|
| 3 | // |
---|
[285] | 4 | // Description: |
---|
[229] | 5 | // |
---|
| 6 | // |
---|
[230] | 7 | // Author: Oliver Scheuss, (C) 2007 |
---|
[229] | 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 | |
---|
[285] | 18 | #include "ClientConnection.h" |
---|
| 19 | #include "PacketManager.h" |
---|
[413] | 20 | #include "GameStateClient.h" |
---|
[400] | 21 | #include "orxonox/core/IdentifierIncludes.h" |
---|
[229] | 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 |
---|
[285] | 30 | * |
---|
[229] | 31 | */ |
---|
| 32 | class Client : PacketDecoder{ |
---|
| 33 | public: |
---|
| 34 | Client(); |
---|
| 35 | Client(std::string address, int port); |
---|
| 36 | Client(const char *address, int port); |
---|
[285] | 37 | |
---|
[229] | 38 | bool establishConnection(); |
---|
| 39 | bool closeConnection(); |
---|
[285] | 40 | |
---|
[229] | 41 | bool sendMouse(double x, double y); |
---|
| 42 | bool sendKeyboard(char key_code); |
---|
[285] | 43 | |
---|
[229] | 44 | bool addMouse(double x, double y); |
---|
| 45 | bool addKeyboard(char key_code); |
---|
[285] | 46 | |
---|
[369] | 47 | bool sendPackets(); |
---|
| 48 | |
---|
[229] | 49 | void update(); |
---|
[285] | 50 | |
---|
[229] | 51 | private: |
---|
| 52 | ClientConnection client_connection; |
---|
| 53 | PacketGenerator pck_gen; |
---|
[413] | 54 | GameStateClient gamestate; |
---|
[229] | 55 | bool isConnected; |
---|
[369] | 56 | |
---|
| 57 | // implement data processing functions of PacketDecoder |
---|
[405] | 58 | void processGamestate( GameStateCompressed *data); |
---|
[400] | 59 | void processClassid(classid *clid); |
---|
[425] | 60 | void processChat( chat *data); |
---|
[229] | 61 | }; |
---|
| 62 | |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.