mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-05 03:18:45 +00:00
Prevent nesting workaround for level activity from messing with global activity
This commit is contained in:
parent
60d851fb15
commit
29e3f8661d
2 changed files with 4 additions and 4 deletions
|
@ -295,7 +295,7 @@ public class ActivityController : ControllerBase
|
|||
|
||||
[HttpGet("slot/{slotType}/{slotId:int}")]
|
||||
[HttpGet("user2/{username}")]
|
||||
public async Task<IActionResult> SlotActivity(string? slotType, int slotId, string? username, long? timestamp)
|
||||
public async Task<IActionResult> LocalActivity(string? slotType, int slotId, string? username, long? timestamp)
|
||||
{
|
||||
GameTokenEntity token = this.GetToken();
|
||||
|
||||
|
@ -344,6 +344,6 @@ public class ActivityController : ControllerBase
|
|||
return this.Ok(GameStream.CreateFromGroups(token,
|
||||
outerGroups,
|
||||
times.Start.ToUnixTimeMilliseconds(),
|
||||
oldestTimestamp));
|
||||
oldestTimestamp, isLevelActivity));
|
||||
}
|
||||
}
|
|
@ -99,7 +99,7 @@ public class GameStream : ILbpSerializable, INeedsPreparationForSerialization
|
|||
}
|
||||
|
||||
public static GameStream CreateFromGroups
|
||||
(GameTokenEntity token, List<OuterActivityGroup> groups, long startTimestamp, long endTimestamp)
|
||||
(GameTokenEntity token, List<OuterActivityGroup> groups, long startTimestamp, long endTimestamp, bool dontNest = false)
|
||||
{
|
||||
GameStream gameStream = new()
|
||||
{
|
||||
|
@ -117,7 +117,7 @@ public class GameStream : ILbpSerializable, INeedsPreparationForSerialization
|
|||
gameStream.Groups = groups.Select(GameStreamGroup.CreateFromGroup).ToList();
|
||||
|
||||
// Workaround for level activity because it shouldn't contain nested activity groups
|
||||
if (gameStream.Groups.Count == 1 && groups.First().Key.GroupType == ActivityGroupType.Level)
|
||||
if (gameStream.Groups.Count == 1 && groups.First().Key.GroupType == ActivityGroupType.Level && !dontNest)
|
||||
{
|
||||
gameStream.Groups = gameStream.Groups.First().Groups;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue