Files
DedicatedServerCourse/Source/DedicatedServers/Public/Game/DS_GameMode.h

51 lines
1.4 KiB
C
Raw Normal View History

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"
#include "DedicatedServers/Public/GameLiftClpTypes.h"
#include "GameFramework/GameMode.h"
#include "DS_GameMode.generated.h"
2026-02-24 22:39:26 -05:00
DECLARE_LOG_CATEGORY_EXTERN(LogDS_GameMode, Log, All);
2026-02-24 22:39:26 -05:00
struct FProcessParameters;
struct FServerParameters;
struct FGameLiftConfig
{
bool bIsAnywhereFleet = false;
2026-03-12 07:13:47 -04:00
bool bAllOptionsFound = false;
2026-03-12 07:13:47 -04:00
int32 ServerPort = 7777;
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-02-24 22:39:26 -05:00
UCLASS()
class DEDICATEDSERVERS_API ADS_GameMode : public AGameMode
2026-02-24 22:39:26 -05:00
{
GENERATED_BODY()
protected:
2026-02-24 22:39:26 -05:00
virtual void BeginPlay() override;
virtual void InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) override;
2026-02-24 22:39:26 -05:00
private:
FGameLiftConfig GameLiftConfig;
FString CachedCommandLine;
TSharedPtr<FProcessParameters> ProcessParameters;
static FString GetSHA256Hash(const FString& InString);
void InitGameLift();
2026-03-12 07:13:47 -04:00
bool GetAnywhereFleetParameters(const FString& CommandLineString);
void LogAnywhereFleetParameters();
static void LogServerParameters(const FServerParameters& InServerParameters);
static FString GetValueOrHash(const FString& Value);
2026-02-24 22:39:26 -05:00
};