Nelaric Unreal Gameplay
Gameplay framework API
Loading...
Searching...
No Matches
NelaricPlayerController.h
Go to the documentation of this file.
1// Copyright (c) 2026 Nelaric
2
6
7#pragma once
8
9#include "CoreTypes.h"
10#include "Containers/UnrealString.h"
11#include "Delegates/Delegate.h"
12#include "GameFramework/PlayerController.h"
13
14#include "NelaricPlayerController.generated.h"
15
17DECLARE_MULTICAST_DELEGATE_ThreeParams(FDepartureDecision, uint64, const FString&, bool);
18
26UCLASS(MinimalAPI, Blueprintable)
27class ANelaricPlayerController : public APlayerController
28{
29 GENERATED_BODY()
30
31public:
43 GAMEPLAYRUNTIME_API bool RequestDepartureApproval(uint64 RequestId, const FString& TargetAddress);
44
52 GAMEPLAYRUNTIME_API FDepartureDecision& OnDepartureDecision();
53
54public:
55 // Native subclasses in other modules need these virtual definitions.
56 GAMEPLAYRUNTIME_API virtual void ServerRequestDepartureApproval_Implementation(uint64 RequestId,
57 const FString& TargetAddress);
58 GAMEPLAYRUNTIME_API virtual void
59 ClientReceiveDepartureDecision_Implementation(uint64 RequestId, const FString& TargetAddress, bool bApproved);
60
61private:
62 UFUNCTION(Server, Reliable)
63 void ServerRequestDepartureApproval(uint64 RequestId, const FString& TargetAddress);
64
65 UFUNCTION(Client, Reliable)
66 void ClientReceiveDepartureDecision(uint64 RequestId, const FString& TargetAddress, bool bApproved);
67
68 FDepartureDecision DepartureDecision;
69};
DECLARE_MULTICAST_DELEGATE_ThreeParams(FDepartureDecision, uint64, const FString &, bool)
Reports the current server's departure decision on the game thread.
Base player controller for NelaricGameplay worlds.
Definition NelaricPlayerController.h:28
GAMEPLAYRUNTIME_API FDepartureDecision & OnDepartureDecision()
Observes decisions returned by the current server.
GAMEPLAYRUNTIME_API bool RequestDepartureApproval(uint64 RequestId, const FString &TargetAddress)
Asks the current server to approve leaving its session.