75 static
bool IsSemverString(const FString& str)
77#if ENGINE_MAJOR_VERSION >= 5
78 return std::regex_match(TCHAR_TO_UTF8(*str), SemverPattern);
103#if ENGINE_MAJOR_VERSION >= 5
104 inline static const FString PreConfigFileName = TEXT(
"LootLockerPreConfig.bytes");
110 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
override
112 if (PropertyChangedEvent.GetPropertyName() ==
"GameVersion")
114 IsValidGameVersion = IsSemverString(GameVersion);
116 if (PropertyChangedEvent.GetPropertyName() ==
"bEnableFileLogging" || PropertyChangedEvent.GetPropertyName() ==
"LogFileName")
118 if (bEnableFileLogging)
120 EnableFileLogging(LogFileName.IsEmpty() ?
"LootLockerLog" : LogFileName);
124 DisableFileLogging();
127 OnConfigurationUpdated.Broadcast(PropertyChangedEvent.GetPropertyName().ToString());
128 UObject::PostEditChangeProperty(PropertyChangedEvent);
133 IsValidGameVersion = IsSemverString(GameVersion);
134 MigrateSettingsIfNeeded();
136 ApplyFileConfigIfPresent();
139 if (!bIsFileConfigLocked)
141 if(bEnableFileLogging)
143 EnableFileLogging(LogFileName.IsEmpty() ?
"LootLockerLog" : LogFileName);
147 DisableFileLogging();
150 UObject::PostInitProperties();
153 UPROPERTY(Config, VisibleAnywhere, BlueprintReadOnly, Category =
"LootLocker", Meta = (EditCondition =
"IsOutdatedSDK", EditConditionHides), Meta = (MultiLine =
true), Meta = (DisplayName =
"WARNING:"), Transient)
154 FString OutdatedSDKWarning = "This version of LootLocker is no longer updated through fab because of fab guidelines. Please use GitHub releases to update: https:
155 UPROPERTY(Config, VisibleAnywhere, BlueprintReadOnly, Category = "LootLocker", Meta = (EditCondition = "bIsFileConfigLocked", EditConditionHides), Meta = (MultiLine = true), Meta = (DisplayName = "INFO:"), Transient)
156 FString FileConfigActiveNotice = "Settings are governed by the pre-configured file config shipped with the plugin and cannot be changed from the editor.";
158 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker", Meta = (DisplayName = "LootLocker API Key", EditCondition = "!bIsFileConfigLocked"))
159 FString LootLockerGameKey = "";
160 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker", Meta = (EditCondition = "!bIsFileConfigLocked"))
161 FString GameVersion = "";
162 UPROPERTY(Config, VisibleAnywhere, BlueprintReadOnly, Category = "LootLocker", Meta = (EditCondition = "!IsValidGameVersion", EditConditionHides), Meta = (MultiLine = true), Meta = (DisplayName = "WARNING:"), Transient)
163 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:
164 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker", Meta = (EditCondition = "!bIsFileConfigLocked"))
165 bool AllowTokenRefresh = true;
167 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker", Meta = (EditCondition = "!bIsFileConfigLocked"))
168 FString DomainKey = "";
174 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker", Meta = (DisplayName = "Use Legacy HTTP Stack", EditCondition = "!bIsFileConfigLocked"))
175 bool bUseLegacyHTTPStack = false;
177 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Logging", Meta = (EditCondition = "!bIsFileConfigLocked"))
178 bool LogOutsideOfEditor = false;
179 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Logging", Meta = (DisplayName = "LootLocker Log Level", EditCondition = "!bIsFileConfigLocked"))
180 ELootLockerLogLevel LootLockerLogLevel = ELootLockerLogLevel::Warning;
183 static
bool ShouldLog()
188 return GetDefault<ULootLockerConfig>()->LogOutsideOfEditor;
195 return GetDefault<ULootLockerConfig>()->LootLockerLogLevel;
201 UFUNCTION(BlueprintCallable, Category =
"LootLocker|Logging")
202 static
void SetRuntimeLogLevel(ELootLockerLogLevel NewLevel);
206 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
207 static ELootLockerLogLevel GetRuntimeLogLevel();
212 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
213 static
void EnableFileLogging(const FString& FileName);
217 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
218 static
void DisableFileLogging();
222 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
223 static
bool IsFileLoggingEnabled();
227 UFUNCTION(BlueprintCallable, Category = "LootLocker|Logging")
228 static FString GetLogFilePath();
237 UFUNCTION(BlueprintCallable, Category = "LootLocker|Presence")
238 static
bool IsPresenceEnabled();
243 UFUNCTION(BlueprintCallable, Category = "LootLocker|Presence")
244 static
bool IsPresenceAutoConnectEnabled();
249 UFUNCTION(BlueprintCallable, Category = "LootLocker|Presence")
250 static
bool IsPresenceAutoDisconnectOnFocusChangeEnabled();
255 UFUNCTION(BlueprintCallable, Category = "LootLocker|Presence")
256 static
bool IsPresenceEnabledInEditor();
258 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Logging", Meta = (DisplayName = "Enable File Logging", EditCondition = "!bIsFileConfigLocked"))
259 bool bEnableFileLogging = false;
260 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Logging", Meta = (DisplayName = "
Name of LootLocker Log File", EditCondition = "bEnableFileLogging && !bIsFileConfigLocked", EditConditionHides))
261 FString LogFileName = TEXT("LootLockerLog");
262 UPROPERTY(Config, VisibleAnywhere, BlueprintReadOnly, Category = "LootLocker|Logging", Meta = (EditCondition = "bEnableFileLogging", EditConditionHides), Meta = (MultiLine = true), Meta = (DisplayName = "Actual Log File (on current device)"), Transient)
263 FString LongLogFilePath = "";
270 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Presence", Meta = (DisplayName = "Enable Presence System", EditCondition = "!bIsFileConfigLocked"))
271 bool bEnablePresence = false;
274 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Presence", Meta = (DisplayName = "Auto-Connect on Session Start", EditCondition = "bEnablePresence && !bIsFileConfigLocked", EditConditionHides))
275 bool bEnablePresenceAutoConnect = true;
278 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Presence", Meta = (DisplayName = "Auto-Disconnect on Focus Loss", EditCondition = "bEnablePresence && !bIsFileConfigLocked", EditConditionHides))
279 bool bEnablePresenceAutoDisconnectOnFocusChange = true;
282 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Presence", Meta = (DisplayName = "Enable In Editor", EditCondition = "bEnablePresence && !bIsFileConfigLocked", EditConditionHides))
283 bool bEnablePresenceInEditor = true;
302 UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = "LootLocker|Multi User", Meta = (DisplayName = "Multi User Session Mode", EditCondition = "!bIsFileConfigLocked"))
305 FString LogFilePath = "";
306 UPROPERTY(Config, VisibleInstanceOnly, Meta = (EditCondition = "false", EditConditionHides), Transient, Category = "LootLocker")
307 bool IsValidGameVersion = true;
308 UPROPERTY(Config, VisibleInstanceOnly, Meta = (EditCondition = "false", EditConditionHides), Transient, Category = "LootLocker")
309 bool bIsFileConfigLocked = false;
310#if ENGINE_MAJOR_VERSION >= 5
311 inline static bool bFileConfigChecked =
false;
312 inline static TOptional<FLootLockerFileConfig> FileConfig;
314 static bool bFileConfigChecked;
315 static TOptional<FLootLockerFileConfig> FileConfig;
317 UPROPERTY(Config, VisibleInstanceOnly, Meta = (EditCondition =
"false", EditConditionHides), Transient, Category =
"LootLocker")
319#ifdef LOOTLOCKER_SHOW_OUTDATED_SDK_MESSAGE
325#if ENGINE_MAJOR_VERSION >= 5
326 inline static const std::regex SemverPattern = std::regex(
"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:\\.(0|[1-9]\\d*))?(?:\\.(0|[1-9]\\d*))?$" );
333 void MigrateSettingsIfNeeded();
335 static void LoadFileConfig();
336 void ApplyFileConfigIfPresent();