AOnlineBeaconClient

Base class for any unique beacon connectivity, paired with an [AOnlineBeaconHostObject](API\Plugins\OnlineSubsystemUtils\AOnlineBeaconHostObject) implementation

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

OnlineSubsystemUtils

Header

/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Public/OnlineBeaconClient.h

Include

#include "OnlineBeaconClient.h"

Syntax

UCLASS(Transient, NotPlaceable, Config=Engine)
class AOnlineBeaconClient : public AOnlineBeacon

Remarks

Base class for any unique beacon connectivity, paired with an AOnlineBeaconHostObject implementation

This is the actual actor that replicates across client/server and where all RPCs occur On the host, the life cycle is managed by an AOnlineBeaconHostObject On the client, the life cycle is managed by the game

Variables

Name Description

Protected variable UProperty

TObjectPtr< UNe...

 

BeaconConnection

Network connection associated with this beacon client instance

Protected variable UProperty

TObjectPtr< AOn...

 

BeaconOwner

Owning beacon host of this beacon actor (server only)

Protected variable UProperty

EBeaconConnecti...

 

ConnectionState

State of the connection

Protected variable

FOnHostConnecti...

 

HostConnectionFailure

Delegate for host beacon connection failures

Protected variable

FTimerHandle

 

TimerHandle_OnFailure

Handle for efficient management of OnFailure timer

Constructors

Name Description

Public function

AOnlineBeaconClient

(
    const FObjectInitializer& ObjectIn...
)

For backwards compatibility with newer engine encryption API

Functions

Name Description

Public function Const

AOnlineBeaco...

 

GetBeaconOwner()

Get the owner of this beacon actor, some host that is listening for connections (server side only, clients have no access)

Public function Const

FString

 

GetBeaconType()

Each beacon must have a unique type identifier

Public function Const

EBeaconConne...

 

GetConnectionState()

Get the connection state Higher level than the net connection because of the handshaking of the actors

Public function Const

const FUniqu...

 

GetUniqueId()

Get the unique id of the user on this connection (server side only)

Public function

bool

 

InitClient

(
    FURL& URL
)

Initialize the client beacon with connection endpoint Creates the net driver and attempts to connect with the destination

Public function Virtual

void

 

OnConnected()

A connection has been made and RPC/replication can begin

Public function

FOnHostConne...

 

OnHostConnectionFailure()

Delegate triggered on failures to connect to a host beacon

Public function

void

 

SendInitialJoin()

Send the packet for triggering the initial join

Public function

void

 

SetBeaconOwner

(
    AOnlineBeaconHostObject* InBea...
)

Set the owner of this beacon actor, some host that is listening for connections (server side only, clients have no access)

Public function

void

 

SetConnectionState

(
    EBeaconConnectionState NewConnectio...
)

Set the connection state Higher level than the net connection because of the handshaking of the actors

Public function

void

 

SetEncryptionData

(
    const FEncryptionData& InEncryptio...
)

Sets the encryption data that will be used for server connections.

Public function Virtual

void

 

SetNetConnection

(
    UNetConnection* NetConnection
)

Associate this beacon with a network connection

Overridden from AOnlineBeacon

Name Description

Public function Virtual

void

 

DestroyBeacon()

Beacon cleanup and net driver destruction

Public function Virtual

void

 

OnFailure()

Notification that failure needs to be handled

Overridden from AActor

Name Description

Public function Virtual

bool

 

DestroyNetworkActorHandled()

Called by DestroyActor(), gives actors a chance to op out of actor destruction Used by network code to have the net connection timeout/cleanup first

Public function Virtual Const

UNetConnecti...

 

GetNetConnection()

Get the owning connection used for communicating between client/server

Public function Virtual Const

const AActor...

 

GetNetOwner()

Return the actor responsible for replication, if any. Typically the player controller

Public function Virtual

void

 

OnNetCleanup

(
    UNetConnection* Connection
)

Handles cleaning up the associated Actor when killing the connection

Public function Virtual

void

 

Tick

(
    float DeltaSeconds
)

Function called every frame on this Actor.

Public function Virtual Const

bool

 

UseShortConnectTimeout()

Used by the net connection to determine if a net owning actor should switch to using the shortened timeout value

Overridden from FNetworkNotify

Name Description

Public function Virtual

void

 

NotifyControlMessage

(
    UNetConnection* Connection,
    uint8 MessageType,
    FInBunch& Bunch
)

Handler for messages sent through a remote connection's control channel not required to handle the message, but if it reads any data from Bunch, it MUST read the ENTIRE data stream for that message (i.e. use FNetControlMessage::Receive())

Deprecated Functions

Name Description

Public function

void

 

SetEncryptionKey

(
    TArrayView< uint8 > InEncryptionKey
)

Use SetEncryptionData instead

Public function

void

 

SetEncryptionToken

(
    const FString& InEncryptionToken
)

Use SetEncryptionData instead