Navigation
API > API/Runtime > API/Runtime/Engine
Stores FTestWorldInstances for a server and clients and allows synchronously ticking them. Can be used within a single function to make automated tests that use the whole world & net driver flow.
| Name | FTestWorlds |
| Type | struct |
| Header File | /Engine/Source/Runtime/Engine/Public/Tests/NetTestHelpers.h |
| Include Path | #include "Tests/NetTestHelpers.h" |
Syntax
struct FTestWorlds
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTestWorlds
(
const EReplicationSystem ReplicationSystem |
Creates a server world using the default map (Entry) and default GameMode class (GameMode) | Tests/NetTestHelpers.h | |
FTestWorlds
(
const TCHAR* ServerURL, |
Creates a server world using the given URL. | Tests/NetTestHelpers.h | |
FTestWorlds
(
const FString& MapName, |
Creates a server world using a specific map name and GameMode class | Tests/NetTestHelpers.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FTestWorlds() |
Tests/NetTestHelpers.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnClientConnected | TMulticastDelegate_OneParam< void, const FTestWorldInstance &Client > | Delegate called after a client finished connecting to the server | Tests/NetTestHelpers.h |
| FPreTickAll | TMulticastDelegate_NoParams< void > | Delegate called before a TickAll is executed | Tests/NetTestHelpers.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Clients | TArray< FTestWorldInstance > | Tests/NetTestHelpers.h | ||
| OnClientConnected | FOnClientConnected | Tests/NetTestHelpers.h | ||
| PreTickAllDelegate | FPreTickAll | Tests/NetTestHelpers.h | ||
| Server | FTestWorldInstance | Server and Client Worlds | Tests/NetTestHelpers.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| NetDriverCreatedHandle | FDelegateHandle | Tests/NetTestHelpers.h | ||
| PIERestoration | FScopedNetTestPIERestoration | Restore GWorld and other PIE settings. | Tests/NetTestHelpers.h | |
| TestSettings | FScopedTestSettings | Sets up important settings for the networking system to run optimally. | Tests/NetTestHelpers.h | |
| TickDeltaSeconds | float | Tests/NetTestHelpers.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 ConnectNewClient () |
Create a new client and connect it to the server. | Tests/NetTestHelpers.h | |
bool CreateAndConnectClient() |
Create a client and fully connect it to the server. Returns true if the connection succeeded | Tests/NetTestHelpers.h | |
bool DoesReplicatedObjectExistOnClient
(
UObject* ServerObject, |
Returns if the remote instance of a replicated object exists on the client or not. | Tests/NetTestHelpers.h | |
T * FindReplicatedObjectOnClient
(
UObject* ServerObject, |
Tests/NetTestHelpers.h | ||
UObject * FindReplicatedObjectOnClient
(
UObject* ServerObject, |
Find the remote instance of a replicated object and ensures if it can't find it | Tests/NetTestHelpers.h | |
APlayerController * GetServerPlayerControllerOfClient
(
uint32 ClientIndex |
Return the Server's player state corresponding to a specific client | Tests/NetTestHelpers.h | |
float GetTickDeltaSeconds() |
Tests/NetTestHelpers.h | ||
bool IsServerObjectReplicated
(
const UObject* ServerObject |
Returns if the object is registered for replication on the server. | Tests/NetTestHelpers.h | |
void SetTickInSeconds
(
float TickInSeconds |
Tests/NetTestHelpers.h | ||
void TickAll
(
int32 NumTicks |
Ticks all server & client worlds NumTick times synchronously. | Tests/NetTestHelpers.h | |
bool TickAllUntil
(
const PredicateT& Predicate, |
Inline functions. | Tests/NetTestHelpers.h | |
void TickClients() |
Tests/NetTestHelpers.h | ||
void TickClientsAndDelay
(
uint32 NumFramesToDelay |
Tests/NetTestHelpers.h | ||
void TickClientsAndDrop() |
Tests/NetTestHelpers.h | ||
void TickServer() |
Tests/NetTestHelpers.h | ||
void TickServerAndDelay
(
uint32 NumFramesToDelay |
Tick the world but delay the packets that would be sent | Tests/NetTestHelpers.h | |
void TickServerAndDrop() |
Tick the world and drop all outgoing packets | Tests/NetTestHelpers.h | |
bool WaitForClientConnect
(
FTestWorldInstance& Client |
Ticks all server & client worlds until the passed in client world has a valid client PlayerController. | Tests/NetTestHelpers.h |