Changeset 1960 for code/branches/objecthierarchy/src/network
- Timestamp:
- Oct 19, 2008, 11:53:31 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/ClientInformation.cc
r1955 r1960 173 173 return gamestateID_; 174 174 else 175 return -1;175 return (unsigned int)-1; 176 176 } 177 177 … … 180 180 return partialGamestateID_; 181 181 else 182 return -1;182 return (unsigned int)-1; 183 183 } 184 184 -
code/branches/objecthierarchy/src/network/ClientInformation.h
r1955 r1960 46 46 #include <boost/thread/recursive_mutex.hpp> 47 47 48 #define GAMESTATEID_INITIAL -149 50 48 // WATCH OUT: THE CLIENTINFORMATION LIST IS NOT THREADSAFE ANYMORE 51 49 52 50 namespace network 53 51 { 52 static const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1; 54 53 static const unsigned int CLIENTID_UNKNOWN = (unsigned int)-2; 55 54 -
code/branches/objecthierarchy/src/network/GamestateManager.cc
r1944 r1960 64 64 return getSnapshot(); 65 65 } 66 66 67 67 bool GamestateManager::add(packet::Gamestate *gs, int clientID){ 68 68 assert(gs); … … 75 75 return true; 76 76 } 77 77 78 78 bool GamestateManager::processGamestates(){ 79 79 std::map<int, packet::Gamestate*>::iterator it; … … 87 87 return true; 88 88 } 89 90 89 90 91 91 bool GamestateManager::getSnapshot(){ 92 92 reference = new packet::Gamestate(); … … 97 97 return true; 98 98 } 99 99 100 100 /** 101 101 * this function is used to keep the memory usage low 102 102 * it tries to delete all the unused gamestates 103 * 104 * 103 * 104 * 105 105 */ 106 106 /* void GamestateManager::cleanup(){ … … 160 160 return gs; 161 161 } 162 163 162 163 164 164 bool GamestateManager::ack(int gamestateID, int clientID) { 165 165 ClientInformation *temp = ClientInformation::findClient(clientID); 166 166 assert(temp); 167 167 int curid = temp->getGamestateID(); 168 168 169 169 if(gamestateID == 0){ 170 170 temp->setGamestateID(GAMESTATEID_INITIAL); 171 171 return true; 172 172 } 173 173 174 174 assert(curid<gamestateID); 175 175 COUT(4) << "acking gamestate " << gamestateID << " for clientid: " << clientID << " curid: " << curid << std::endl; … … 194 194 gamestateMap_.erase(clientMap); 195 195 } 196 196 197 197 bool GamestateManager::processGamestate(packet::Gamestate *gs){ 198 198 if(gs->isCompressed()) -
code/branches/objecthierarchy/src/network/packet/Packet.cc
r1952 r1960 135 135 Packet *Packet::createPacket(ENetPacket *packet, ENetPeer *peer){ 136 136 uint8_t *data = packet->data; 137 assert(ClientInformation::findClient(&peer->address)->getID() !=-2 || !Host::isServer());137 assert(ClientInformation::findClient(&peer->address)->getID() != (unsigned int)-2 || !Host::isServer()); 138 138 unsigned int clientID = ClientInformation::findClient(&peer->address)->getID(); 139 139 Packet *p;
Note: See TracChangeset
for help on using the changeset viewer.