2026-03-31 07:42:56 -04:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
2026-04-02 22:01:25 -04:00
|
|
|
#include "Interfaces/IHttpRequest.h"
|
2026-03-31 07:42:56 -04:00
|
|
|
#include "UI/HTTP/HTTPRequestManager.h"
|
|
|
|
|
#include "PortalManager.generated.h"
|
|
|
|
|
|
2026-04-03 20:34:49 -04:00
|
|
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FBroadcastJoinGameSessionMessage, const FString&, StatusMessage, bool, bShouldResetJoinGameButton);
|
2026-03-31 08:15:28 -04:00
|
|
|
|
2026-03-31 07:42:56 -04:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
UCLASS()
|
|
|
|
|
class DEDICATEDSERVERS_API UPortalManager : public UHTTPRequestManager
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
2026-03-31 08:15:28 -04:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
UPROPERTY(BlueprintAssignable)
|
|
|
|
|
FBroadcastJoinGameSessionMessage BroadcastJoinGameSessionMessage;
|
|
|
|
|
|
2026-04-02 22:01:25 -04:00
|
|
|
auto JoinGameSession() -> void;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
void FindOrCreateGameSession_Response(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
|
2026-04-05 16:43:32 -04:00
|
|
|
FString GetUniquePlayerId() const;
|
2026-04-05 20:20:35 -04:00
|
|
|
void HandleGameSessionStatus(const FString& SessionId, const FString& Status);
|
2026-04-05 16:43:32 -04:00
|
|
|
void TryCreatePlayerSession(const FString& PlayerId, const FString& GameSessionId);
|
2026-04-05 17:07:48 -04:00
|
|
|
void FindPlayerSession_Response(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
|
|
|
|
|
|
2026-04-05 16:43:32 -04:00
|
|
|
|
|
|
|
|
FTimerHandle CreateSessionTimer;
|
|
|
|
|
|
2026-03-31 07:42:56 -04:00
|
|
|
};
|