Navigation
API > API/Plugins > API/Plugins/NetcodeUnitTest
Base class for implementing a barebones/stripped-down game client, capable of connecting to a regular game server, but stripped/locked-down so that the absolute minimum of client/server netcode functionality is executed, for connecting the client.
| Name | UMinimalClient |
| Type | class |
| Header File | /Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Classes/MinimalClient.h |
| Include Path | #include "MinimalClient.h" |
Syntax
UCLASS ()
class UMinimalClient :
public UObject ,
public FNetworkNotify ,
public FProtMinClientParms ,
public FProtMinClientHooks ,
public FUnitLogRedirect
Inheritance Hierarchy
- FMinClientHooks → FProtMinClientHooks → UMinimalClient
- FMinClientParms → FProtMinClientParms → UMinimalClient
- FNetworkNotify → UMinimalClient
- FUnitLogInterface → FUnitLogRedirect → UMinimalClient
- UObjectBase → UObjectBaseUtility → UObject → UMinimalClient
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UMinimalClient
(
const FObjectInitializer& ObjectInitializer |
UMinimalClient | MinimalClient.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| InternalNotifyNetworkFailureDelegateHandle | FDelegateHandle | Handle to the registered InternalNotifyNetworkFailure delegate | MinimalClient.h | |
| UUnitTestActorChannel | friend | MinimalClient.h | ||
| UUnitTestChannel | friend | MinimalClient.h | ||
| UUnitTestNetConnection | friend | MinimalClient.h | ||
| UUnitTestPackageMap | friend | MinimalClient.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Cleanup() |
Disconnects and cleans up the minimal client. | MinimalClient.h | |
bool Connect
(
FMinClientParms Parms, |
Connects the minimal client to a server, with Parms specifying the server details and minimal client configuration, and passing back the low level netcode events specified by Hooks. | MinimalClient.h | |
FOutBunch * CreateChannelBunch
(
EChannelType ChType, |
Creates a bunch for the specified channel, with the ability to create the channel as well WARNING: Can return nullptr! (e.g. if the control channel is saturated) | MinimalClient.h | |
| Creates a bunch for the specified channel, with the ability to create the channel as well WARNING: Can return nullptr! (e.g. if the control channel is saturated) | MinimalClient.h | ||
void DiscardChannelBunch
(
FOutBunch* Bunch |
Discards a created bunch, without sending it - don't use this for sent packets | MinimalClient.h | |
UNetConnection * GetConn() |
Retrieve the value of UnitConn | MinimalClient.h | |
EMinClientFlags GetMinClientFlags() |
Retrieve the value of MinClientFlags | MinimalClient.h | |
UWorld * GetUnitWorld() |
Retrieve the value of UnitWorld | MinimalClient.h | |
bool IsConnected() |
Whether or not the minimal client is connected to the server | MinimalClient.h | |
bool IsTickable() |
Whether or not the minimal client requires ticking. | MinimalClient.h | |
| Internal function, for handling the aftermath of a checked RPC call | MinimalClient.h | ||
void PreSendRPC() |
Internal function, for preparing for a checked RPC call | MinimalClient.h | |
void ResetConnTimeout
(
float Duration |
Resets the net connection timeout | MinimalClient.h | |
bool SendControlBunch
(
FOutBunch* ControlChanBunch |
Sends a bunch over the control channel | MinimalClient.h | |
bool SendRawBunch
(
FOutBunch& Bunch, |
Sends a raw packet bunch, directly to the NetConnection, with the option of automatically splitting into partial bunches. | MinimalClient.h | |
bool SendRPCChecked
(
UObject* Target, |
As above, except optimized for use with reflection | MinimalClient.h | |
bool SendRPCChecked
(
UObject* Target, |
Sends the specified RPC for the specified actor, and verifies that the RPC was sent (triggering RPCFailureDel if not) | MinimalClient.h | |
void UnitTick
(
float DeltaTime |
Ticks the minimal client, through the owner unit tests UnitTick function | MinimalClient.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ConnectMinimalClient() |
Creates the minimal client state, and connects to the server | MinimalClient.h | |
void CreateNetDriver() |
Creates a net driver for the minimal client | MinimalClient.h | |
void DisconnectMinimalClient() |
Disconnects the minimal client - including destructing the net driver and such (tears down the whole connection) NOTE: Based upon the HandleDisconnect function, except removing parts that are undesired (e.g. which trigger level switch) | MinimalClient.h | |
void InternalNotifyNetworkFailure
(
UWorld* InWorld, |
MinimalClient.h | ||
void NotifyReceivedRawPacket
(
void* Data, |
See FOnReceivedRawPacket | MinimalClient.h | |
| See FOnProcessNetEvent | MinimalClient.h | ||
void NotifySendRPC
(
AActor* Actor, |
See FOnSendRPC | MinimalClient.h | |
void NotifySocketSend
(
void* Data, |
See FOnLowLevelSend | MinimalClient.h | |
void SendInitialJoin() |
Sends the packet for triggering the initial join (usually is delayed, by the PacketHandler) | MinimalClient.h | |
virtual void WriteControlLogin
(
FOutBunch* ControlChanBunch |
Writes the NMT_Login message, as a part of SendInitialJoin (separated to make it overridable) | MinimalClient.h |
Overridden from FNetworkNotify
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void NotifyAcceptedConnection
(
UNetConnection* Connection |
MinimalClient.h | ||
virtual bool NotifyAcceptingChannel
(
UChannel* Channel |
MinimalClient.h | ||
virtual EAcceptConnection::Type NotifyAcceptingConnection() |
FNetworkNotify. | MinimalClient.h | |
virtual void NotifyControlMessage
(
UNetConnection* Connection, |
MinimalClient.h |