- Timestamp:
- May 24, 2018, 3:24:00 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Masterserver_FS18/src/libraries/network/Server.cc
r11829 r11990 167 167 { 168 168 timeSinceLastUpdate_ -= static_cast<unsigned int>(timeSinceLastUpdate_ / NETWORK_PERIOD) * NETWORK_PERIOD; 169 updateGamestate();169 this->updateGamestate(); 170 170 } 171 171 } … … 178 178 179 179 /** 180 * Returnping time to client in milliseconds.181 */ 182 unsigned int Server::getRTT(unsigned int clientID)180 * Print ping time to client in milliseconds. 181 */ 182 void Server::printRTT() 183 183 { 184 184 // TODO: Implement 185 return 0;186 }187 188 /**189 * Print ping time to client in milliseconds.190 */191 void Server::printRTT()192 {193 // TODO: Implement194 }195 196 /**197 * Return packet loss ratio to client (scales from 0 to 1).198 */199 float Server::getPacketLoss(unsigned int clientID)200 {201 // TODO: Implement202 return 0.;203 185 } 204 186 … … 214 196 } 215 197 GamestateManager::update(); 216 sendGameStates();217 sendObjectDeletes();198 this->sendGameStates(); 199 this->sendObjectDeletes(); 218 200 } 219 201 … … 255 237 orxout(internal_warning, context::network) << "Server: could not broadcast deleteObjects packet" << endl; 256 238 } 257 258 // TODO: Possible memory leak?259 // del is allocated but only deleted if fetchIDs() returns false260 239 261 240 return true; … … 277 256 orxout(internal_info, context::network) << "Server: added client id: " << peerID << endl; 278 257 279 createClient(peerID);258 this->createClient(peerID); 280 259 } 281 260 … … 297 276 } 298 277 } 299 300 // TODO: What happens if no peer with this ID is found?301 // Should probably at least log302 278 303 279 WANDiscoverable::updateClientNumber(this->clientIDs_.size()); … … 339 315 340 316 // synchronise class ids 341 syncClassid(clientID);317 this->syncClassid(clientID); 342 318 343 319 // now synchronise functionIDs … … 346 322 bool b = fIDs->send(static_cast<Host*>(this)); 347 323 assert(b); 348 // TODO: assert probably isn't the way to go here, as a packet which fails to send will crash the game...349 324 350 325 GamestateManager::setSynched(clientID); … … 356 331 b = w->send(static_cast<Host*>(this)); 357 332 assert(b); 358 // TODO: assert probably isn't the way to go here, as a packet which fails to send will crash the game...359 333 360 334 (void)b; // avoid compiler warning … … 380 354 { 381 355 // check if the target exists. just ignore the message otherwise 382 if (!this->isValidTarget(targetID)) // TODO: remove this if an invalid clientIDs don't trigger assertions anymore356 if (!this->isValidTarget(targetID)) 383 357 { 384 358 return; … … 434 408 packet::ClassID *classid = new packet::ClassID(); 435 409 classid->setPeerID(clientID); 436 // TODO: Better to do this with a for loop 410 437 411 int failures = 0; 438 412 while(!classid->send(static_cast<Host*>(this)) && failures < 10)\ … … 441 415 } 442 416 assert(failures<10); 443 // TODO: assert probably isn't the way to go here, as 10 failed packets will crash the game...444 417 orxout(verbose, context::network) << "syncClassid:\tall synchClassID packets have been sent" << endl; 445 418 }
Note: See TracChangeset
for help on using the changeset viewer.