engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Public 属性 | 静态 Public 属性 | 友元 | 所有成员列表
UDemoNetDriver类 参考

Simulated network driver for recording and playing back game sessions. 更多...

#include <DemoNetDriver.h>

继承自 UNetDriver .

Public 成员函数

void AddNonQueuedActorForScrubbing (AActor const *Actor)
 If a channel is associated with Actor, adds the channel's GUID to the list of GUIDs excluded from queuing bunches during scrubbing.
 
void AddNonQueuedGUIDForScrubbing (FNetworkGUID InGUID)
 Adds the channel's GUID to the list of GUIDs excluded from queuing bunches during scrubbing.
 
void AddUserToReplay (const FString &UserString)
 Adds a join-in-progress user to the set of users associated with the currently recording replay (if any) 更多...
 
bool ComparePropertyState (const FDemoSavedPropertyState &State) const
 Compares the values of replicated properties stored in State with the current values of the object replicators. 更多...
 
bool ContinueListen (FURL &ListenURL)
 Called when we are already recording but have traveled to a new map to start recording again
 
virtual void FinishDestroy () override
 Called to finish destroying the object. 更多...
 
const FString & GetActiveReplayName () const
 Gets the actively recording or playback replay (stream) name. 更多...
 
float GetDemoCurrentTime () const
 Current record/playback position in seconds
 
const FString & GetDemoSessionID () const
 
PRAGMA_DISABLE_DEPRECATION_WARNINGS float GetDemoTotalTime () const
 Total time of demo in seconds
 
void GotoTimeInSeconds (const float TimeInSeconds, const FOnGotoTimeDelegate &InOnGotoTimeDelegate=FOnGotoTimeDelegate())
 Scrubs playback to the given time. 更多...
 
bool HasDeltaCheckpoints () const
 Returns whether or not this replay was recorded / is playing with delta checkpoints.
 
bool HasGameSpecificFrameData () const
 Returns whether or not this replay was recorded / is playing with the game specific per frame data feature.
 
bool HasLevelStreamingFixes () const
 Returns whether or not this replay was recorded / is playing with Level Streaming fixes.
 
virtual bool IsNetResourceValid (void) override
 
bool IsSavingCheckpoint () const
 Returns true if we're in the process of saving a checkpoint.
 
void NotifyGotoTimeFinished (bool bWasSuccessful)
 Called when a "go to time" operation is completed.
 
void OnSeamlessTravelStartDuringRecording (const FString &LevelName)
 Called when seamless travel begins when recording a replay.
 
void PendingNetGameLoadMapCompleted ()
 Read the streaming level information from the metadata after the level is loaded
 
virtual void QueueNetStartupActorForRollbackViaDeletion (AActor *Actor)
 Call this function during playback to track net startup actors that need a hard reset when scrubbing, which is done by destroying and then re-spawning
 
bool RemoveSplitscreenViewer (APlayerController *RemovePlayer, bool bMarkOwnerForDeletion=false)
 Removes a splitscreen demo viewer and cleans up its connection. 更多...
 
void RequestEventGroupDataForActiveReplay (const FString &Group, const FRequestEventGroupDataCallback &Delegate)
 Retrieve data for all events matching the requested group, and call the passed in delegate on completion.
 
void RestoreConnectionPostScrub (APlayerController *PC, UNetConnection *NetConnection)
 Restores the given player controller so that it properly points to the given NetConnection after scrubbing when viewing a replay. 更多...
 
FDemoSavedPropertyState SavePropertyState () const
 Returns the replicated state of every object on a current actor channel. 更多...
 
virtual void Serialize (FArchive &Ar) override
 Handles reading, writing, and reference collecting using FArchive. 更多...
 
void SetActorPrioritizationEnabled (const bool bInPrioritizeActors)
 Enable or disable prioritization of actors for recording.
 
void SetCheckpointSaveMaxMSPerFrame (const float InCheckpointSaveMaxMSPerFrame)
 Sets CheckpointSaveMaxMSPerFrame.
 
void SetMaxDesiredRecordTimeMS (const float InMaxDesiredRecordTimeMS)
 Sets the desired maximum recording time in milliseconds.
 
void SetSpectatorController (APlayerController *PC)
 Sets the main spectator controller to be used and adds them to the spectator control array 更多...
 
