mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-08 14:21:27 +00:00
Change redis object prefix
This commit is contained in:
parent
4bb3183c1e
commit
73a871f187
3 changed files with 5 additions and 12 deletions
|
@ -66,14 +66,9 @@ public class FriendsController : ControllerBase
|
||||||
[HttpGet("myFriends")]
|
[HttpGet("myFriends")]
|
||||||
public async Task<IActionResult> MyFriends()
|
public async Task<IActionResult> MyFriends()
|
||||||
{
|
{
|
||||||
(User, GameToken)? userAndToken = await this.database.UserAndGameTokenFromRequest(this.Request);
|
GameToken token = this.GetToken();
|
||||||
|
|
||||||
if (userAndToken == null) return this.StatusCode(403, "");
|
UserFriendData? friendStore = UserFriendStore.GetUserFriendData(token.UserId);
|
||||||
|
|
||||||
User user = userAndToken.Value.Item1;
|
|
||||||
GameToken gameToken = userAndToken.Value.Item2;
|
|
||||||
|
|
||||||
UserFriendData? friendStore = UserFriendStore.GetUserFriendData(user.UserId);
|
|
||||||
|
|
||||||
if (friendStore == null)
|
if (friendStore == null)
|
||||||
return this.Ok(LbpSerializer.BlankElement("myFriends"));
|
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);
|
User? friend = await this.database.Users.Include(u => u.Location).FirstOrDefaultAsync(u => u.UserId == friendId);
|
||||||
if (friend == null) continue;
|
if (friend == null) continue;
|
||||||
|
|
||||||
friends += friend.Serialize(gameToken.GameVersion);
|
friends += friend.Serialize(token.GameVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.Ok(LbpSerializer.StringElement("myFriends", friends));
|
return this.Ok(LbpSerializer.StringElement("myFriends", friends));
|
||||||
|
|
|
@ -6,7 +6,7 @@ using Redis.OM.Modeling;
|
||||||
|
|
||||||
namespace LBPUnion.ProjectLighthouse.Match.Rooms;
|
namespace LBPUnion.ProjectLighthouse.Match.Rooms;
|
||||||
|
|
||||||
[Document(StorageType = StorageType.Json)]
|
[Document(StorageType = StorageType.Json, Prefixes = new[]{"Room",})]
|
||||||
public class Room
|
public class Room
|
||||||
{
|
{
|
||||||
private int roomId;
|
private int roomId;
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using Redis.OM.Modeling;
|
using Redis.OM.Modeling;
|
||||||
|
|
||||||
namespace LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
namespace LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||||
|
|
||||||
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
|
[Document(StorageType = StorageType.Json, Prefixes = new[] {"UserFriendData",})]
|
||||||
[Document(StorageType = StorageType.Json)]
|
|
||||||
public class UserFriendData
|
public class UserFriendData
|
||||||
{
|
{
|
||||||
private int userId;
|
private int userId;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue