Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9116 in orxonox.OLD


Ignore:
Timestamp:
Jul 4, 2006, 1:09:37 PM (18 years ago)
Author:
rennerc
Message:

player joins game with last chosen nickname

Location:
branches/presentation/src/lib/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/network/handshake.cc

    r8362 r9116  
    4343
    4444  candel_id = registerVarId( new SynchronizeableInt( &localState.canDel, &remoteState.canDel, "canDel", PERMISSION_ALL ) );
     45 
     46  registerVar( new SynchronizeableString( &localState.preferedNickName, &remoteState.preferedNickName, "preferedNickName", PERMISSION_ALL ) );
    4547
    4648  localState.completed = 0;
  • branches/presentation/src/lib/network/handshake.h

    r7954 r9116  
    2828 
    2929  std::string errorString;
     30 
     31  //additional data
     32  std::string preferedNickName;
    3033};
    3134
     
    4346    inline bool       allowDel(){ return localState.canDel == 1; }
    4447    inline void       del(){ localState.canDel = 1; }
     48   
     49    inline void       setPreferedNickName( const std::string & nick ){ localState.preferedNickName = nick; }
     50    inline std::string getPreferedNickName(){ return remoteState.preferedNickName; }
    4551   
    4652    virtual void varChangeHandler( std::list<int> & id );
  • branches/presentation/src/lib/network/network_game_manager.cc

    r9110 r9116  
    4141
    4242#include "multiplayer_team_deathmatch.h"
     43
     44#include "preferences.h"
    4345
    4446
     
    125127  stats->setPlayableUniqueId( playable.getUniqueID() );
    126128  stats->setModelFileName( playableModel );
     129 
     130  if ( userId == 0 )
     131    stats->setNickName( Preferences::getInstance()->getString( "multiplayer", "nickname", "Server" ) );
    127132 
    128133  if ( rules.isA( CL_MULTIPLAYER_TEAM_DEATHMATCH ) )
  • branches/presentation/src/lib/network/network_stream.cc

    r9059 r9116  
    3737#include "network_log.h"
    3838
     39#include "player_stats.h"
    3940
    4041#include "lib/util/loading/factory.h"
     
    153154  assert( peers[0].handshake == NULL );
    154155  peers[0].handshake = hs;
     156 
     157  hs->setPreferedNickName( Preferences::getInstance()->getString( "multiplayer", "nickname", "Player" ) );
     158 
    155159//   peers[0].handshake->setSynchronized( true );
    156160  //this->connectSynchronizeable(*hs);
     
    392396              {
    393397                handleNewClient( it->second.userId );
     398               
     399                if ( PlayerStats::getStats( it->second.userId ) && it->second.handshake->getPreferedNickName() != "" )
     400                {
     401                  PlayerStats::getStats( it->second.userId )->setNickName( it->second.handshake->getPreferedNickName() );
     402                }
    394403              }
    395404             
Note: See TracChangeset for help on using the changeset viewer.