Changeset 7680 in orxonox.OLD for branches/network/src
- Timestamp:
- May 18, 2006, 2:10:11 PM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/netdefs.h
r7402 r7680 18 18 19 19 #define MAX_CONNECTIONS 1000 20 21 #define NETWORK_FREQUENCY 33 20 22 21 23 -
branches/network/src/lib/network/network_manager.cc
r7540 r7680 52 52 this->defaultSyncStream = NULL; 53 53 this->sharedNetworkData = SharedNetworkData::getInstance(); 54 this->elapsedTime = 0.0f; 54 55 55 56 PRINTF(0)("NetworkManager created\n"); … … 123 124 /** 124 125 * sync the network 126 * @param dtS: the seceonds elapsed since the last synchronize call 125 127 */ 126 void NetworkManager::synchronize( )128 void NetworkManager::synchronize( float dtS) 127 129 { 130 this->elapsedTime += dtS; 131 if( likely(this->elapsedTime < 1.0f / NETWORK_FREQUENCY)) 132 return; 133 this->elapsedTime = 0.0f; 134 128 135 if (this->netStreamList != NULL || (this->netStreamList = ClassList::getList(CL_NETWORK_STREAM)) != NULL) 129 136 { -
branches/network/src/lib/network/network_manager.h
r7256 r7680 45 45 46 46 void connectSynchronizeable(Synchronizeable& sync); 47 void synchronize( );47 void synchronize(float dtS); 48 48 49 49 void debug(); … … 61 61 62 62 SharedNetworkData* sharedNetworkData; //!< reference to the shared data 63 float elapsedTime; //!< elapsed time since the last network update 63 64 }; 64 65 -
branches/network/src/story_entities/multi_player_world.cc
r7287 r7680 81 81 void MultiPlayerWorld::synchronize() 82 82 { 83 NetworkManager::getInstance()->synchronize( );83 NetworkManager::getInstance()->synchronize(this->dtS); 84 84 } 85 85
Note: See TracChangeset
for help on using the changeset viewer.