Changeset 2048 for code/branches/objecthierarchy/src/network
- Timestamp:
- Oct 29, 2008, 2:16:15 PM (16 years ago)
- File:
-
- 1 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();
Note: See TracChangeset
for help on using the changeset viewer.