30 lines
910 B
C
30 lines
910 B
C
|
|
#pragma once
|
|||
|
|
#include "Game/GameLift/GameLiftClpTypes.h"
|
|||
|
|
#include "CoreMinimal.h"
|
|||
|
|
|
|||
|
|
struct FPortResult
|
|||
|
|
{
|
|||
|
|
int32 Port;
|
|||
|
|
bool bUsedDefaultPort;
|
|||
|
|
FString WarningMessage;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
namespace cmdlineparser
|
|||
|
|
{
|
|||
|
|
FPortResult GetConfiguredOrDefaultPort(const FString& Token = TEXT("port="));
|
|||
|
|
FPortResult GetConfiguredOrDefaultPort(const FString& CommandLine, const FString& Token = TEXT("port="));
|
|||
|
|
|
|||
|
|
details::FParseResult GetValueOfToken(const FString& CommandLine, const details::EAvailableTokens Token);
|
|||
|
|
|
|||
|
|
namespace details
|
|||
|
|
{
|
|||
|
|
inline static constexpr int32 MIN_PORT = 1024;
|
|||
|
|
inline static constexpr int32 MAX_PORT = 65535;
|
|||
|
|
inline const TCHAR* DEFAULT_PORT_TOKEN = TEXT("port=");
|
|||
|
|
|
|||
|
|
FString EnsureEndsWith(const FString& Token, const TCHAR* Suffix);
|
|||
|
|
FPortResult GetConfiguredOrDefaultPort(const FString& CommandLine, const FString& Token);
|
|||
|
|
bool DoesRegExMatch(const FString& Text, const FString& Pattern);
|
|||
|
|
}
|
|||
|
|
}
|