Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2018, 3:24:00 PM (6 years ago)
Author:
mdedial
Message:

Clean up code, remove TODOs and dead code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Masterserver_FS18/src/libraries/network/Server.cc

    r11829 r11990  
    167167      {
    168168        timeSinceLastUpdate_ -= static_cast<unsigned int>(timeSinceLastUpdate_ / NETWORK_PERIOD) * NETWORK_PERIOD;
    169         updateGamestate();
     169        this->updateGamestate();
    170170      }
    171171    }
     
    178178
    179179  /**
    180    * Return ping 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()
    183183  {
    184184    // TODO: Implement
    185     return 0;
    186   }
    187 
    188   /**
    189    * Print ping time to client in milliseconds.
    190    */
    191   void Server::printRTT()
    192   {
    193     // TODO: Implement
    194   }
    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: Implement
    202     return 0.;
    203185  }
    204186
     
    214196    }
    215197    GamestateManager::update();
    216     sendGameStates();
    217     sendObjectDeletes();
     198    this->sendGameStates();
     199    this->sendObjectDeletes();
    218200  }
    219201
     
    255237      orxout(internal_warning, context::network) << "Server: could not broadcast deleteObjects packet" << endl;
    256238    }
    257 
    258     // TODO: Possible memory leak?
    259     // del is allocated but only deleted if fetchIDs() returns false
    260239
    261240    return true;
     
    277256    orxout(internal_info, context::network) << "Server: added client id: " << peerID << endl;
    278257
    279     createClient(peerID);
     258    this->createClient(peerID);
    280259  }
    281260
     
    297276      }
    298277    }
    299 
    300     // TODO: What happens if no peer with this ID is found?
    301     // Should probably at least log
    302278
    303279    WANDiscoverable::updateClientNumber(this->clientIDs_.size());
     
    339315
    340316    // synchronise class ids
    341     syncClassid(clientID);
     317    this->syncClassid(clientID);
    342318
    343319    // now synchronise functionIDs
     
    346322    bool b = fIDs->send(static_cast<Host*>(this));
    347323    assert(b);
    348     // TODO: assert probably isn't the way to go here, as a packet which fails to send will crash the game...
    349324
    350325    GamestateManager::setSynched(clientID);
     
    356331    b = w->send(static_cast<Host*>(this));
    357332    assert(b);
    358     // TODO: assert probably isn't the way to go here, as a packet which fails to send will crash the game...
    359333
    360334    (void)b; // avoid compiler warning
     
    380354  {
    381355    // 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 anymore
     356    if (!this->isValidTarget(targetID))
    383357    {
    384358      return;
     
    434408    packet::ClassID *classid = new packet::ClassID();
    435409    classid->setPeerID(clientID);
    436     // TODO: Better to do this with a for loop
     410
    437411    int failures = 0;
    438412    while(!classid->send(static_cast<Host*>(this)) && failures < 10)\
     
    441415    }
    442416    assert(failures<10);
    443     // TODO: assert probably isn't the way to go here, as 10 failed packets will crash the game...
    444417    orxout(verbose, context::network) << "syncClassid:\tall synchClassID packets have been sent" << endl;
    445418  }
Note: See TracChangeset for help on using the changeset viewer.