void SetViewerOverride (APlayerController *const InViewerOverride)
 Sets the controller to use as the viewpoint for recording prioritization purposes.
 
bool ShouldTickFlushAsyncEndOfFrame () const
 Returns true if TickFlush can be called in parallel with the Slate tick.
 
bool SpawnSplitscreenViewer (ULocalPlayer *NewPlayer, UWorld *InWorld)
 Creates a new splitscreen replay viewer. 更多...
 
void TickFlushAsyncEndOfFrame (float DeltaSeconds)
 Called by a task thread if the engine is doing async end of frame tasks in parallel with Slate.
 

Public 属性

double AccumulatedRecordTime
 Internal debug timing/tracking
 
bool bChannelsArePaused
 True if as have paused all of the channels
 
PRAGMA_ENABLE_DEPRECATION_WARNINGS int32 CurrentLevelIndex
 Index of LevelNames that is currently loaded
 
TSet< FNetworkGUID > DeletedNetStartupActorGUIDs
 Keeps track of NetGUIDs that were deleted, so we can skip them when saving checkpoints. 更多...
 
TSet< FString > DeletedNetStartupActors
 Net startup actors that need to be destroyed after checkpoints are loaded
 
float DemoCurrentTime
 Current record/playback position in seconds
 
int32 DemoFrameNum
 Current record/playback frame number
 
int32 DemoTotalFrames
 Total number of frames in the demo
 
PRAGMA_ENABLE_DEPRECATION_WARNINGS float DemoTotalTime
 Total time of demo in seconds
 
TMap< FNetworkGUID, FReplayExternalDataArray > ExternalDataToObjectMap
 ExternalDataToObjectMap is used to map a FNetworkGUID to the proper FReplayExternalDataArray
 
float OldDemoCurrentTime
 Old current record/playback position in seconds (so we can restore on checkpoint failure)
 
FOnDemoFinishPlaybackDelegate OnDemoFinishPlaybackDelegate
 Delegate for external systems to be notified when demo playback ends
 
FOnDemoFinishRecordingDelegate OnDemoFinishRecordingDelegate
 Public Delegate for external systems to be notified when replay recording is about to finish.
 
FOnGotoTimeMCDelegate OnGotoTimeDelegate
 Public delegate for external systems to be notified when scrubbing is complete. 更多...
 
FOnPauseChannelsDelegate OnPauseChannelsDelegate
 Delegate for external systems to be notified when channels are paused during playback, usually waiting for data to be available.
 
TArray< FPlaybackPacket > PlaybackPackets
 PlaybackPackets are used to buffer packets up when we read a demo frame, which we can then process when the time is right
 
PRAGMA_ENABLE_DEPRECATION_WARNINGS TSharedPtr< class INetworkReplayStreamer > ReplayStreamer
 Our network replay streamer
 
TMap< FString, FRollbackNetStartupActorInfo > RollbackNetStartupActors
 Net startup actors that need to be rolled back during scrubbing by being destroyed and re-spawned NOTE - DeletedNetStartupActors will take precedence here, and destroy the actor instead
 
PRAGMA_ENABLE_DEPRECATION_WARNINGS APlayerController * SpectatorController
 This is the main spectator controller that is used to view the demo world from
 

静态 Public 属性

static FOnDemoFailedToStartDelegate OnDemoFailedToStart
 Public delegate to be notified when a replay failed to start. 更多...
 
static FOnDemoStartedDelegate OnDemoStarted
 Public delegate for external systems to be notified when a replay begins. 更多...
 

友元

class UDemoNetConnection
 

详细描述

Simulated network driver for recording and playing back game sessions.

成员函数说明

◆ AddUserToReplay()

void UDemoNetDriver::AddUserToReplay ( const FString &  UserString)

Adds a join-in-progress user to the set of users associated with the currently recording replay (if any)

参数
UserStringa string that uniquely identifies the user, usually his or her FUniqueNetId

◆ ComparePropertyState()

bool UDemoNetDriver::ComparePropertyState ( const FDemoSavedPropertyState &  State) const

Compares the values of replicated properties stored in State with the current values of the object replicators.

Logs and returns true if there were any differences.

◆ FinishDestroy()

