Changeset 8153 in orxonox.OLD
- Timestamp:
- Jun 5, 2006, 3:25:05 PM (18 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_game_manager.cc
r8152 r8153 112 112 stats->setPlayableUniqueId( playable.getUniqueID() ); 113 113 stats->setModelFileName( playableModel ); 114 115 return true; 114 116 } 115 117 … … 122 124 bool NetworkGameManager::signalLeftPlayer(int userID) 123 125 { 124 delete PlayerStats::getStats( userID )->getPlayable(); 125 delete PlayerStats::getStats( userID ); 126 if ( PlayerStats::getStats( userID ) ) 127 { 128 if ( PlayerStats::getStats( userID )->getPlayable() ) 129 delete PlayerStats::getStats( userID )->getPlayable(); 130 delete PlayerStats::getStats( userID ); 131 } 132 133 return true; 126 134 } 127 135 … … 165 173 return true; 166 174 } 167 175 168 176 delete dynamic_cast<Synchronizeable*>(*it); 169 177 return true; -
branches/network/src/lib/network/network_stream.cc
r8068 r8153 651 651 } 652 652 } 653 653 654 654 655 int n = sync->setStateDiff( peer->second.userId, buf+offset, syncDataLength, state, fromState ); … … 664 665 } 665 666 666 //TODO REMOVE THIS667 int saveOffset = offset;668 667 669 668 for ( SynchronizeableList::iterator it = synchronizeables.begin(); it != synchronizeables.end(); it++ ) … … 682 681 assert( peer->second.lastRecvedState < state ); 683 682 peer->second.lastRecvedState = state; 684 685 assert( saveOffset == offset ); 686 683 687 684 } 688 685 -
branches/network/src/lib/network/player_stats.cc
r8147 r8153 21 21 #include "player.h" 22 22 #include "state.h" 23 #include "shared_network_data.h" 23 24 24 25 … … 85 86 this->setPlayableUniqueId( this->playableUniqueId ); 86 87 87 PRINTF(0)("uniqueID changed %d %d \n", userId, getHostID());88 PRINTF(0)("uniqueID changed %d %d %d\n", userId, getHostID(), getUniqueID()); 88 89 } 89 90 } … … 99 100 100 101 if ( !list ) 102 { 101 103 return NULL; 104 } 102 105 103 106 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) … … 108 111 } 109 112 } 110 111 //TODO maybe we should create an object here112 113 113 114 return NULL; … … 138 139 139 140 if ( this->playable && userId == getHostID() ) 141 { 140 142 State::getPlayer()->setPlayable( this->playable ); 143 } 141 144 142 145 this->playableUniqueId = uniqueId; -
branches/network/src/lib/network/synchronizeable.cc
r8147 r8153 369 369 void Synchronizeable::cleanUpUser( int userId ) 370 370 { 371 for ( UserStateHistory::iterator it = sentStates.begin(); it != sentStates.end(); it++ ) 372 { 373 for ( StateHistory::iterator it2 = it->begin(); it2 != it->end(); it2++ ) 374 { 375 if ( (*it2)->data ) 376 delete [] (*it2)->data; 377 (*it2)->data = NULL; 378 379 delete *it2; 380 } 381 } 382 383 sentStates.clear(); 384 385 for ( UserStateHistory::iterator it = recvStates.begin(); it != recvStates.end(); it++ ) 386 { 387 for ( StateHistory::iterator it2 = it->begin(); it2 != it->end(); it2++ ) 388 { 389 if ( (*it2)->data ) 390 delete [] (*it2)->data; 391 (*it2)->data = NULL; 392 393 delete *it2; 394 } 395 } 396 397 recvStates.clear(); 371 if ( recvStates.size() > userId ) 372 { 373 for ( std::list<StateHistoryEntry*>::iterator it = recvStates[userId].begin(); it != recvStates[userId].end(); it++ ) 374 { 375 if ( (*it)->data ) 376 delete [] (*it)->data; 377 (*it)->data = NULL; 378 379 delete *it; 380 } 381 recvStates[userId].clear(); 382 } 383 384 if ( sentStates.size() > userId ) 385 { 386 387 for ( std::list<StateHistoryEntry*>::iterator it = sentStates[userId].begin(); it != sentStates[userId].end(); it++ ) 388 { 389 if ( (*it)->data ) 390 delete [] (*it)->data; 391 (*it)->data = NULL; 392 393 delete *it; 394 } 395 sentStates[userId].clear(); 396 } 398 397 } 399 398
Note: See TracChangeset
for help on using the changeset viewer.