Esempio n. 1
0
 public void ReadPacket(MinecraftStream stream)
 {
     ProtocolVersion = stream.ReadUInt8();
     PartyName       = stream.ReadString();
     KeyOrMOTD       = stream.ReadString();
     IsOP            = stream.ReadUInt8() == 0x64;
 }
Esempio n. 2
0
 public void ReadPacket(MinecraftStream stream)
 {
     X         = stream.ReadInt16();
     Y         = stream.ReadInt16();
     Z         = stream.ReadInt16();
     Destroy   = stream.ReadUInt8() == 0x00;
     BlockType = stream.ReadUInt8();
 }
Esempio n. 3
0
 public void ReadPacket(MinecraftStream stream)
 {
     PlayerID = stream.ReadInt8();
     DeltaX   = stream.ReadInt8();
     DeltaY   = stream.ReadInt8();
     DeltaZ   = stream.ReadInt8();
     Yaw      = stream.ReadUInt8();
     Pitch    = stream.ReadUInt8();
 }
Esempio n. 4
0
 public void ReadPacket(MinecraftStream stream)
 {
     PlayerID = stream.ReadInt8();
     X        = stream.ReadInt16();
     Y        = stream.ReadInt16();
     Z        = stream.ReadInt16();
     Yaw      = stream.ReadUInt8();
     Pitch    = stream.ReadUInt8();
 }
Esempio n. 5
0
        public void ReadPacket(MinecraftStream stream)
        {
            var length = stream.ReadInt16();
            var data   = stream.ReadArray();

            Data = new byte[length];
            Array.Copy(data, Data, length);
            Complete = stream.ReadUInt8() / 100.0;
        }
Esempio n. 6
0
        public static IPacket ReadPacket(MinecraftStream stream)
        {
            byte id = stream.ReadUInt8();

            if (Packets[id] == null)
            {
                throw new InvalidOperationException("Invalid packet ID: 0x" + id.ToString("X2"));
            }
            var packet = Packets[id]();

            packet.ReadPacket(stream);
            return(packet);
        }
Esempio n. 7
0
 public static MetadataDictionary FromStream(MinecraftStream stream)
 {
     var value = new MetadataDictionary();
     byte key = 0;
     while (key != 127)
     {
         key = stream.ReadUInt8();
         if (key == 127) break;
         byte type = (byte)((key & 0xE0) >> 5);
         byte index = (byte)(key & 0x1F);
         var entryType = EntryTypes[type];
         value[index] = (MetadataEntry)Activator.CreateInstance(entryType, index);
         value[index].FromStream(stream);
     }
     return value;
 }
Esempio n. 8
0
        public static MetadataDictionary FromStream(MinecraftStream stream)
        {
            var  value = new MetadataDictionary();
            byte key   = 0;

            while (key != 127)
            {
                key = stream.ReadUInt8();
                if (key == 127)
                {
                    break;
                }
                byte type      = (byte)((key & 0xE0) >> 5);
                byte index     = (byte)(key & 0x1F);
                var  entryType = EntryTypes[type];
                value[index] = (MetadataEntry)Activator.CreateInstance(entryType);
                value[index].FromStream(stream);
                value[index].Index = index;
            }
            return(value);
        }
Esempio n. 9
0
 public override void FromStream(MinecraftStream stream)
 {
     Value = stream.ReadUInt8();
 }
Esempio n. 10
0
 public override void FromStream(MinecraftStream stream)
 {
     Value = stream.ReadUInt8();
 }
Esempio n. 11
0
 public void ReadPacket(MinecraftStream stream)
 {
     IsOP = stream.ReadUInt8() == 0x64;
 }