This commit is contained in:
rootdarkarchon
2022-11-14 01:56:52 +01:00

View File

@@ -129,6 +129,7 @@ public partial class MareHub
{ {
_logger.LogCallInfo(MareHubLogger.Args(visibleCharacterIds.Count)); _logger.LogCallInfo(MareHubLogger.Args(visibleCharacterIds.Count));
bool hadInvalidData = false;
foreach (var replacement in characterCache.FileReplacements.SelectMany(p => p.Value)) foreach (var replacement in characterCache.FileReplacements.SelectMany(p => p.Value))
{ {
var invalidPaths = replacement.GamePaths.Where(p => !GamePathRegex().IsMatch(p)).ToArray(); var invalidPaths = replacement.GamePaths.Where(p => !GamePathRegex().IsMatch(p)).ToArray();
@@ -139,10 +140,12 @@ public partial class MareHub
if (!validGamePaths || !validHash || !validFileSwapPath) if (!validGamePaths || !validHash || !validFileSwapPath)
{ {
_logger.LogCallWarning(MareHubLogger.Args("Invalid Data", "GamePaths", validGamePaths, string.Join(",", invalidPaths), "Hash", validHash, replacement.Hash, "FileSwap", validFileSwapPath, replacement.FileSwapPath)); _logger.LogCallWarning(MareHubLogger.Args("Invalid Data", "GamePaths", validGamePaths, string.Join(",", invalidPaths), "Hash", validHash, replacement.Hash, "FileSwap", validFileSwapPath, replacement.FileSwapPath));
throw new HubException("Invalid data provided"); hadInvalidData = true;
} }
} }
if (hadInvalidData) throw new HubException("Invalid data provided");
var allPairedUsers = await GetAllPairedUnpausedUsers().ConfigureAwait(false); var allPairedUsers = await GetAllPairedUnpausedUsers().ConfigureAwait(false);
var allPairedUsersDict = allPairedUsers.ToDictionary(f => f, f => _clientIdentService.GetCharacterIdentForUid(f), System.StringComparer.Ordinal) var allPairedUsersDict = allPairedUsers.ToDictionary(f => f, f => _clientIdentService.GetCharacterIdentForUid(f), System.StringComparer.Ordinal)