mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-06-17 13:11:28 +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
|
// Workaround for parsing player ids of versus levels
|
||||||
if (score.PlayerIds.Length == 1 && score.PlayerIds[0].Contains(':'))
|
if (score.PlayerIds.Length == 1)
|
||||||
score.PlayerIds = score.PlayerIds[0].Split(":", StringSplitOptions.RemoveEmptyEntries);
|
{
|
||||||
|
char[] delimiters = { ':', ',', };
|
||||||
|
foreach (char delimiter in delimiters)
|
||||||
|
{
|
||||||
|
score.PlayerIds = score.PlayerIds[0].Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (score.PlayerIds.Length == 0)
|
if (score.PlayerIds.Length == 0)
|
||||||
{
|
{
|
||||||
|
@ -82,8 +89,9 @@ public class ScoreController : ControllerBase
|
||||||
{
|
{
|
||||||
string bodyString = await this.ReadBodyAsync();
|
string bodyString = await this.ReadBodyAsync();
|
||||||
Logger.Warn("Rejecting score upload, requester username is not present in playerIds" +
|
Logger.Warn("Rejecting score upload, requester username is not present in playerIds" +
|
||||||
$" (user='{username}', playerIds='{string.Join(",", score.PlayerIds)}', " +
|
$" (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);
|
$"gameVersion={token.GameVersion.ToPrettyString()}, type={score.Type}, id={id}, slotType={slotType}, body='{bodyString}')",
|
||||||
|
LogArea.Score);
|
||||||
return this.BadRequest();
|
return this.BadRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue