2026-03-10 22:38:12 -04:00
|
|
|
|
#pragma once
|
|
|
|
|
|
#include "GameLiftClpTypes.h"
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
|
|
2026-03-14 19:38:13 -04:00
|
|
|
|
struct FPortResult
|
|
|
|
|
|
{
|
|
|
|
|
|
int32 Port;
|
|
|
|
|
|
bool bUsedDefaultPort;
|
|
|
|
|
|
FString WarningMessage;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-03-10 22:38:12 -04:00
|
|
|
|
namespace cmdlineparser
|
|
|
|
|
|
{
|
2026-03-14 19:38:13 -04:00
|
|
|
|
FPortResult GetConfiguredOrDefaultPort(const FString& Token = TEXT("port="));
|
|
|
|
|
|
FPortResult GetConfiguredOrDefaultPort(const FString& CommandLine, const FString& Token = TEXT("port="));
|
2026-03-10 22:38:12 -04:00
|
|
|
|
|
|
|
|
|
|
details::FParseResult GetValueOfToken(const FString& CommandLine, const details::EAvailableTokens Token);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace cmdlineparser::details
|
|
|
|
|
|
{
|
|
|
|
|
|
inline static constexpr int32 MIN_PORT = 1024;
|
|
|
|
|
|
inline static constexpr int32 MAX_PORT = 65535;
|
|
|
|
|
|
inline static constexpr const TCHAR* DEFAULT_PORT_TOKEN = TEXT("port=");
|
|
|
|
|
|
|
|
|
|
|
|
FString EnsureEndsWith(const FString& Token, const TCHAR* Suffix);
|
2026-03-14 19:38:13 -04:00
|
|
|
|
FPortResult GetConfiguredOrDefaultPort(const FString& CommandLine, const FString& Token);
|
2026-03-12 07:13:47 -04:00
|
|
|
|
bool DoesRegExMatch(const FString& Text, const FString& Pattern);
|
2026-03-10 22:38:12 -04:00
|
|
|
|
}
|
|
|
|
|
|
|