Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9110 in orxonox.OLD for trunk/src/lib/network


Ignore:
Timestamp:
Jul 4, 2006, 11:18:41 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the Presentation back

Location:
trunk/src/lib/network
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/network_game_manager.cc

    r9059 r9110  
    9898  ClassID playableClassId = rules.getPlayableClassId( userId, team );
    9999  std::string playableModel = rules.getPlayableModelFileName( userId, team, playableClassId );
     100  std::string playableTexture = rules.getPlayableModelFileName( userId, team, playableClassId );
    100101 
    101102  BaseObject * bo = Factory::fabricate( playableClassId );
     
    106107  Playable & playable = *(dynamic_cast<Playable*>(bo));
    107108 
    108   if (  playableModel != "" )
     109  if ( playableTexture != "" )
     110    playable.loadMD2Texture( playableTexture );
     111  if ( playableModel != "" )
    109112    playable.loadModel( playableModel );
    110113  playable.setOwner( userId );
  • trunk/src/lib/network/player_stats.cc

    r8708 r9110  
    238238}
    239239
     240
     241
     242ScoreList PlayerStats::getScoreList( )
     243{
     244  ScoreList result;
     245 
     246  const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
     247 
     248  if ( !list )
     249  {
     250    return result;
     251  }
     252 
     253  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
     254  {
     255    PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
     256   
     257    TeamScoreList::iterator it = result[stats.getTeamId()].begin();
     258   
     259    while (  it != result[stats.getTeamId()].end() && stats.score > it->score )
     260    {
     261      it++;
     262    }
     263   
     264    PlayerScore score;
     265    score.name = stats.getNickName();
     266    score.score = stats.getScore();
     267   
     268    result[stats.getTeamId()].insert(it, score);
     269  }
     270 
     271  return result;
     272}
  • trunk/src/lib/network/player_stats.h

    r8623 r9110  
    2020  TEAM_SPECTATOR = -1
    2121};
     22
     23struct PlayerScore
     24{
     25  std::string name;
     26  int score;
     27};
     28typedef std::list<PlayerScore> TeamScoreList;
     29typedef std::map<int,TeamScoreList> ScoreList;
    2230
    2331//! A class for storing player information
     
    6270   
    6371    static void deleteAllPlayerStats();
     72   
     73    static ScoreList getScoreList();
    6474
    6575  private:
  • trunk/src/lib/network/shared_network_data.cc

    r6822 r9110  
    4444 */
    4545SharedNetworkData::~SharedNetworkData()
    46 {}
     46{
     47  SharedNetworkData::singletonRef = NULL;
     48}
  • trunk/src/lib/network/synchronizeable.cc

    r8708 r9110  
    6767{
    6868  if ( this->networkStream )
     69  {
    6970    this->networkStream->disconnectSynchronizeable(*this);
    7071 
    71   if ( this->isServer() && this->beSynchronized() && this->getUniqueID() > 0 && !this->isA( CL_MESSAGE_MANAGER ) )
    72     NetworkGameManager::getInstance()->removeSynchronizeable( this->getUniqueID() );
     72    if ( this->isServer() && this->beSynchronized() && this->getUniqueID() > 0 && !this->isA( CL_MESSAGE_MANAGER ) )
     73      NetworkGameManager::getInstance()->removeSynchronizeable( this->getUniqueID() );
     74  }
    7375   
    7476  for ( SyncVarList::iterator it = syncVarList.begin(); it != syncVarList.end(); it++ )
Note: See TracChangeset for help on using the changeset viewer.