mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-06-03 22:52:27 +00:00
Fix certain scores not being uploaded
This commit is contained in:
parent
3713c4d20c
commit
ff470bcb34
1 changed files with 12 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue