Changeset 2048 for code/branches
- Timestamp:
- Oct 29, 2008, 2:16:15 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/Server.cc
r2009 r2048 62 62 namespace network 63 63 { 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; 66 67 67 68 /** … … 153 154 //this steers our network frequency 154 155 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; 157 158 gamestates_->processGamestates(); 158 159 updateGamestate(); -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/ControllableEntity.cc
r2042 r2048 238 238 else if (this->bControlled_) 239 239 { 240 COUT(2) << "setting client position" << endl; 240 241 this->client_velocity_ = this->velocity_; 241 242 this->client_position_ = this->node_->getPosition(); … … 297 298 if (this->server_overwrite_ == this->client_overwrite_) 298 299 { 300 COUT(2) << "callback: setting client position" << endl; 299 301 this->node_->setPosition(this->client_position_); 300 302 this->server_position_ = this->client_position_;
Note: See TracChangeset
for help on using the changeset viewer.