Changeset 7772 in orxonox.OLD for branches/network
- Timestamp:
- May 23, 2006, 2:58:52 PM (19 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/connection_monitor.cc
r7767 r7772 33 33 this->incomingUnzippedBandWidth = 0; 34 34 this->outgoingUnzippedBandWidth = 0; 35 this->incomingZippedBandWidth = 0; 36 this->outgoingZippedBandWidth = 0; 35 37 this->nIncomingPackets = 0; 36 38 this->nOutgoingPackets = 0; … … 62 64 63 65 for ( int i = 0; i < length; i++ ) 66 { 64 67 if ( data[i] == '\0' ) 65 68 nZeroBytes++; 69 } 66 70 67 71 NETPRINTF(n)( "ZEROBYTES: %d (%f%%)\n", nZeroBytes, ((float)100)*nZeroBytes/length ); … … 82 86 } 83 87 84 while ( sentStateTicks.begin()->first <= ackedState ) 85 sentStateTicks.erase( sentStateTicks.begin() ); 88 //TODO cleanup list 89 // while ( sentStateTicks.begin()->first <= ackedState ) 90 // { 91 // NETPRINTF(n)("removing old state\n"); 92 // sentStateTicks.erase( sentStateTicks.begin() ); 93 // } 94 95 NETPRINTF(n)("adsf\n"); 86 96 97 //TODO cleanup list 98 #if 0 87 99 while ( ackDelay.size() > N_PACKETS_FOR_PING ) 100 { 101 NETPRINTF(n)("removing old ackdelay\n"); 88 102 ackDelay.erase( ackDelay.begin() ); 103 } 104 #endif 89 105 90 106 ping = 0; … … 112 128 // delete old packets 113 129 while ( packetHistory.begin()->first < tick - MSECS_TO_CALC_BWIDTH ) 130 { 114 131 packetHistory.erase( packetHistory.begin() ); 132 } 115 133 116 134 float res = 0.0f; … … 131 149 } 132 150 151 /** 152 * calculates max packet size you can send now to fit into bandwidth 153 * @return 154 */ 155 int ConnectionMonitor::getMaxPacketSize( ) 156 { 157 } 133 158 159 -
branches/network/src/lib/network/connection_monitor.h
r7767 r7772 24 24 void processUnzippedOutgoingPacket( byte * data, int length, int stateId ); 25 25 void processUnzippedIncomingPacket( byte * data, int length, int stateId, int ackedState ); 26 void processZippedPacket( ); 26 27 27 28 28 void calculatePing(); 29 29 30 30 bool hasTimedOut(){ return ( lastPacketTick + SECS_TO_TIMEOUT*1000 < SDL_GetTicks() ) && nIncomingPackets > 0; } 31 32 int getMaxPacketSize(); 31 33 32 34 private: … … 40 42 std::map<int,int> outgoingUnzippedPacketHistory; 41 43 44 std::map<int,int> incomingZippedPacketHistory; 45 std::map<int,int> outgoingZippedPacketHistory; 46 42 47 std::list<int> ackDelay; 43 48 int ping; … … 45 50 float incomingUnzippedBandWidth; 46 51 float outgoingUnzippedBandWidth; 52 53 float incomingZippedBandWidth; 54 float outgoingZippedBandWidth; 47 55 48 56 int nIncomingPackets; -
branches/network/src/lib/network/network_game_manager.cc
r7767 r7772 467 467 { 468 468 /* create new playable for Player*/ 469 470 assert ( SharedNetworkData::getInstance()->isGameServer() ); 471 469 472 PRINTF(0)("Request for creation: %i\n", userId); 470 473 int uniqueId = this->createEntity(CL_SPACE_SHIP, userId); -
branches/network/src/lib/network/network_stream.cc
r7767 r7772 336 336 this->networkGameManager->setUniqueID( it->second.handshake->getNetworkGameManagerId() ); 337 337 MessageManager::getInstance()->setUniqueID( it->second.handshake->getMessageManagerId() ); 338 339 handleNewClient( it->second.userId ); 338 340 } 339 341 … … 343 345 it->second.handshake = NULL; 344 346 345 handleNewClient( it->second.userId );346 347 } 347 348 else … … 597 598 void NetworkStream::cleanUpOldSyncList( ) 598 599 { 600 //TODO dont return do something 601 return; 599 602 int now = SDL_GetTicks(); 600 603
Note: See TracChangeset
for help on using the changeset viewer.