Changeset 1261 for code/branches/network3/src/network/Server.cc
- Timestamp:
- May 12, 2008, 11:44:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network3/src/network/Server.cc
r1253 r1261 53 53 namespace network 54 54 { 55 56 57 #define MAX_FAILURES 20; 58 59 55 60 /** 56 61 * Constructor for default values (bindaddress is set to ENET_HOST_ANY … … 205 210 } 206 211 //std::cout << "adding gamestate" << std::endl; 207 if ( !(connection->addPacket(packet_gen.gstate(gs), cid)) ) 208 COUT(4) << "Server: packet with client id (cid): " << cid << " not sended" << std::endl; 212 if ( !(connection->addPacket(packet_gen.gstate(gs), cid)) ){ 213 COUT(3) << "Server: packet with client id (cid): " << cid << " not sended: " << temp->failures_ << std::endl; 214 temp->failures_++; 215 if(temp->failures_ > 20 ) 216 disconnectClient(temp); 209 217 //std::cout << "added gamestate" << std::endl; 218 } 210 219 added=true; 211 220 temp=temp->next(); … … 240 249 if(!gamestates->pushGameState(data, clientID)) 241 250 COUT(3) << "Could not push gamestate\t\t\t\t=====" << std::endl; 242 } 243 251 else 252 clients->findClient(clientID)->failures_=0; 253 } 254 255 void Server::disconnectClient(int clientID){ 256 ClientInformation *client = clients->findClient(clientID); 257 disconnectClient(client); 258 } 259 void Server::disconnectClient( ClientInformation *client){ 260 connection->disconnectClient(client); 261 gamestates->removeClient(client); 262 } 263 244 264 }
Note: See TracChangeset
for help on using the changeset viewer.