feat: room properties ready, player properties wip

This commit is contained in:
2024-05-07 22:42:45 +03:00
parent 6886808132
commit 5bf1881f81
22 changed files with 325 additions and 157 deletions
@@ -0,0 +1,28 @@
using NLog;
using Ragon.Protocol;
using Ragon.Server.IO;
using Ragon.Server.Lobby;
namespace Ragon.Server.Handler
{
public class PlayerPropertiesOperation : BaseOperation
{
private readonly ILogger _logger = LogManager.GetCurrentClassLogger();
public PlayerPropertiesOperation(RagonBuffer reader, RagonBuffer writer) : base(reader, writer)
{
}
public override void Handle(RagonContext context, NetworkChannel channel)
{
if (context.ConnectionStatus == ConnectionStatus.Unauthorized)
{
_logger.Warn($"Player {context.Connection.Id} not authorized for this request");
return;
}
var playerData = Reader.ReadBytes(Reader.Capacity);
context.UserData.Data = playerData;
}
}
}