From ff470bcb34814d25258ea54e66bf87cb383b4db5 Mon Sep 17 00:00:00 2001 From: Slendy Date: Wed, 29 Mar 2023 23:36:47 -0500 Subject: [PATCH] Fix certain scores not being uploaded --- .../Controllers/Slots/ScoreController.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ScoreController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ScoreController.cs index 1fc2bbb0..80c725ea 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ScoreController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ScoreController.cs @@ -52,8 +52,15 @@ public class ScoreController : ControllerBase } // Workaround for parsing player ids of versus levels - if (score.PlayerIds.Length == 1 && score.PlayerIds[0].Contains(':')) - score.PlayerIds = score.PlayerIds[0].Split(":", StringSplitOptions.RemoveEmptyEntries); + if (score.PlayerIds.Length == 1) + { + char[] delimiters = { ':', ',', }; + foreach (char delimiter in delimiters) + { + score.PlayerIds = score.PlayerIds[0].Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + } + + } if (score.PlayerIds.Length == 0) { @@ -82,8 +89,9 @@ public class ScoreController : ControllerBase { string bodyString = await this.ReadBodyAsync(); Logger.Warn("Rejecting score upload, requester username is not present in playerIds" + - $" (user='{username}', playerIds='{string.Join(",", score.PlayerIds)}', " + - $"gameVersion={token.GameVersion.ToPrettyString()}, type={score.Type}, id={id}, slotType={slotType}, body='{bodyString}')", LogArea.Score); + $" (user='{username}', playerIds='{string.Join(",", score.PlayerIds)}' playerIds.Length={score.PlayerIds.Length}, " + + $"gameVersion={token.GameVersion.ToPrettyString()}, type={score.Type}, id={id}, slotType={slotType}, body='{bodyString}')", + LogArea.Score); return this.BadRequest(); }