feat(wip): Room Property and Player Property

This commit is contained in:
2024-04-14 08:49:30 +03:00
parent 5c20fbafc1
commit d115c98b79
9 changed files with 109 additions and 19 deletions
+10 -11
View File
@@ -26,7 +26,7 @@ public class RagonContext
public ConnectionStatus ConnectionStatus { get; set; }
public INetworkConnection Connection { get; }
public IExecutor Executor { get; private set; }
public RagonServerConfiguration Configuration { get; private set; }
public int LimitBufferedEvents { get; private set; }
public IRagonLobby Lobby { get; private set; }
public RagonLobbyPlayer? LobbyPlayer { get; private set; }
@@ -36,14 +36,14 @@ public class RagonContext
public RagonScheduler Scheduler { get; private set; }
public RagonContext(
INetworkConnection connection,
RagonServerConfiguration configuration,
IExecutor executor,
IRagonLobby lobby,
RagonScheduler scheduler)
INetworkConnection connection,
IExecutor executor,
IRagonLobby lobby,
RagonScheduler scheduler,
int limitBufferedEvents)
{
ConnectionStatus = ConnectionStatus.Unauthorized;
Configuration = configuration;
LimitBufferedEvents = limitBufferedEvents;
Connection = connection;
Executor = executor;
Lobby = lobby;
@@ -54,15 +54,14 @@ public class RagonContext
{
LobbyPlayer = player;
}
internal void SetRoom(RagonRoom room, RagonRoomPlayer player)
{
Room?.DetachPlayer(RoomPlayer);
Room = room;
RoomPlayer = player;
Room.AttachPlayer(RoomPlayer);
}
}