mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-10 23:31:27 +00:00
Lots of bug fixes and performance improvements (#410)
* Many bug fixes and performance enhancements * Fix warnings and speed up photos with me * Finish refactoring user serialization * Finish refactoring user serialization Use GameTokens instead of User when possible Prevent negative page sizes * Fix debug compilation * Add gzip compression to example nginx config * Remove deflate changes * Add UsernameFromWebToken Co-authored-by: Jayden <jvyden@jvyden.xyz>
This commit is contained in:
parent
8dbd0e63ff
commit
d23a264b8a
43 changed files with 625 additions and 505 deletions
|
@ -86,9 +86,9 @@ public class MatchController : ControllerBase
|
|||
|
||||
// Check how many people are online in release builds, disabled for debug for ..well debugging.
|
||||
#if DEBUG
|
||||
if (matchData is FindBestRoom diveInData)
|
||||
else if (matchData is FindBestRoom diveInData)
|
||||
#else
|
||||
if (matchData is FindBestRoom diveInData && MatchHelper.UserLocations.Count > 1)
|
||||
else if (matchData is FindBestRoom diveInData && MatchHelper.UserLocations.Count > 1)
|
||||
#endif
|
||||
{
|
||||
FindBestRoomResponse? response = RoomHelper.FindBestRoom
|
||||
|
@ -102,7 +102,7 @@ public class MatchController : ControllerBase
|
|||
return this.Ok($"[{{\"StatusCode\":200}},{serialized}]");
|
||||
}
|
||||
|
||||
if (matchData is CreateRoom createRoom && MatchHelper.UserLocations.Count >= 1)
|
||||
else if (matchData is CreateRoom createRoom && MatchHelper.UserLocations.Count >= 1)
|
||||
{
|
||||
List<int> users = new();
|
||||
foreach (string playerUsername in createRoom.Players)
|
||||
|
@ -117,7 +117,7 @@ public class MatchController : ControllerBase
|
|||
RoomHelper.CreateRoom(users, gameToken.GameVersion, gameToken.Platform, createRoom.RoomSlot);
|
||||
}
|
||||
|
||||
if (matchData is UpdatePlayersInRoom updatePlayersInRoom)
|
||||
else if (matchData is UpdatePlayersInRoom updatePlayersInRoom)
|
||||
{
|
||||
Room? room = RoomHelper.Rooms.FirstOrDefault(r => r.HostId == user.UserId);
|
||||
|
||||
|
@ -133,7 +133,7 @@ public class MatchController : ControllerBase
|
|||
}
|
||||
|
||||
room.PlayerIds = users.Select(u => u.UserId).ToList();
|
||||
RoomHelper.CleanupRooms(null, room);
|
||||
await RoomHelper.CleanupRooms(null, room);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue