AOnlineBeacon

Base class for beacon communication (Unreal Networking, but outside normal gameplay traffic)

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

OnlineSubsystemUtils

Header

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

Include

#include "OnlineBeacon.h"

Syntax

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

Remarks

Base class for beacon communication (Unreal Networking, but outside normal gameplay traffic)

Variables

Name Description

Protected variable UProperty Config

float

 

BeaconConnectionInitialTimeout

Time beacon will wait to establish a connection with the beacon host

Protected variable UProperty Config

float

 

BeaconConnectionTimeout

Time beacon will wait for packets after establishing a connection before giving up

Protected variable

EBeaconState::T...

 

BeaconState

State of beacon

Protected variable

FDelegateHandle

 

HandleNetworkFailureDelegateHandle

Handle to the registered HandleNetworkFailure delegate

Protected variable UProperty

TObjectPtr< UNe...

 

NetDriver

Net driver routing network traffic

Protected variable

FName

 

NetDriverDefinitionName

Name of definition to use when creating the net driver

Constructors

Name Description

Public function

AOnlineBeacon

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual

void

 

DestroyBeacon()

Beacon cleanup and net driver destruction

Public function Const

EBeaconState...

 

GetBeaconState()

Get the current state of the beacon

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

Protected function Virtual

bool

 

InitBase()

Common initialization for all beacon types

Protected function Virtual

void

 

OnFailure()

Notification that failure needs to be handled

Public function

void

 

PauseBeaconRequests

(
    bool bPause
)

Set Beacon state

should the beacon stop accepting requests

Overridden from AActor

Name Description

Public function Virtual

void

 

EndPlay

(
    const EEndPlayReason::Type EndPlayR...
)

Overridable function called whenever this actor is being removed from a level

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

Protected function Virtual Const

bool

 

HasNetOwner()

Overridden to return that player controllers are capable of RPCs

Public function Virtual Const

bool

 

IsLevelBoundsRelevant()

Indicates whether this actor should participate in level bounds calculations

Public function Virtual Const

bool

 

IsNetRelevantFor

(
    const AActor* RealViewer,
    const AActor* ViewTarget,
    const FVector& SrcLocation
)

Checks to see if this actor is relevant for a specific network connection

Public function Virtual Const

bool

 

IsRelevancyOwnerFor

(
    const AActor* ReplicatedActor,
    const AActor* ActorOwner,
    const AActor* ConnectionActor
)

Check if this actor is the owner when doing relevancy checks for actors marked bOnlyRelevantToOwner

Public function Virtual

void

 

OnActorChannelOpen

(
    FInBunch& InBunch,
    UNetConnection* Connection
)

Allows for a specific response from the actor when the actor channel is opened (client side)

Overridden from FNetworkNotify

Name Description

Public function Virtual

void

 

NotifyAcceptedConnection

(
    UNetConnection* Connection
)

Notification that a new connection has been created/established as a result of a remote request, previously approved by NotifyAcceptingConnection

Public function Virtual

bool

 

NotifyAcceptingChannel

(
    UChannel* Channel
)

Notification that a new channel is being created/opened as a result of a remote request (Actor creation, etc)

Public function Virtual

EAcceptConne...

 

NotifyAcceptingConnection()

Notification that an incoming connection is pending, giving the interface a chance to reject the request

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