AOnlineBeaconHost

Main actor that listens for side channel communication from another Unreal Engine application

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

OnlineSubsystemUtils

Header

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

Include

#include "OnlineBeaconHost.h"

Syntax

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

Remarks

Main actor that listens for side channel communication from another Unreal Engine application

The AOnlineBeaconHost listens for connections to route to a registered AOnlineBeaconHostObject The AOnlineBeaconHostObject is responsible for spawning the server version of the AOnlineBeaconClient The AOnlineBeaconHost pairs the two client actors, verifies the validity of the exchange, and accepts/continues the connection

Variables

Name Description

Protected variable UProperty Config

bool

 

bAuthRequired

Set this to true if you require clients to negotiate auth prior to joining the beacon

Public variable UProperty Config

int32

 

ListenPort

Configured listen port for this beacon host

Protected variable UProperty Config

uint32

 

MaxAuthTokenSize

Constructors

Name Description

Public function

AOnlineBeaconHost

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

DisconnectClient

(
    AOnlineBeaconClient* ClientAct...
)

Disconnect a given client from the host

Public function Virtual

AOnlineBeaco...

 

GetClientActor

(
    UNetConnection* Connection
)

Get a client beacon actor for a given connection

Protected function

FString

 

GetDebugName

(
    UNetConnection* Connection
)

Public function

AOnlineBeaco...

 

GetHost

(
    const FString& BeaconType
)

Get the host responsible for a given beacon type

Public function Virtual

int32

 

GetListenPort()

Get the listen port for this beacon

Public function Virtual

bool

 

InitHost()

Initialize the host beacon on a specified port Creates the net driver and begins listening for connections

Protected function

void

 

OnAuthenticationVerificationComplete

(
    const FUniqueNetId& PlayerId,
    const FOnlineError& Error
)

Event which must be signaled to complete an authentication verification request.

Public function Virtual

void

 

RegisterHost

(
    AOnlineBeaconHostObject* NewHo...
)

Register a beacon host and its client actor factory

Public function Virtual

void

 

RemoveClientActor

(
    AOnlineBeaconClient* ClientAct...
)

Remove a client beacon actor from the list of active connections

Protected function Virtual

bool

 

StartVerifyAuthentication

(
    const FUniqueNetId& PlayerId,
    const FString& AuthenticationToken
)

Start verifying an authentication token for a connection.

Public function Virtual

void

 

UnregisterHost

(
    const FString& BeaconType
)

Unregister a beacon host, making future connections of a given type unresponsive

Overridden from AOnlineBeacon

Name Description

Public function Virtual

void

 

HandleNetworkFailure

(
    UWorld* World,
    UNetDriver* NetDriver,
    ENetworkFailure::Type FailureType,
    const FString& ErrorString
)

Notification of network error messages, allows a beacon to handle the failure

Overridden from AActor

Name Description

Public function Virtual

void

 

OnNetCleanup

(
    UNetConnection* Connection
)

Handles cleaning up the associated Actor when killing the connection

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())

Typedefs

Name

Description

FOnBeaconConnected

Delegate to route a connection event to the appropriate beacon host, by type

FOnBeaconSpawned

Delegate to route a connection attempt to the appropriate beacon host, by type