2026-02-24 22:39:26 -05:00
|
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
2026-03-12 07:13:47 -04:00
|
|
|
|
#include "GameLiftClpTypes.h"
|
2026-02-24 22:39:26 -05:00
|
|
|
|
#include "ShooterGameModeBase.h"
|
|
|
|
|
|
#include "ShooterGameMode.generated.h"
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_LOG_CATEGORY_EXTERN(LogShooterGameMode, Log, All);
|
|
|
|
|
|
|
2026-03-04 06:40:59 -05:00
|
|
|
|
struct FProcessParameters;
|
|
|
|
|
|
struct FServerParameters;
|
|
|
|
|
|
|
2026-03-10 22:38:12 -04:00
|
|
|
|
struct FGameLiftConfig
|
2026-03-05 10:00:22 -05:00
|
|
|
|
{
|
2026-03-12 07:13:47 -04:00
|
|
|
|
bool bAllOptionsFound = false;
|
2026-03-10 22:38:12 -04:00
|
|
|
|
|
2026-03-12 07:13:47 -04:00
|
|
|
|
int32 ServerPort = 7777;
|
2026-03-05 10:00:22 -05:00
|
|
|
|
|
2026-03-12 07:13:47 -04:00
|
|
|
|
cmdlineparser::details::FParseResult AuthTokenResult;
|
|
|
|
|
|
cmdlineparser::details::FParseResult FleetIdResult;
|
|
|
|
|
|
cmdlineparser::details::FParseResult HostIdResult;
|
|
|
|
|
|
cmdlineparser::details::FParseResult WebSocketUrlResult;
|
2026-03-10 22:38:12 -04:00
|
|
|
|
};
|
2026-03-05 10:00:22 -05:00
|
|
|
|
|
2026-02-24 22:39:26 -05:00
|
|
|
|
/**
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
UCLASS()
|
|
|
|
|
|
class FPSTEMPLATE_API AShooterGameMode : public AShooterGameModeBase
|
|
|
|
|
|
{
|
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
public:
|
2026-03-04 06:40:59 -05:00
|
|
|
|
|
2026-03-10 22:38:12 -04:00
|
|
|
|
AShooterGameMode();
|
2026-03-04 06:40:59 -05:00
|
|
|
|
|
2026-03-10 22:38:12 -04:00
|
|
|
|
protected:
|
2026-02-24 22:39:26 -05:00
|
|
|
|
virtual void BeginPlay() override;
|
2026-03-04 06:40:59 -05:00
|
|
|
|
virtual void InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) override;
|
2026-03-10 22:38:12 -04:00
|
|
|
|
|
2026-02-24 22:39:26 -05:00
|
|
|
|
private:
|
2026-03-10 22:38:12 -04:00
|
|
|
|
FGameLiftConfig GameLiftConfig;
|
2026-03-04 06:40:59 -05:00
|
|
|
|
FString CachedCommandLine;
|
2026-03-05 10:00:22 -05:00
|
|
|
|
|
2026-03-10 22:38:12 -04:00
|
|
|
|
static FString GetSHA256Hash(const FString& CommandLineString);
|
2026-03-04 06:40:59 -05:00
|
|
|
|
void InitGameLift();
|
2026-03-10 22:38:12 -04:00
|
|
|
|
|
2026-03-12 07:13:47 -04:00
|
|
|
|
bool GetAnywhereFleetParameters(const FString& CommandLineString);
|
2026-03-10 22:38:12 -04:00
|
|
|
|
void LogAnywhereFleetParameters();
|
2026-02-24 22:39:26 -05:00
|
|
|
|
};
|