37 lines
1005 B
C++
37 lines
1005 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Interfaces/IHttpRequest.h"
|
|
#include "UI/HTTP/HTTPRequestManager.h"
|
|
#include "PortalManager.generated.h"
|
|
|
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FBroadcastJoinGameSessionMessage, const FString&, StatusMessage, bool, bShouldResetJoinGameButton);
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class DEDICATEDSERVERS_API UPortalManager : public UHTTPRequestManager
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
|
|
UPROPERTY(BlueprintAssignable)
|
|
FBroadcastJoinGameSessionMessage BroadcastJoinGameSessionMessage;
|
|
|
|
auto JoinGameSession() -> void;
|
|
|
|
private:
|
|
|
|
void FindOrCreateGameSession_Response(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
|
|
FString GetUniquePlayerId() const;
|
|
void HandleGameSessionStatus(const FString& Status, const FString& SessionId);
|
|
void TryCreatePlayerSession(const FString& PlayerId, const FString& GameSessionId);
|
|
|
|
FTimerHandle CreateSessionTimer;
|
|
|
|
};
|