コード例 #1
0
        public ClientMsgInputs(byte[] buffer, int offset)
        {
            MsgSerializer.ValidateHeader(buffer, MsgId, ref offset);

            Frame     = MsgSerializer.ReadUInt32(buffer, ref offset);
            InputMask = MsgSerializer.ReadUInt64(buffer, ref offset);
        }
コード例 #2
0
ファイル: ServerMsgInput.cs プロジェクト: dngulin/NGIS.Net
        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);
        }
コード例 #3
0
        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}");
        }