Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2048


Ignore:
Timestamp:
Oct 29, 2008, 2:16:15 PM (15 years ago)
Author:
scheusso
Message:

network tick limit works now

Location:
code/branches/objecthierarchy/src
Files:
2 edited

Legend:

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

    r2009 r2048  
    6262namespace network
    6363{
    64   const int MAX_FAILURES = 20;
    65   const int NETWORK_FREQUENCY = 30;
     64  const unsigned int MAX_FAILURES = 20;
     65  const unsigned int NETWORK_FREQUENCY = 25;
     66  const float NETWORK_PERIOD = (float)1/NETWORK_FREQUENCY;
    6667
    6768  /**
     
    153154    //this steers our network frequency
    154155    timeSinceLastUpdate_+=time;
    155     if(timeSinceLastUpdate_>=(1./NETWORK_FREQUENCY)){
    156       timeSinceLastUpdate_=(float)((int)(timeSinceLastUpdate_*NETWORK_FREQUENCY))/timeSinceLastUpdate_;
     156    if(timeSinceLastUpdate_>=NETWORK_PERIOD){
     157      timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD;
    157158      gamestates_->processGamestates();
    158159      updateGamestate();
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2042 r2048  
    238238            else if (this->bControlled_)
    239239            {
     240                COUT(2) << "setting client position" << endl;
    240241                this->client_velocity_ = this->velocity_;
    241242                this->client_position_ = this->node_->getPosition();
     
    297298        if (this->server_overwrite_ == this->client_overwrite_)
    298299        {
     300            COUT(2) << "callback: setting client position" << endl;
    299301            this->node_->setPosition(this->client_position_);
    300302            this->server_position_ = this->client_position_;
Note: See TracChangeset for help on using the changeset viewer.