Last change
on this file since 336 was
285,
checked in by nicolasc, 17 years ago
|
cleaned up network, builds with CML
|
File size:
992 bytes
|
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 | |
---|
21 | |
---|
22 | namespace network{ |
---|
23 | |
---|
24 | /** |
---|
25 | * The network/Client class |
---|
26 | * This class implements all necessary function for the network communication |
---|
27 | * It is the root class of the network module |
---|
28 | * |
---|
29 | */ |
---|
30 | class Client : PacketDecoder{ |
---|
31 | public: |
---|
32 | Client(); |
---|
33 | Client(std::string address, int port); |
---|
34 | Client(const char *address, int port); |
---|
35 | |
---|
36 | bool establishConnection(); |
---|
37 | bool closeConnection(); |
---|
38 | |
---|
39 | bool sendMouse(double x, double y); |
---|
40 | bool sendKeyboard(char key_code); |
---|
41 | |
---|
42 | bool addMouse(double x, double y); |
---|
43 | bool addKeyboard(char key_code); |
---|
44 | |
---|
45 | void update(); |
---|
46 | |
---|
47 | private: |
---|
48 | ClientConnection client_connection; |
---|
49 | PacketGenerator pck_gen; |
---|
50 | |
---|
51 | //const char *server_address; |
---|
52 | //int port; |
---|
53 | bool isConnected; |
---|
54 | }; |
---|
55 | |
---|
56 | } |
---|
57 | |
---|
58 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.