예제 #1
0
        public byte[] VerifyToken;         //Byte Array

        public override void Read(byte[] array)
        {
            McVarint.TryParse(ref array, out SharedSecretLength);
            McByteArray.TryParse(ref array, out SharedSecret);
            McVarint.TryParse(ref array, out VerifyTokenLength);
            McByteArray.TryParse(ref array, out VerifyToken);
        }
예제 #2
0
        public byte[] VerifyToken;      // Byte Array

        public override void Read(byte[] array)
        {
            McString.TryParse(ref array, out ServerID);
            McVarint.TryParse(ref array, out PublicKeyLength);
            McByteArray.TryParse(ref array, out PublicKey);
            McVarint.TryParse(ref array, out VerifyTokenLength);
            McByteArray.TryParse(ref array, out VerifyToken);
        }
예제 #3
0
        public byte[] Data;         //Optional Byte Array

        public override void Read(byte[] array)
        {
            McVarint.TryParse(ref array, out MessageID);
            McBoolean.TryParse(ref array, out Successful);
            if (Successful)
            {
                McByteArray.TryParse(ref array, out Data);
            }
        }
예제 #4
0
 public override void Read(byte[] array)
 {
     McFloat.TryParse(ref array, out X);
     McFloat.TryParse(ref array, out Y);
     McFloat.TryParse(ref array, out Z);
     McFloat.TryParse(ref array, out Strength);
     McInt.TryParse(ref array, out RecordCount);
     McByteArray.TryParse(ref array, out Records);
     McFloat.TryParse(ref array, out PlayerMotionX);
     McFloat.TryParse(ref array, out PlayerMotionY);
     McFloat.TryParse(ref array, out PlayerMotionZ);
 }
예제 #5
0
        public override void Read(byte[] array)
        {
            McInt.TryParse(ref array, out ChunkX);             // int
            McInt.TryParse(ref array, out ChunkZ);             // int
            McBoolean.TryParse(ref array, out Fullchunk);      // bool
            McVarint.TryParse(ref array, out PrimaryBitMask);  // var int

            McNbtCompoundTag.TryParse(ref array, out Heightmaps);

            if (Fullchunk)
            {
                McVarint.TryParse(ref array, out Biomeslength);
                Biomes = new int[Biomeslength];
                for (int i = 0; i < Biomeslength; i++)
                {
                    McVarint.TryParse(ref array, out Biomes[i]);
                }
            }

            // chunk data
            McVarint.TryParse(ref array, out Size);             // size varint
            McByteArray.TryParse(Size, ref array, out Data);    // Byte array

            // BlockEntities
            McVarint.TryParse(ref array, out NumberOfBlockEntities);

            BlockEntities = new NbtCompoundTag[NumberOfBlockEntities];

            var    read1   = new NbtParser();
            Stream stream1 = new MemoryStream(array);

            for (int i = 0; i < NumberOfBlockEntities; i++)
            {
                BlockEntities[i] = read1.ParseNbtStream(stream1);
            }
        }
예제 #6
0
        public byte[] Data;         //Byte Array

        public override void Read(byte[] array)
        {
            McString.TryParse(ref array, out Channel);
            McByteArray.TryParse(ref array, out Data);
        }