public ClientMsgInputs(byte[] buffer, int offset) { MsgSerializer.ValidateHeader(buffer, MsgId, ref offset); Frame = MsgSerializer.ReadUInt32(buffer, ref offset); InputMask = MsgSerializer.ReadUInt64(buffer, ref offset); }
public ServerMsgInput(byte[] buffer, int offset) { MsgSerializer.ValidateHeader(buffer, MsgId, ref offset); Frame = MsgSerializer.ReadUInt32(buffer, ref offset); InputMask = MsgSerializer.ReadUInt64(buffer, ref offset); PlayerIndex = MsgSerializer.ReadByte(buffer, ref offset); }
public void ShouldSerializeAndDeserializeUInt64(ulong value) { var written = MsgSerializer.WriteUInt64(value, _buffer, 0); Assert.True(written == sizeof(ulong), $"Bad write size: {written}"); var offset = 0; var deserialized = MsgSerializer.ReadUInt64(_buffer, ref offset); Assert.True(offset == sizeof(ulong), $"Bad read size: {offset}"); Assert.True(value == deserialized, $"Bad result: {deserialized}"); }