Added in namespace GameLiftValidators and methods
This commit is contained in:
@@ -12,6 +12,48 @@ DECLARE_LOG_CATEGORY_EXTERN(LogShooterGameMode, Log, All);
|
||||
struct FProcessParameters;
|
||||
struct FServerParameters;
|
||||
|
||||
struct FGameLiftCliConfig
|
||||
{
|
||||
bool bDebugMode = false;
|
||||
bool bIsAnywhereFleet = false;
|
||||
bool bIsCriticalError = false;
|
||||
|
||||
int32 ServerPort = 0;
|
||||
|
||||
FString AuthToken;
|
||||
FString FleetId;
|
||||
FString HostId;
|
||||
FString WebSocketUrl;
|
||||
FString ServerRegion;
|
||||
|
||||
};
|
||||
|
||||
namespace GameLiftValidators
|
||||
{
|
||||
extern const FRegexPattern FleetIdPattern;
|
||||
extern const int32 FleetIdLengthMin;
|
||||
extern const int32 FleetIdLengthMax;
|
||||
extern const FString ServerRegionPattern;
|
||||
extern const int32 ServerRegionLengthMin;
|
||||
extern const int32 ServerRegionLengthMax;
|
||||
extern const FString WebSocketUrlPattern;
|
||||
extern const int32 WebSocketUrlLengthMin;
|
||||
extern const int32 WebSocketUrlLengthMax;
|
||||
extern const FString AuthTokenPattern;
|
||||
extern const int32 AuthTokenLengthMin;
|
||||
extern const int32 AuthTokenLengthMax;
|
||||
extern const FString HostIdPattern;
|
||||
extern const int32 HostIdLengthMin;
|
||||
extern const int32 HostIdLengthMax;
|
||||
extern const int32 ServerPortMin;
|
||||
extern const int32 ServerPortMax;
|
||||
extern const int32 WebSocketPortMin;
|
||||
extern const int32 WebSocketPortMax;
|
||||
|
||||
bool ValidateString(const FString& Value, const FRegexPattern& OptionalPattern, int32 Min, int32 Max);
|
||||
bool ValidateNumber(int32 Value, int32 Min, int32 Max);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -51,8 +93,12 @@ protected:
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
virtual void InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) override;
|
||||
void InitGame_original(const FString& MapName, const FString& Options, FString& ErrorMessage);
|
||||
|
||||
private:
|
||||
|
||||
FGameLiftCliConfig GameLiftConfig;
|
||||
|
||||
FString CachedCommandLine;
|
||||
TSharedPtr<FProcessParameters> ProcessParameters;
|
||||
TSharedPtr<FServerParameters> ServerParameters;
|
||||
@@ -60,7 +106,10 @@ private:
|
||||
int32 GetConfiguredOrDefaultPort() const;
|
||||
static FString GetSHA256Hash(const FString& Input);
|
||||
|
||||
#if WITH_GAMELIFT
|
||||
bool ParseAndOutputResult(const FString& InString, FString& OutValue, bool bRequired = false);
|
||||
bool ParseAndValidate(const FString& InArguments, FGameLiftCliConfig& Config);
|
||||
static bool ValidateFleetId(const FString& InFleetId);
|
||||
|
||||
void InitGameLift();
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user