virtual void UDemoNetDriver::FinishDestroy ( )
overridevirtual

Called to finish destroying the object.

After UObject::FinishDestroy is called, the object's memory should no longer be accessed.

警告
Because properties are destroyed here, Super::FinishDestroy() should always be called at the end of your child class's FinishDestroy() method, rather than at the beginning.

重载 UObject .

◆ GetActiveReplayName()

const FString & UDemoNetDriver::GetActiveReplayName ( ) const
inline

Gets the actively recording or playback replay (stream) name.

Note, this will be empty when not recording or playing back.

◆ GetDemoSessionID()

const FString & UDemoNetDriver::GetDemoSessionID ( ) const
inline
返回
the unique identifier for the lifetime of this object.

◆ GotoTimeInSeconds()

void UDemoNetDriver::GotoTimeInSeconds ( const float  TimeInSeconds,
const FOnGotoTimeDelegate &  InOnGotoTimeDelegate = FOnGotoTimeDelegate() 
)

Scrubs playback to the given time.

参数
TimeInSeconds
InOnGotoTimeDelegateDelegate to call when finished. Will be called only once at most.

◆ IsNetResourceValid()

virtual bool UDemoNetDriver::IsNetResourceValid ( void  )
inlineoverridevirtual
返回
true if the net resource is valid or false if it should not be used

◆ RemoveSplitscreenViewer()

bool UDemoNetDriver::RemoveSplitscreenViewer ( APlayerController *  RemovePlayer,
bool  bMarkOwnerForDeletion = false 
)

Removes a splitscreen demo viewer and cleans up its connection.

参数
RemovePlayerThe PlayerController to remove from the replay system
bMarkOwnerForDeletionIf this function should handle deleting the given player as well.
返回
If the player was successfully removed from the replay.

◆ RestoreConnectionPostScrub()

void UDemoNetDriver::RestoreConnectionPostScrub ( APlayerController *  PC,
UNetConnection *  NetConnection 
)

Restores the given player controller so that it properly points to the given NetConnection after scrubbing when viewing a replay.

参数
PCThe PlayerController to set up the given NetConnection for
NetConnectionThe NetConnection to be assigned to the player controller.

◆ SavePropertyState()

FDemoSavedPropertyState UDemoNetDriver::SavePropertyState ( ) const

Returns the replicated state of every object on a current actor channel.

Use the result to compare in DiffReplicatedProperties.

◆ Serialize()

virtual void UDemoNetDriver::Serialize ( FArchive &  Ar)
overridevirtual

Handles reading, writing, and reference collecting using FArchive.

This implementation handles all FProperty serialization, but can be overridden for native variables.

重载 UObject .

◆ SetSpectatorController()

void UDemoNetDriver::SetSpectatorController ( APlayerController *  PC)

Sets the main spectator controller to be used and adds them to the spectator control array

参数
PCThe PlayerController to set the main controller param to.

◆ SpawnSplitscreenViewer()

bool UDemoNetDriver::SpawnSplitscreenViewer ( ULocalPlayer *  NewPlayer,
UWorld *  InWorld 
)

Creates a new splitscreen replay viewer.

参数
NewPlayerThe LocalPlayer in control of this new viewer
InWorldThe world to spawn the new viewer in.
返回
If the viewer was able to be created or not.

类成员变量说明

◆ DeletedNetStartupActorGUIDs

TSet<FNetworkGUID> UDemoNetDriver::DeletedNetStartupActorGUIDs

Keeps track of NetGUIDs that were deleted, so we can skip them when saving checkpoints.

Only used while recording.

◆ OnDemoFailedToStart

FOnDemoFailedToStartDelegate UDemoNetDriver::OnDemoFailedToStart
static

Public delegate to be notified when a replay failed to start.

UDemoNetDriver and FailureType are passed as params

◆ OnDemoStarted

FOnDemoStartedDelegate UDemoNetDriver::OnDemoStarted
static

Public delegate for external systems to be notified when a replay begins.

UDemoNetDriver is passed as a param

◆ OnGotoTimeDelegate

FOnGotoTimeMCDelegate UDemoNetDriver::OnGotoTimeDelegate

Public delegate for external systems to be notified when scrubbing is complete.

Only called for successful scrub.


该类的文档由以下文件生成: