Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 448 was 438, checked in by dumenim, 16 years ago

Client got a new function send Chat

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 NETWORK_CLIENT_H
14#define NETWORK_CLIENT_H
15
16#include <string>
17
18#include "ClientConnection.h"
19#include "PacketManager.h"
20#include "GameStateClient.h"
21#include "orxonox/core/IdentifierIncludes.h"
22
23
24namespace 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
30 *
31 */
32class Client : PacketDecoder{
33  public:
34  Client();
35  Client(std::string address, int port);
36  Client(const char *address, int port);
37
38  bool establishConnection();
39  bool closeConnection();
40
41  bool sendMouse(double x, double y);
42  bool sendKeyboard(char key_code);
43  bool sendChat( std::string message );
44
45  bool addMouse(double x, double y);
46  bool addKeyboard(char key_code);
47
48  bool sendPackets();
49 
50  void update();
51
52  private:
53  ClientConnection client_connection;
54  PacketGenerator pck_gen;
55  GameStateClient gamestate;
56  bool isConnected;
57 
58  // implement data processing functions of PacketDecoder
59  void processGamestate( GameStateCompressed *data);
60  void processClassid(classid *clid);
61  void processChat( chat *data);
62};
63
64}
65
66#endif
Note: See TracBrowser for help on using the repository browser.