Navigation
Unreal Engine C++ API Reference > Plugins > NetcodeUnitTest
Inheritance Hierarchy
- UObject
- FNetworkNotify
- FProtMinClientParms
- FProtMinClientHooks
- FUnitLogRedirect
- UMinimalClient
References
Module | NetcodeUnitTest |
Header | /Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Classes/MinimalClient.h |
Include | #include "MinimalClient.h" |
Syntax
UCLASS ()
class UMinimalClient :
public UObject,
public FNetworkNotify,
public FProtMinClientParms ,
public FProtMinClientHooks ,
public FUnitLogRedirect
Remarks
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.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
bool | bConnected | Runtime variables Whether or not the minimal client is connected |
![]() |
bool | bSentBunch | Whether or not a bunch was successfully sent |
![]() |
TArray< int32 > | PendingNetActorChans | If notifying of net actor creation, this keeps track of new actor channel indexes pending notification |
![]() ![]() |
TObjectPtr< UNetConnection > | UnitConn | Stores a reference to the server connection |
![]() ![]() |
TObjectPtr< UNetDriver > | UnitNetDriver | Stores a reference to the created unit test net driver, for execution and later cleanup |
![]() ![]() |
TObjectPtr< UWorld > | UnitWorld | Stores a reference to the created empty world, for execution and later cleanup |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UMinimalClient
(
const FObjectInitializer& ObjectInitializer |
UMinimalClient |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | Cleanup () |
Disconnects and cleans up the minimal client. |
![]() |
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. |
![]() |
bool | Creates the minimal client state, and connects to the server | |
![]() |
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) |
![]() |
FOutBunch * | CreateChannelBunchByName
(
const FName& ChName, |
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) |
![]() |
void | Creates a net driver for the minimal client | |
![]() |
void | DiscardChannelBunch
(
FOutBunch* Bunch |
Discards a created bunch, without sending it - don't use this for sent packets |
![]() |
void | 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) | |
![]() |
UNetConnection * | GetConn () |
Retrieve the value of UnitConn |
![]() |
EMinClientFlags | Retrieve the value of MinClientFlags | |
![]() |
UWorld * | GetUnitWorld () |
Retrieve the value of UnitWorld |
![]() |
void | InternalNotifyNetworkFailure
(
UWorld* InWorld, |
|
![]() |
bool | IsConnected () |
Whether or not the minimal client is connected to the server |
![]() ![]() |
bool | IsTickable () |
Whether or not the minimal client requires ticking. |
![]() ![]() |
void | NotifyAcceptedConnection
(
UNetConnection* Connection |
|
![]() ![]() |
bool | NotifyAcceptingChannel
(
UChannel* Channel |
|
![]() ![]() |
EAcceptConnection::Type | FNetworkNotify. | |
![]() ![]() |
void | NotifyControlMessage
(
UNetConnection* Connection, |
|
![]() |
void | NotifyReceivedRawPacket
(
void* Data, |
See FOnReceivedRawPacket |
![]() |
void | NotifyReceiveRPC
(
AActor* Actor, |
See FOnProcessNetEvent |
![]() |
void | NotifySendRPC
(
AActor* Actor, |
See FOnSendRPC |
![]() |
void | NotifySocketSend
(
void* Data, |
See FOnLowLevelSend |
![]() |
bool | PostSendRPC
(
FString RPCName, |
Internal function, for handling the aftermath of a checked RPC call |
![]() |
void | PreSendRPC () |
Internal function, for preparing for a checked RPC call |
![]() |
void | ResetConnTimeout
(
float Duration |
Resets the net connection timeout |
![]() |
bool | SendControlBunch
(
FOutBunch* ControlChanBunch |
Sends a bunch over the control channel |
![]() |
void | Sends the packet for triggering the initial join (usually is delayed, by the PacketHandler) | |
![]() |
bool | SendRawBunch
(
FOutBunch& Bunch, |
Sends a raw packet bunch, directly to the NetConnection, with the option of automatically splitting into partial bunches. |
![]() |
bool | SendRPCChecked
(
UObject* Target, |
As above, except optimized for use with reflection |
![]() |
bool | SendRPCChecked
(
UObject* Target, |
Sends the specified RPC for the specified actor, and verifies that the RPC was sent (triggering RPCFailureDel if not) |
![]() |
void | UnitTick
(
float DeltaTime |
Ticks the minimal client, through the owner unit tests UnitTick function |
![]() ![]() |
void | WriteControlLogin
(
FOutBunch* ControlChanBunch |
Writes the NMT_Login message, as a part of SendInitialJoin (separated to make it overridable) |