Changeset 777 for code/branches/FICN/src/network/Client.h
- Timestamp:
- Dec 31, 2007, 7:40:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/Client.h
r774 r777 16 16 #include <string> 17 17 18 #include "NetworkPrereqs.h" 18 19 #include "ClientConnection.h" 19 20 #include "PacketManager.h" 20 21 #include "GameStateClient.h" 21 #include "core/CoreIncludes.h"22 22 //#include "NetworkFrameListener.h" 23 23 24 24 25 namespace network{ 25 namespace network 26 { 27 /** 28 network::Client *client; 29 * The network/Client class 30 * This class implements all necessary function for the network communication 31 * It is the root class of the network module 32 * 33 */ 34 class _NetworkExport Client : PacketDecoder{ 35 public: 36 Client(); 37 Client(std::string address, int port); 38 Client(const char *address, int port); 26 39 40 bool establishConnection(); 41 bool closeConnection(); 27 42 28 29 /** 30 network::Client *client; 31 * The network/Client class 32 * This class implements all necessary function for the network communication 33 * It is the root class of the network module 34 * 35 */ 36 class Client : PacketDecoder{ 37 public: 38 Client(); 39 Client(std::string address, int port); 40 Client(const char *address, int port); 43 bool sendMouse(double x, double y); 44 bool sendKeyboard(char key_code); 45 bool sendChat( std::string message ); 41 46 42 bool establishConnection();43 bool closeConnection();47 bool addMouse(double x, double y); 48 bool addKeyboard(char key_code); 44 49 45 bool sendMouse(double x, double y); 46 bool sendKeyboard(char key_code); 47 bool sendChat( std::string message ); 50 bool sendPackets(); 48 51 49 bool addMouse(double x, double y); 50 bool addKeyboard(char key_code); 51 52 bool sendPackets(); 53 54 void tick(float time); 52 void tick(float time); 55 53 56 54 private: 57 ClientConnection client_connection;58 PacketGenerator pck_gen;59 GameStateClient gamestate;60 bool isConnected;61 62 // implement data processing functions of PacketDecoder63 void processGamestate( GameStateCompressed *data);64 void processClassid(classid *clid);65 void processChat( chat *data);66 };55 ClientConnection client_connection; 56 PacketGenerator pck_gen; 57 GameStateClient gamestate; 58 bool isConnected; 59 60 // implement data processing functions of PacketDecoder 61 void processGamestate( GameStateCompressed *data); 62 void processClassid(classid *clid); 63 void processChat( chat *data); 64 }; 67 65 68 66
Note: See TracChangeset
for help on using the changeset viewer.