mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-13 21:32:28 +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
|
@ -26,8 +26,8 @@ public class FriendsController : ControllerBase
|
|||
[HttpPost("npdata")]
|
||||
public async Task<IActionResult> NPData()
|
||||
{
|
||||
User? user = await this.database.UserFromGameRequest(this.Request);
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
GameToken? token = await this.database.GameTokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
this.Request.Body.Position = 0;
|
||||
string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync();
|
||||
|
@ -56,8 +56,8 @@ public class FriendsController : ControllerBase
|
|||
blockedUsers.Add(blockedUser.UserId);
|
||||
}
|
||||
|
||||
UserFriendData? friendStore = UserFriendStore.GetUserFriendData(user.UserId);
|
||||
if (friendStore == null) friendStore = UserFriendStore.CreateUserFriendData(user.UserId);
|
||||
UserFriendData? friendStore = UserFriendStore.GetUserFriendData(token.UserId);
|
||||
if (friendStore == null) friendStore = UserFriendStore.CreateUserFriendData(token.UserId);
|
||||
|
||||
friendStore.FriendIds = friends.Select(u => u.UserId).ToList();
|
||||
friendStore.BlockedIds = blockedUsers;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue