Last change
on this file since 380 was
369,
checked in by scheusso, 17 years ago
|
PacketDecoder:
Extended Class to make inheriting easier…
-added virtual function, that can be implemented by lower classes
Client:
Added some function, changed some things (input, gamestate, connectionhandling)
Server:
same as client
|
File size:
1.1 KB
|
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 | |
---|
22 | |
---|
23 | namespace network{ |
---|
24 | |
---|
25 | /** |
---|
26 | * The network/Client class |
---|
27 | * This class implements all necessary function for the network communication |
---|
28 | * It is the root class of the network module |
---|
29 | * |
---|
30 | */ |
---|
31 | class Client : PacketDecoder{ |
---|
32 | public: |
---|
33 | Client(); |
---|
34 | Client(std::string address, int port); |
---|
35 | Client(const char *address, int port); |
---|
36 | |
---|
37 | bool establishConnection(); |
---|
38 | bool closeConnection(); |
---|
39 | |
---|
40 | bool sendMouse(double x, double y); |
---|
41 | bool sendKeyboard(char key_code); |
---|
42 | |
---|
43 | bool addMouse(double x, double y); |
---|
44 | bool addKeyboard(char key_code); |
---|
45 | |
---|
46 | bool sendPackets(); |
---|
47 | |
---|
48 | void update(); |
---|
49 | |
---|
50 | private: |
---|
51 | ClientConnection client_connection; |
---|
52 | PacketGenerator pck_gen; |
---|
53 | GameStateManager gamestate; |
---|
54 | bool isConnected; |
---|
55 | |
---|
56 | // implement data processing functions of PacketDecoder |
---|
57 | void processGamestate( GameState *data); |
---|
58 | }; |
---|
59 | |
---|
60 | } |
---|
61 | |
---|
62 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.