Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/network/Client.h @ 774

Last change on this file since 774 was 774, checked in by rgrieder, 16 years ago
  • changed executable from main to orxonox
  • added src/orxonox to the include directories
File size: 1.3 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 _Client_H__
14#define _Client_H__
15
16#include <string>
17
18#include "ClientConnection.h"
19#include "PacketManager.h"
20#include "GameStateClient.h"
21#include "core/CoreIncludes.h"
22//#include "NetworkFrameListener.h"
23
24
25namespace network{
26
27
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 */
36class Client : PacketDecoder{
37  public:
38  Client();
39  Client(std::string address, int port);
40  Client(const char *address, int port);
41
42  bool establishConnection();
43  bool closeConnection();
44
45  bool sendMouse(double x, double y);
46  bool sendKeyboard(char key_code);
47  bool sendChat( std::string message );
48
49  bool addMouse(double x, double y);
50  bool addKeyboard(char key_code);
51
52  bool sendPackets();
53 
54  void tick(float time);
55
56  private:
57  ClientConnection client_connection;
58  PacketGenerator pck_gen;
59  GameStateClient gamestate;
60  bool isConnected;
61 
62  // implement data processing functions of PacketDecoder
63  void processGamestate( GameStateCompressed *data);
64  void processClassid(classid *clid);
65  void processChat( chat *data);
66};
67
68
69}
70
71#endif /* _Client_H__ */
Note: See TracBrowser for help on using the repository browser.