🚧 pass-through raw data, refactoring

This commit is contained in:
2023-10-07 19:30:52 +03:00
parent 8788cb0fcf
commit e1a3ea45e2
29 changed files with 434 additions and 219 deletions
@@ -2,12 +2,16 @@ using Ragon.Protocol;
namespace Ragon.Server.Handler;
public class TimestampSyncOperation: IRagonOperation
public class TimestampSyncOperation: BaseOperation
{
public void Handle(RagonContext context, RagonBuffer reader, RagonBuffer writer)
public TimestampSyncOperation(RagonBuffer reader, RagonBuffer writer) : base(reader, writer)
{
var timestamp0 = reader.Read(32);
var timestamp1 = reader.Read(32);
}
public override void Handle(RagonContext context, byte[] data)
{
var timestamp0 = Reader.Read(32);
var timestamp1 = Reader.Read(32);
var value = new DoubleToUInt() { Int0 = timestamp0, Int1 = timestamp1 };
context.RoomPlayer?.SetTimestamp(value.Double);