home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Runtime / Classes / RTGameInfo.uc < prev    next >
Text File  |  2003-06-25  |  2KB  |  62 lines

  1. //=============================================================================
  2. // RTGameInfo
  3. //=============================================================================
  4.  
  5. class RTGameInfo extends GameInfo;
  6.  
  7. //
  8. // Called after a successful login. This is the first place
  9. // it is safe to call replicated functions on the PlayerPawn.
  10. //
  11. // Mostly copied from GameInfo's PostLogin function
  12. //
  13. event PostLogin( PlayerController NewPlayer )
  14. {
  15.     local class<HUD> HudClass;
  16.     local class<Scoreboard> ScoreboardClass;
  17.     local String SongName;
  18.  
  19.     // Log player's login.
  20.     if (GameStats!=None)
  21.     {
  22.         GameStats.ConnectEvent(NewPlayer.PlayerReplicationInfo);
  23.         GameStats.GameEvent("NameChange",NewPlayer.PlayerReplicationInfo.playername,NewPlayer.PlayerReplicationInfo);        
  24.     }
  25.  
  26.     if ( !bDelayedStart && NewPlayer.Pawn == None ) // Changed by Demiurge (Runtime)
  27.     {
  28.         // start match, or let player enter, immediately
  29.         bRestartLevel = false;    // let player spawn once in levels that must be restarted after every death
  30.         bKeepSamePlayerStart = true;
  31.         if ( bWaitingToStartMatch )
  32.             StartMatch();
  33.         else
  34.             RestartPlayer(newPlayer);
  35.         bKeepSamePlayerStart = false;
  36.         bRestartLevel = Default.bRestartLevel;
  37.     }
  38.  
  39.     // Start player's music.
  40.     SongName = Level.Song;
  41.     if( SongName != "" && SongName != "None" )
  42.         NewPlayer.ClientSetMusic( SongName, MTRAN_Fade );
  43.     
  44.     // tell client what hud and scoreboard to use
  45.  
  46.     if( HUDType != "" )
  47.         HudClass = class<HUD>(DynamicLoadObject(HUDType, class'Class'));
  48.  
  49.     if( ScoreBoardType != "" )
  50.         ScoreboardClass = class<Scoreboard>(DynamicLoadObject(ScoreBoardType, class'Class'));
  51.     NewPlayer.ClientSetHUD( HudClass, ScoreboardClass );
  52.  
  53.     if ( NewPlayer.Pawn != None )
  54.         NewPlayer.Pawn.ClientSetRotation(NewPlayer.Pawn.Rotation);
  55. }
  56.  
  57. defaultproperties
  58. {
  59.     PlayerControllerClassName="Runtime.RTPlayerController"
  60.     PlayerControllerClass=None
  61.     HUDType="Runtime.RTHUD"
  62. }