Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/network/ClientInformation.h @ 781

Last change on this file since 781 was 777, checked in by rgrieder, 17 years ago
  • added dll support to the network library
  • improved header file dependency in network
File size: 1.7 KB
RevLine 
[432]1//
2// C++ Interface: ClientInformation
3//
4// Description:
5//
6//
7// Author:  <>, (C) 2007
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
[673]12#ifndef _ClientInformation_H__
13#define _ClientInformation_H__
[432]14
[436]15#include <enet/enet.h>
16
[777]17#include "NetworkPrereqs.h"
18
[436]19#define GAMESTATEID_INITIAL -1
20
[777]21namespace network
22{
23  /**
24  * This class implements a list for client informations
25  * @author Oliver Scheuss
26  */
27  class ClientInformation{
28  public:
29    ClientInformation();
30    ClientInformation(bool head);
31    //   ClientInformation(ClientInformation *prev, ClientInformation *next);
32    //   ClientInformation(ClientInformation *prev);
33    ~ClientInformation();
34    ClientInformation *next();
35    ClientInformation *prev();
36    bool setNext(ClientInformation *next);
37    bool setPrev(ClientInformation *prev);
38    ClientInformation *insertAfter(ClientInformation *ins);
39    ClientInformation *insertBefore(ClientInformation *ins);
40    ClientInformation *insertBack(ClientInformation *ins);
41    void setID(int clientID);
42    void setPeer(ENetPeer *peer);
43    void setGamestateID(int id);
44    int getID();
45    ENetPeer *getPeer();
46    int getGamestateID();
47    bool removeClient(int clientID);
48    bool removeClient(ENetPeer *peer);
49    ClientInformation *findClient(int clientID, bool look_backwards=false);
50    ClientInformation *findClient(ENetAddress *address, bool look_backwards=false);
[432]51
[777]52    void setSynched(bool s);
53    bool getSynched();
[432]54
[777]55    bool head;
56
57  private:
58    ClientInformation *preve;
59    ClientInformation *nexte;
60    //actual information:
61    ENetPeer *peer_;
62    int clientID_;
63    int gamestateID_;
64    bool synched_;
65  };
66
[432]67}
68
[673]69#endif /* _ClientInformation_H__ */
Note: See TracBrowser for help on using the repository browser.