Changeset 1360 for code/trunk/src/network/ClientInformation.h
- Timestamp:
- May 22, 2008, 2:02:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/ClientInformation.h
r1293 r1360 44 44 45 45 #include <enet/enet.h> 46 #include <boost/thread/recursive_mutex.hpp> 46 47 47 48 #define GAMESTATEID_INITIAL -1 49 #define CLIENTID_UNKNOWN -2 48 50 49 51 namespace network … … 62 64 ClientInformation *next(); 63 65 ClientInformation *prev(); 64 bool setNext(ClientInformation *next);65 bool setPrev(ClientInformation *prev);66 ClientInformation *insertAfter(ClientInformation *ins);67 ClientInformation *insertBefore(ClientInformation *ins);68 66 ClientInformation *insertBack(ClientInformation *ins); 69 67 70 68 // set functions 71 69 void setID(int clientID); 72 void setPeer(ENetPeer *peer); 73 void setGamestateID(int id); 70 bool setPeer(ENetPeer *peer); 71 bool setGamestateID(int id); 72 bool setPartialGamestateID(int id); 74 73 inline void setShipID(int id){ShipID_=id;} 75 74 … … 78 77 int getID(); 79 78 int getGamestateID(); 79 int getPartialGamestateID(); 80 80 ENetPeer *getPeer(); 81 bool getHead(); 82 void setHead(bool h); 81 83 84 int getFailures(); 85 void addFailure(); 86 void resetFailures(); 82 87 83 88 bool removeClient(int clientID); … … 88 93 ClientInformation *findClient(ENetAddress *address, bool look_backwards=false); 89 94 90 voidsetSynched(bool s);95 bool setSynched(bool s); 91 96 bool getSynched(); 92 97 93 bool head;94 unsigned short failures_;95 98 96 private: 99 private: 100 bool setNext(ClientInformation *next); 101 bool setPrev(ClientInformation *prev); 102 ClientInformation *insertAfter(ClientInformation *ins); 103 ClientInformation *insertBefore(ClientInformation *ins); 104 97 105 ClientInformation *preve; 98 106 ClientInformation *nexte; … … 101 109 int clientID_; 102 110 int gamestateID_; 111 int partialGamestateID_; 103 112 int ShipID_; // this is the unique objectID 104 113 bool synched_; 114 bool head_; 115 unsigned short failures_; 116 static boost::recursive_mutex mutex_; 117 105 118 }; 106 119
Note: See TracChangeset
for help on using the changeset viewer.