mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-14 22:02:26 +00:00
Add workaround for weird score bug
This commit is contained in:
parent
a253e768a7
commit
75de1d0faa
2 changed files with 31 additions and 2 deletions
|
@ -48,6 +48,10 @@ public class ScoreController : ControllerBase
|
|||
return this.BadRequest();
|
||||
}
|
||||
|
||||
// This only seems to happens on lbp2 versus levels, not sure why
|
||||
if(score.PlayerIdCollection.Contains(':'))
|
||||
score.PlayerIdCollection = score.PlayerIdCollection.Replace(':', ',');
|
||||
|
||||
if (score.PlayerIds.Length == 0)
|
||||
{
|
||||
Logger.Warn($"Rejecting score upload, there are 0 playerIds (slotType={slotType}, slotId={id}, user={username})", LogArea.Score);
|
||||
|
@ -77,7 +81,7 @@ public class ScoreController : ControllerBase
|
|||
string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync();
|
||||
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={score.SlotId}, slotType={slotType}, body='{bodyString}')", LogArea.Score);
|
||||
$"gameVersion={token.GameVersion.ToPrettyString()}, type={score.Type}, id={id}, slotType={slotType}, body='{bodyString}')", LogArea.Score);
|
||||
return this.BadRequest();
|
||||
}
|
||||
|
||||
|
@ -169,7 +173,10 @@ public class ScoreController : ControllerBase
|
|||
UserFriendData? store = UserFriendStore.GetUserFriendData(token.UserId);
|
||||
if (store == null) return this.Ok();
|
||||
|
||||
List<string> friendNames = new();
|
||||
List<string> friendNames = new()
|
||||
{
|
||||
username,
|
||||
};
|
||||
|
||||
foreach (int friendId in store.FriendIds)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue