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
+5 -3
View File
@@ -78,7 +78,7 @@ public class RagonServer : IRagonServer, INetworkListener
_serverPlugin.OnAttached(this);
_handlers = new BaseOperation[byte.MaxValue];
_handlers[(byte)RagonOperation.AUTHORIZE] = new AuthorizationOperation(_reader, _writer, _webhooks, contextObserver);
_handlers[(byte)RagonOperation.AUTHORIZE] = new AuthorizationOperation(_reader, _writer, _webhooks, contextObserver, configuration);
_handlers[(byte)RagonOperation.JOIN_OR_CREATE_ROOM] = new RoomJoinOrCreateOperation(_reader, _writer, plugin, _webhooks);
_handlers[(byte)RagonOperation.CREATE_ROOM] = new RoomCreateOperation(_reader, _writer, plugin, _webhooks);
_handlers[(byte)RagonOperation.JOIN_ROOM] = new RoomJoinOperation(_reader, _writer, _webhooks);
@@ -93,7 +93,9 @@ public class RagonServer : IRagonServer, INetworkListener
_handlers[(byte)RagonOperation.TRANSFER_ENTITY_OWNERSHIP] = new EntityOwnershipOperation(_reader, _writer);
_handlers[(byte)RagonOperation.TIMESTAMP_SYNCHRONIZATION] = new TimestampSyncOperation(_reader, _writer);
_handlers[(byte)RagonOperation.REPLICATE_ROOM_EVENT] = new RoomEventOperation(_reader, _writer);
_handlers[(byte)RagonOperation.REPLICATE_RAW_DATA] = new RoomDataOperation(_reader, _writer);
_handlers[(byte)RagonOperation.REPLICATE_RAW_DATA] = new RoomRawDataOperation(_reader, _writer);
_handlers[(byte)RagonOperation.ROOM_DATA_UPDATED] = new RoomDataOperation(_reader, _writer);
_handlers[(byte)RagonOperation.PLAYER_DATA_UPDATED] = new PlayerDataOperation(_reader, _writer);
_logger.Trace($"Server Tick Rate: {_configuration.ServerTickRate}");
}
@@ -150,7 +152,7 @@ public class RagonServer : IRagonServer, INetworkListener
public void OnConnected(INetworkConnection connection)
{
var context = new RagonContext(connection, _configuration, _executor, _lobby, _scheduler);
var context = new RagonContext(connection, _executor, _lobby, _scheduler, _configuration.LimitBufferedEvents);
_logger.Trace($"Connected: {connection.Id}");
_contextsByConnection.Add(connection.Id, context);