## Engine
Class DemoRecSpectator

source: C:\XIII\Engine\Classes\DemoRecSpectator.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Controller
             |
             +--Engine.PlayerController
                |
                +--Engine.MessagingSpectator
                   |
                   +--Engine.DemoRecSpectator

Direct Known Subclasses:None

class DemoRecSpectator
extends Engine.MessagingSpectator

    //=============================================================================
    // DemoRecSpectator - spectator for demo recordings to replicate ClientMessages
    //=============================================================================

Variables
`PlayerController` | `PlaybackActor`
`GameReplicationInfo` | `PlaybackGRI`

Function Summary
`void` | `ClientMessage(string S, optional name)`
`void` | `ClientVoiceMessage(PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID)`
`simulated` | `RepClientMessage(string S, optional name)`
    // find local playerpawn and attach.
    	if(Level.NetMode == NM_Client)
    	{
    		if(PlaybackActor == None)
    		{
    			foreach DynamicActors(class'PlayerController', p)
    			{
    				if( p.Player.IsA('Viewport') )
    				{
    					PlaybackActor = p;
    					if(PlaybackGRI != None)
    						PlaybackActor.GameReplicationInfo = PlaybackGRI;

    					Log("Attached to player "$p);

    					break;
    				}
    			}
    		}

    		if(PlaybackGRI == None)
    		{
    			foreach DynamicActors(class'GameReplicationInfo', g)
    			{
    				PlaybackGRI = g;
    				if(PlaybackActor != None)
    					PlaybackActor.GameReplicationInfo = PlaybackGRI;
    				break;
    			}
    		}

    		if(PlaybackActor != None && PlaybackGRI != None)
    			Disable('Tick');

    	}
    	else
    	{
    		Disable('Tick');
    	}
    }
    */
`simulated` | `RepClientVoiceMessage(PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID)`
`simulated` | `Tick(float Delta)`
    /*

Source Code

    00001	//=============================================================================
    00002	// DemoRecSpectator - spectator for demo recordings to replicate ClientMessages
    00003	//=============================================================================
    00004
    00005	class DemoRecSpectator extends MessagingSpectator;
    00006
    00007	var PlayerController PlaybackActor;
    00008	var GameReplicationInfo PlaybackGRI;
    00009
    00010	function ClientMessage( coerce string S, optional name Type )
    00011	{
    00012		RepClientMessage( S, Type );
    00013	}
    00014
    00015	function ClientVoiceMessage(PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID)
    00016	{
    00017		RepClientVoiceMessage(Sender, Recipient, messagetype, messageID);
    00018	}
    00019
    00020	function ReceiveLocalizedMessage( class<LocalMessage> Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject )
    00021	{
    00022		RepReceiveLocalizedMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );
    00023	}
    00024
    00025	//==== Called during demo playback ============================================
    00026	/*
    00027	simulated function Tick(float Delta)
    00028	{
    00029		local PlayerController p;
    00030		local GameReplicationInfo g;
    00031
    00032		// find local playerpawn and attach.
    00033		if(Level.NetMode == NM_Client)
    00034		{
    00035			if(PlaybackActor == None)
    00036			{
    00037				foreach DynamicActors(class'PlayerController', p)
    00038				{
    00039					if( p.Player.IsA('Viewport') )
    00040					{
    00041						PlaybackActor = p;
    00042						if(PlaybackGRI != None)
    00043							PlaybackActor.GameReplicationInfo = PlaybackGRI;
    00044
    00045						Log("Attached to player "$p);
    00046
    00047						break;
    00048					}
    00049				}
    00050			}
    00051
    00052			if(PlaybackGRI == None)
    00053			{
    00054				foreach DynamicActors(class'GameReplicationInfo', g)
    00055				{
    00056					PlaybackGRI = g;
    00057					if(PlaybackActor != None)
    00058						PlaybackActor.GameReplicationInfo = PlaybackGRI;
    00059					break;
    00060				}
    00061			}
    00062
    00063			if(PlaybackActor != None && PlaybackGRI != None)
    00064				Disable('Tick');
    00065
    00066		}
    00067		else
    00068		{
    00069			Disable('Tick');
    00070		}
    00071	}
    00072	*/
    00073	simulated function RepClientMessage( coerce string S, optional name Type )
    00074	{
    00075		//if(PlaybackActor != None && PlaybackActor.Role == ROLE_Authority)
    00076		//	PlaybackActor.ClientMessage( S, Type );
    00077	}
    00078
    00079	simulated function RepClientVoiceMessage(PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID)
    00080	{
    00081		//if(PlaybackActor != None && PlaybackActor.Role == ROLE_Authority)
    00082		//	PlaybackActor.ClientVoiceMessage(Sender, Recipient, messagetype, messageID);
    00083	}
    00084
    00085	simulated function RepReceiveLocalizedMessage( class<LocalMessage> Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject )
    00086	{
    00087		//if(PlaybackActor != None && PlaybackActor.Role == ROLE_Authority)
    00088		//	PlaybackActor.ReceiveLocalizedMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );
    00089	}
    00090
    00091	replication
    00092	{
    00093		reliable if ( bDemoRecording )
    00094			RepClientMessage, RepClientVoiceMessage, RepReceiveLocalizedMessage;
    00095	}
    00096
    00097	defaultproperties
    00098	{
    00099	}

End Source Code