2023-10-04 14:42:59 +03:00
|
|
|
using Ragon.Protocol;
|
|
|
|
|
|
|
|
|
|
namespace Ragon.Server.Handler;
|
|
|
|
|
|
2023-10-07 19:30:52 +03:00
|
|
|
public class TimestampSyncOperation: BaseOperation
|
2023-10-04 14:42:59 +03:00
|
|
|
{
|
2023-10-07 19:30:52 +03:00
|
|
|
public TimestampSyncOperation(RagonBuffer reader, RagonBuffer writer) : base(reader, writer)
|
2023-10-04 14:42:59 +03:00
|
|
|
{
|
2023-10-07 19:30:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Handle(RagonContext context, byte[] data)
|
|
|
|
|
{
|
|
|
|
|
var timestamp0 = Reader.Read(32);
|
|
|
|
|
var timestamp1 = Reader.Read(32);
|
2023-10-04 14:42:59 +03:00
|
|
|
var value = new DoubleToUInt() { Int0 = timestamp0, Int1 = timestamp1 };
|
|
|
|
|
|
|
|
|
|
context.RoomPlayer?.SetTimestamp(value.Double);
|
|
|
|
|
}
|
|
|
|
|
}
|