Changeset 777 for code/branches/FICN/src/network/ClientInformation.h
- Timestamp:
- Dec 31, 2007, 7:40:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/ClientInformation.h
r673 r777 14 14 15 15 #include <enet/enet.h> 16 #include <iostream> //debug 16 17 #include "NetworkPrereqs.h" 17 18 18 19 #define GAMESTATEID_INITIAL -1 19 20 20 namespace network { 21 namespace 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); 21 51 22 /** 23 * This class implements a list for client informations 24 * @author Oliver Scheuss 25 */ 26 class ClientInformation{ 27 public: 28 ClientInformation(); 29 ClientInformation(bool head); 30 // ClientInformation(ClientInformation *prev, ClientInformation *next); 31 // ClientInformation(ClientInformation *prev); 32 ~ClientInformation(); 33 ClientInformation *next(); 34 ClientInformation *prev(); 35 bool setNext(ClientInformation *next); 36 bool setPrev(ClientInformation *prev); 37 ClientInformation *insertAfter(ClientInformation *ins); 38 ClientInformation *insertBefore(ClientInformation *ins); 39 ClientInformation *insertBack(ClientInformation *ins); 40 void setID(int clientID); 41 void setPeer(ENetPeer *peer); 42 void setGamestateID(int id); 43 int getID(); 44 ENetPeer *getPeer(); 45 int getGamestateID(); 46 bool removeClient(int clientID); 47 bool removeClient(ENetPeer *peer); 48 ClientInformation *findClient(int clientID, bool look_backwards=false); 49 ClientInformation *findClient(ENetAddress *address, bool look_backwards=false); 50 51 void setSynched(bool s); 52 bool getSynched(); 53 54 bool head; 55 56 private: 57 ClientInformation *preve; 58 ClientInformation *nexte; 59 //actual information: 60 ENetPeer *peer_; 61 int clientID_; 62 int gamestateID_; 63 bool synched_; 64 }; 52 void setSynched(bool s); 53 bool getSynched(); 54 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 }; 65 66 66 67 }
Note: See TracChangeset
for help on using the changeset viewer.