Files
DedicatedServerCourse/Source/FPSTemplate/Public/Game/ShooterGameMode.h
2026-03-12 21:31:36 -04:00

58 lines
1.4 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameLiftClpTypes.h"
#include "ShooterGameModeBase.h"
#include "ShooterGameMode.generated.h"
DECLARE_LOG_CATEGORY_EXTERN(LogShooterGameMode, Log, All);
struct FProcessParameters;
struct FServerParameters;
struct FGameLiftConfig
{
bool bIsAnywhereFleet = false;
bool bAllOptionsFound = false;
int32 ServerPort = 7777;
cmdlineparser::details::FParseResult AuthTokenResult;
cmdlineparser::details::FParseResult FleetIdResult;
cmdlineparser::details::FParseResult HostIdResult;
cmdlineparser::details::FParseResult WebSocketUrlResult;
};
/**
*
*/
UCLASS()
class FPSTEMPLATE_API AShooterGameMode : public AShooterGameModeBase
{
GENERATED_BODY()
public:
AShooterGameMode();
protected:
virtual void BeginPlay() override;
virtual void InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) override;
private:
FGameLiftConfig GameLiftConfig;
FString CachedCommandLine;
static FString GetSHA256Hash(const FString& CommandLineString);
void InitGameLift();
bool GetAnywhereFleetParameters(const FString& CommandLineString);
void LogAnywhereFleetParameters();
static void LogServerParameters(const FServerParameters& InServerParameters);
static FString GetValueOrHash(const FString& Value);
TSharedPtr<FProcessParameters> ProcessParameters;
// TSharedPtr<FServerParameters> ServerParameters;
};