30 static
bool IsSemverString(const FString& str)
32#if ENGINE_MAJOR_VERSION >= 5
33 return std::regex_match(TCHAR_TO_UTF8(*str), SemverPattern);
42 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
override
44 if (PropertyChangedEvent.GetPropertyName() ==
"GameVersion")
46 IsValidGameVersion = IsSemverString(GameVersion);
48 if (PropertyChangedEvent.GetPropertyName() ==
"bEnableFileLogging" || PropertyChangedEvent.GetPropertyName() ==
"LogFileName")
50 if (bEnableFileLogging)
52 EnableFileLogging(LogFileName.IsEmpty() ?
"LootLockerLog" : LogFileName);
59 OnConfigurationUpdated.Broadcast(PropertyChangedEvent.GetPropertyName().ToString());
60 UObject::PostEditChangeProperty(PropertyChangedEvent);
65 IsValidGameVersion = IsSemverString(GameVersion);
66 if(bEnableFileLogging)
68 EnableFileLogging(LogFileName.IsEmpty() ?
"LootLockerLog" : LogFileName);
74 UObject::PostInitProperties();
77 UPROPERTY(Config, VisibleAnywhere, BlueprintReadOnly, Category =
"LootLocker", Meta = (EditCondition =
"IsOutdatedSDK", EditConditionHides), Meta = (MultiLine =
true), Meta = (DisplayName =
"WARNING:"), Transient)
78 FString OutdatedSDKWarning = "This version of LootLocker is no longer updated through fab because of fab guidelines. Please use GitHub releases to update: https:
80 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker", Meta = (DisplayName = "LootLocker API Key"))
81 FString LootLockerGameKey = "";
82 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker")
83 FString GameVersion = "";
84 UPROPERTY(Config, VisibleAnywhere, BlueprintReadOnly, Category = "LootLocker", Meta = (EditCondition = "!IsValidGameVersion", EditConditionHides), Meta = (MultiLine = true), Meta = (DisplayName = "WARNING:"), Transient)
85 FString InvalidGameVersionWarning = "
Game version needs to follow a numeric Semantic Versioning pattern: X.Y.Z.B with the sections denoting MAJOR.MINOR.PATCH.BUILD and the last two being optional. Read more at https:
86 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker")
87 bool AllowTokenRefresh = true;
89 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker")
90 FString DomainKey = "";
96 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker", Meta = (DisplayName = "Use Legacy HTTP Stack"))
97 bool bUseLegacyHTTPStack = false;
99 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Logging")
100 bool LogOutsideOfEditor = false;
101 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Logging", Meta = (DisplayName = "LootLocker Log Level"))
102 ELootLockerLogLevel LootLockerLogLevel;
105 static
bool ShouldLog()
110 return GetDefault<ULootLockerConfig>()->LogOutsideOfEditor;
117 return GetDefault<ULootLockerConfig>()->LootLockerLogLevel;
123 UFUNCTION(BlueprintCallable, Category =
"LootLocker|Logging")
124 static
void SetRuntimeLogLevel(ELootLockerLogLevel NewLevel);
128 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
129 static ELootLockerLogLevel GetRuntimeLogLevel();
134 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
135 static
void EnableFileLogging(const FString& FileName);
139 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
140 static
void DisableFileLogging();
144 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
145 static
bool IsFileLoggingEnabled();
149 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
150 static FString GetLogFilePath();
159 UFUNCTION(BlueprintCallable, Category = "LootLocker|Presence")
160 static
bool IsPresenceEnabled();
165 UFUNCTION(BlueprintCallable, Category = "LootLocker|Presence")
166 static
bool IsPresenceAutoConnectEnabled();
171 UFUNCTION(BlueprintCallable, Category = "LootLocker|Presence")
172 static
bool IsPresenceAutoDisconnectOnFocusChangeEnabled();
177 UFUNCTION(BlueprintCallable, Category = "LootLocker|Presence")
178 static
bool IsPresenceEnabledInEditor();
180 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Logging", Meta = (DisplayName = "Enable File Logging"))
181 bool bEnableFileLogging = false;
182 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Logging", Meta = (DisplayName = "
Name of LootLocker Log File", EditCondition = "bEnableFileLogging", EditConditionHides))
183 FString LogFileName = TEXT("LootLockerLog");
184 UPROPERTY(Config, VisibleAnywhere, BlueprintReadOnly, Category = "LootLocker|Logging", Meta = (EditCondition = "bEnableFileLogging", EditConditionHides), Meta = (MultiLine = true), Meta = (DisplayName = "Actual Log File (on current device)"), Transient)
185 FString LongLogFilePath = "";
192 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Presence", Meta = (DisplayName = "Enable Presence System"))
193 bool bEnablePresence = false;
196 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Presence", Meta = (DisplayName = "Auto-Connect on Session Start", EditCondition = "bEnablePresence", EditConditionHides))
197 bool bEnablePresenceAutoConnect = true;
200 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Presence", Meta = (DisplayName = "Auto-Disconnect on Focus Loss", EditCondition = "bEnablePresence", EditConditionHides))
201 bool bEnablePresenceAutoDisconnectOnFocusChange = true;
204 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Presence", Meta = (DisplayName = "Enable In Editor", EditCondition = "bEnablePresence", EditConditionHides))
205 bool bEnablePresenceInEditor = true;
207 FString LogFilePath = "";
208 UPROPERTY(Config, VisibleInstanceOnly, Meta = (EditCondition = "false", EditConditionHides), Transient, Category = "LootLocker")
209 bool IsValidGameVersion = true;
210 UPROPERTY(Config, VisibleInstanceOnly, Meta = (EditCondition = "false", EditConditionHides), Transient, Category = "LootLocker")
212#ifdef LOOTLOCKER_SHOW_OUTDATED_SDK_MESSAGE
218#if ENGINE_MAJOR_VERSION >= 5
219 inline static const std::regex SemverPattern = std::regex(
"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:\\.(0|[1-9]\\d*))?(?:\\.(0|[1-9]\\d*))?$" );