Changeset 3066 for code/branches
- Timestamp:
- May 25, 2009, 6:05:11 PM (16 years ago)
- Location:
- code/branches/netp3/src/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp3/src/network/Client.cc
r3045 r3066 158 158 FunctionCallManager::sendCalls(); 159 159 } 160 ENetEvent *event; 160 } 161 162 ENetEvent *event; 161 163 // stop if the packet queue is empty 162 163 164 165 164 while(!(client_connection.queueEmpty())){ 165 event = client_connection.getEvent(); 166 COUT(5) << "tick packet size " << event->packet->dataLength << std::endl; 167 packet::Packet *packet = packet::Packet::createPacket(event->packet, event->peer); 166 168 // note: packet commits suicide here except for the GameState. That is then deleted by a GamestateHandler 167 bool b = packet->process(); 168 assert(b); 169 } 170 if(gamestate.processGamestates()) 171 { 172 if(!isSynched_) 173 isSynched_=true; 174 } 175 gamestate.cleanup(); 169 bool b = packet->process(); 170 assert(b); 176 171 } 172 if(gamestate.processGamestates()) 173 { 174 if(!isSynched_) 175 isSynched_=true; 176 } 177 gamestate.cleanup(); 177 178 178 179 return; -
code/branches/netp3/src/network/Host.h
r2990 r3066 37 37 38 38 const int CLIENTID_SERVER = 0; 39 const unsigned int NETWORK_FREQUENCY = 25;39 const unsigned int NETWORK_FREQUENCY = 30; 40 40 const float NETWORK_PERIOD = 1.0f/NETWORK_FREQUENCY; 41 41 -
code/branches/netp3/src/network/Server.cc
r3045 r3066 155 155 void Server::update(const Clock& time) { 156 156 processQueue(); 157 gamestates_->processGamestates(); 157 158 //this steers our network frequency 158 159 timeSinceLastUpdate_+=time.getDeltaTime(); 159 160 if(timeSinceLastUpdate_>=NETWORK_PERIOD){ 160 161 timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD; 161 gamestates_->processGamestates();162 162 updateGamestate(); 163 163 FunctionCallManager::sendCalls();
Note: See TracChangeset
for help on using the changeset viewer.