diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/FriendsController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/FriendsController.cs index 15844430..6a60ddb6 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/FriendsController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/FriendsController.cs @@ -66,14 +66,9 @@ public class FriendsController : ControllerBase [HttpGet("myFriends")] public async Task MyFriends() { - (User, GameToken)? userAndToken = await this.database.UserAndGameTokenFromRequest(this.Request); + GameToken token = this.GetToken(); - if (userAndToken == null) return this.StatusCode(403, ""); - - User user = userAndToken.Value.Item1; - GameToken gameToken = userAndToken.Value.Item2; - - UserFriendData? friendStore = UserFriendStore.GetUserFriendData(user.UserId); + UserFriendData? friendStore = UserFriendStore.GetUserFriendData(token.UserId); if (friendStore == null) return this.Ok(LbpSerializer.BlankElement("myFriends")); @@ -84,7 +79,7 @@ public class FriendsController : ControllerBase User? friend = await this.database.Users.Include(u => u.Location).FirstOrDefaultAsync(u => u.UserId == friendId); if (friend == null) continue; - friends += friend.Serialize(gameToken.GameVersion); + friends += friend.Serialize(token.GameVersion); } return this.Ok(LbpSerializer.StringElement("myFriends", friends)); diff --git a/ProjectLighthouse/Match/Rooms/Room.cs b/ProjectLighthouse/Match/Rooms/Room.cs index fdaf720e..831b0923 100644 --- a/ProjectLighthouse/Match/Rooms/Room.cs +++ b/ProjectLighthouse/Match/Rooms/Room.cs @@ -6,7 +6,7 @@ using Redis.OM.Modeling; namespace LBPUnion.ProjectLighthouse.Match.Rooms; -[Document(StorageType = StorageType.Json)] +[Document(StorageType = StorageType.Json, Prefixes = new[]{"Room",})] public class Room { private int roomId; diff --git a/ProjectLighthouse/PlayerData/Profiles/UserFriendData.cs b/ProjectLighthouse/PlayerData/Profiles/UserFriendData.cs index cbc29cc5..0f55f58d 100644 --- a/ProjectLighthouse/PlayerData/Profiles/UserFriendData.cs +++ b/ProjectLighthouse/PlayerData/Profiles/UserFriendData.cs @@ -1,11 +1,9 @@ using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using Redis.OM.Modeling; namespace LBPUnion.ProjectLighthouse.PlayerData.Profiles; -[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")] -[Document(StorageType = StorageType.Json)] +[Document(StorageType = StorageType.Json, Prefixes = new[] {"UserFriendData",})] public class UserFriendData { private int userId;