XIII
Class XIIIPlayerReplicationInfo

source: C:\XIII\XIII\Classes\XIIIPlayerReplicationInfo.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Engine.ReplicationInfo
            |
            +--Engine.PlayerReplicationInfo
               |
               +--XIII.XIIIPlayerReplicationInfo
Direct Known Subclasses:None

class XIIIPlayerReplicationInfo
extends Engine.PlayerReplicationInfo

//============================================================================= // PlayerReplicationInfo. //=============================================================================
Variables
 GameReplicationInfo MemGRI
 int MyDeathScore
 bool bHasTheBomb
 sound hLastFragLimit


Function Summary
 void PostBeginPlay()
     
//_____________________________________________________________________________
 void SetWaitingPlayer(bool B)
     
//_____________________________________________________________________________
// ELR if set as true reset bReadyToPlay
 void Timer()
     
//_____________________________________________________________________________



Source Code


00001	//=============================================================================
00002	// PlayerReplicationInfo.
00003	//=============================================================================
00004	class XIIIPlayerReplicationInfo extends PlayerReplicationInfo;
00005	
00006	var bool bHasTheBomb;
00007	var int MyDeathScore;
00008	var sound hLastFragLimit;
00009	var GameReplicationInfo MemGRI;
00010	
00011	//_____________________________________________________________________________
00012	replication
00013	{
00014	  reliable if ( bNetDirty && (Role == Role_Authority) )
00015	    bHasTheBomb,MyDeathScore;
00016	}
00017	
00018	//_____________________________________________________________________________
00019	simulated event SkinUpdated()
00020	{
00021	    local Pawn P;
00022	
00023	    if ( PlayerController(Owner) != none )
00024	      Log("SKIN "$self$" Updated New code '"$SkinCodeName$"' Own"@Owner@"OwnPawn"@PlayerController(Owner).Pawn);
00025	    else
00026	      Log("SKIN "$self$" Updated New code '"$SkinCodeName$"' Own"@Owner);
00027	
00028	    if ( (Owner == none) || (PlayerController(Owner).Pawn == none) )
00029	    {
00030	      foreach DynamicActors(class'pawn', P)
00031	      {
00032	        if ( P.PlayerReplicationInfo == self )
00033	          break;
00034	      }
00035	    }
00036	    else
00037	    {
00038	      P = PlayerController(Owner).Pawn;
00039	      P.PlayerReplicationInfo = self; // weird but we may have pawn and PRI but Pawn.Pri = none
00040	    }
00041	
00042	    if ( P != none )
00043	      P.ChangeSkin();
00044	    else
00045	      Settimer2(2.0, false);
00046	//      Warn("!@! No pawn who owns me so no changeskin possible");
00047	}
00048	
00049	//_____________________________________________________________________________
00050	Simulated Event Timer2()
00051	{
00052	    local Pawn P;
00053	
00054	    if ( PlayerController(Owner) != none )
00055	      Log("SKIN "$self$" Timer New code '"$SkinCodeName$"' Own"@Owner@"OwnPawn"@PlayerController(Owner).Pawn);
00056	    else
00057	      Log("SKIN "$self$" Timer New code '"$SkinCodeName$"' Own"@Owner);
00058	
00059	    if ( (Owner == none) || (PlayerController(Owner).Pawn == none) )
00060	    {
00061	      foreach DynamicActors(class'pawn', P)
00062	      {
00063	        if ( P.PlayerReplicationInfo == self )
00064	          break;
00065	      }
00066	    }
00067	    else
00068	    {
00069	      P = PlayerController(Owner).Pawn;
00070	      P.PlayerReplicationInfo = self; // weird but we may have pawn and PRI but Pawn.Pri = none
00071	    }
00072	
00073	    if ( P != none )
00074	      P.ChangeSkin();
00075	    else
00076	      Warn("!@! No pawn who owns me so no changeskin possible");
00077	}
00078	
00079	//_____________________________________________________________________________
00080	function PostBeginPlay()
00081	{
00082	//    Super.PostBeginPlay();
00083	    StartTime = Level.TimeSeconds;
00084	    if ( !Level.bLonePlayer )
00085	    {
00086	      Timer();
00087	      SetTimer(2.0, true);
00088	    }
00089	    PreviousName = PlayerName;
00090	    // ELR Too early to send this...
00091	//    BroadCastLocalizedMessage( class'XIII.XIIIMultiMessage', 1, self );
00092	}
00093	
00094	//_____________________________________________________________________________
00095	// ELR if set as true reset bReadyToPlay
00096	function SetWaitingPlayer(bool B)
00097	{
00098	//    Log("MP-] SetWaitingPlayer call w/ B="$B);
00099	
00100	    bIsSpectator = B;
00101	    bWaitingPlayer = B;
00102	//    if ( B )
00103	//      bReadyToPlay = false;
00104	}
00105	
00106	//_____________________________________________________________________________
00107	function Timer()
00108	{
00109	    UpdatePlayerLocation();
00110	
00111	    if ( FRand() < 0.65 )
00112	      return;
00113	
00114	    if (PlayerController(Owner) != None)
00115	      Ping = int(Controller(Owner).ConsoleCommand("GETPING"));
00116	
00117	/*
00118	    // ELR Send name update messages
00119	    if ( !Level.bLonePlayer && (PlayerName != PreviousName) )
00120	    {
00121	      if ( PreviousName == "" )
00122	      {
00123	        PreviousName = PlayerName;
00124	        BroadCastLocalizedMessage( class'XIII.XIIIMultiMessage', 1, self );
00125	        return;
00126	      }
00127	      PreviousName = PlayerName;
00128	      BroadCastLocalizedMessage( class'XIII.XIIIMultiMessage', 2, self );
00129	    }
00130	*/
00131	}
00132	
00133	//_____________________________________________________________________________
00134	simulated event ScoreUpdated() // ELR Used to update score sorting only when receiving score replication
00135	{
00136	    local ScoreBoard S;
00137	
00138	    if ( Level.NetMode == NM_StandAlone )
00139	      return;
00140	
00141	    if ( Level.NetMode == NM_Client )
00142	    {
00143	      if ( MemGRI == none )
00144	      {
00145	        foreach allactors(class'GameReplicationInfo', MemGRI)
00146	          break;
00147	      }
00148	      if ( (MemGRI.GoalScore > 0) && (Score == MemGRI.GoalScore - 1) )
00149	      {
00150	//        Log("NEAR FRAGLIMIT");
00151	        PlayMenu(hLastFragLimit);
00152	      }
00153	    }
00154	
00155			foreach allactors(class'ScoreBoard', S)
00156	      S.UpdateScores();
00157	}
00158	
00159	
00160	
00161	defaultproperties
00162	{
00163	     hLastFragLimit=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hTimeLimit'
00164	}

End Source Code