Nelaric Unreal Gameplay
Gameplay framework API
Loading...
Searching...
No Matches
TransitionBeaconClient.h
Go to the documentation of this file.
1// Copyright (c) 2026 Nelaric
2
6
7#pragma once
8
9#include "CoreTypes.h"
11#include "Delegates/Delegate.h"
12#include "OnlineBeaconClient.h"
13
14#include "TransitionBeaconClient.generated.h"
15
21DECLARE_MULTICAST_DELEGATE_ThreeParams(FTargetDecision, uint64, bool, bool);
22
29UCLASS(MinimalAPI, Transient, NotPlaceable)
30class ATransitionBeaconClient : public AOnlineBeaconClient
31{
32 GENERATED_BODY()
33
34public:
43 GAMEPLAYRUNTIME_API bool BeginTargetApproval(const Nelaric::FNetworkEndpoint& Endpoint, uint64 RequestId);
44
53 GAMEPLAYRUNTIME_API FTargetDecision& OnTargetDecision();
54
55public:
60 GAMEPLAYRUNTIME_API virtual void OnConnected() override;
61
66 GAMEPLAYRUNTIME_API virtual void OnFailure() override;
67
68 // Native subclasses in other modules need these virtual definitions.
69 GAMEPLAYRUNTIME_API virtual void ServerRequestTargetApproval_Implementation(uint64 RequestId);
70 GAMEPLAYRUNTIME_API virtual void ClientReceiveTargetDecision_Implementation(uint64 RequestId, bool bApproved);
71
72private:
73 UFUNCTION(Server, Reliable)
74 void ServerRequestTargetApproval(uint64 RequestId);
75
76 UFUNCTION(Client, Reliable)
77 void ClientReceiveTargetDecision(uint64 RequestId, bool bApproved);
78
79 uint64 PendingRequestId = 0;
80 bool bDecisionDelivered = false;
81 FTargetDecision TargetDecision;
82};
DECLARE_MULTICAST_DELEGATE_ThreeParams(FDepartureDecision, uint64, const FString &, bool)
Reports the current server's departure decision on the game thread.
Contacts a destination server before game travel.
Definition TransitionBeaconClient.h:31
GAMEPLAYRUNTIME_API FTargetDecision & OnTargetDecision()
Observes the destination server's decision or failure.
virtual GAMEPLAYRUNTIME_API void OnConnected() override
Sends the approval request after beacon connection.
virtual GAMEPLAYRUNTIME_API void OnFailure() override
Reports a failed beacon connection.
GAMEPLAYRUNTIME_API bool BeginTargetApproval(const Nelaric::FNetworkEndpoint &Endpoint, uint64 RequestId)
Connects to a target's beacon and requests admission.
Host address and transport port of one network endpoint.
Definition NetworkEndpoint.h:20