예제 #1
0
        public override void Read(PrimitiveReader reader)
        {
            Text          = reader.ReadStringProto(ProtoConsts.MaxStringChars);
            AssumeCommand = reader.ReadBool();
            var hasPos = reader.ReadBool();

            if (hasPos)
            {
                LookedAtBlock = reader.ReadBlockPosProto();
            }
        }
예제 #2
0
        public async ValueTask Read(PrimitiveReader primitiveReader, CancellationToken cancellationToken)
        {
            BoolValue = await primitiveReader.ReadBool(cancellationToken);

            ByteValue = await primitiveReader.ReadByte(cancellationToken);

            SByteValue = await primitiveReader.ReadSByte(cancellationToken);

            ShortValue = await primitiveReader.ReadInt16(cancellationToken);

            UShortValue = await primitiveReader.ReadUInt16(cancellationToken);

            IntValue = await primitiveReader.ReadInt32(cancellationToken);

            UIntValue = await primitiveReader.ReadUInt32(cancellationToken);

            LongValue = await primitiveReader.ReadInt64(cancellationToken);

            ULongValue = await primitiveReader.ReadUInt64(cancellationToken);

            FloatValue = await primitiveReader.ReadSingle(cancellationToken);

            DoubleValue = await primitiveReader.ReadDouble(cancellationToken);

            StringValue = await primitiveReader.ReadString(cancellationToken);

            deserializationCounter++;
        }
예제 #3
0
 public override void Read(PrimitiveReader reader)
 {
     Position = new Vec3(reader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble());
     Yaw      = reader.ReadFloat();
     Pitch    = reader.ReadFloat();
     OnGround = reader.ReadBool();
 }
예제 #4
0
        public override void Read(PrimitiveReader reader)
        {
            Type = (TypeEnum)reader.ReadVarint();
            switch (Type)
            {
            case TypeEnum.DisplayedRecipe:
                RecipeId = reader.ReadInt();
                break;

            case TypeEnum.CraftingBookStatus:
                CraftingBookOpen = reader.ReadBool();
                CraftingFilter   = reader.ReadBool();
                break;

            default:
                throw new InvalidPacketException(nameof(Type), Type);
            }
        }
예제 #5
0
 public override void Read(PrimitiveReader reader)
 {
     RightPaddleTurning = reader.ReadBool();
     LeftPaddleTurning  = reader.ReadBool();
 }
예제 #6
0
 public async ValueTask Read(PrimitiveReader primitiveReader, CancellationToken cancellationToken)
 {
     _ = await primitiveReader.ReadBool(cancellationToken);
 }
예제 #7
0
 public override void Read(PrimitiveReader reader)
 {
     WindowId  = reader.ReadSByte();
     ActionNum = reader.ReadShort();
     Accepted  = reader.ReadBool();
 }
예제 #8
0
 public override void Read(PrimitiveReader reader)
 {
     OnGround = reader.ReadBool();
 }
예제 #9
0
 public override void Read(PrimitiveReader reader)
 {
     WindowId = reader.ReadSByte();
     RecipeId = reader.ReadVarint();
     MakeAll  = reader.ReadBool();
 }