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:
Josh 2022-08-12 19:56:17 -05:00 committed by GitHub
parent 8dbd0e63ff
commit d23a264b8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 625 additions and 505 deletions

View file

@ -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);
}
}