ReadInt16() public method

Reads a 16-bit signed integer from the stream, using the bit converter for this reader. 2 bytes are read.
public ReadInt16 ( ) : short
return short
示例#1
0
 protected override void Parse(EndianBinaryReader r)
 {
     EID = ReadVarInt(r);
     Velocity = new CoordDouble();
     Velocity.X = ((double)r.ReadInt16()) / scale;
     Velocity.Y = ((double)r.ReadInt16()) / scale;
     Velocity.Z = ((double)r.ReadInt16()) / scale;
 }
示例#2
0
 protected override void Parse(EndianBinaryReader r)
 {
     WindowID = r.ReadByte();
     Slot = r.ReadInt16();
     RightClick = r.ReadSByte();
     ActionID = r.ReadInt16();
     Shift = r.ReadSByte();
     Item = SlotItem.Read(r);
 }
示例#3
0
            public UItem(EndianBinaryReader r)
            {
                X = r.ReadInt32();
                Z = r.ReadInt32();
                OccupiedBitmap = r.ReadInt16();
                AdditionalBitmap = r.ReadInt16();
#if DEBUG
                if (AdditionalBitmap != 0)
                    Log.WriteServer("AdditionalData: " + AdditionalBitmap.ToString("X"));
#endif
            }
示例#4
0
        protected override void Parse(EndianBinaryReader r)
        {
            SlotID = r.ReadInt16();

            if (SlotID < 0 && SlotID > 8)
                throw new InvalidOperationException("Invalid holding slot id: " + SlotID);
        }
示例#5
0
 protected override void Parse(EndianBinaryReader r)
 {
     EID = ReadVarInt(r);
     Type = (MobType)r.ReadByte();
     Pos = ReadAbsInt(r);
     Yaw = r.ReadSByte() * Math.PI / 128;
     Pitch = r.ReadSByte() * Math.PI / 128;
     HeadYaw = r.ReadByte();
     UX = r.ReadInt16();
     UY = r.ReadInt16();
     UZ = r.ReadInt16();
     Metadata = Metadata.Read(r);
     #if DEBUGPACKET
     if (Type.ToString() == ((int)Type).ToString())
         throw new NotImplementedException(Type.ToString());
     #endif
 }
示例#6
0
 protected override void Parse(EndianBinaryReader r)
 {
     int columnCount = r.ReadInt16();
     int compressedLength = r.ReadInt32();
     Unknown = r.ReadBoolean();
     CompressedChunkColumns = r.ReadBytesOrThrow(compressedLength);
     ColumnMeta = new UItem[columnCount];
     for (int n = 0; n < columnCount; n++)
     {
         ColumnMeta [n] = new UItem(r);
     }
 }
示例#7
0
        protected override void Parse(EndianBinaryReader r)
        {
            WindowID = r.ReadByte();
            int count = r.ReadInt16();
            Items = new SlotItem [count];
            for (int n = 0; n < Items.Length; n++)
            {
                Items [n] = SlotItem.Read(r);
#if DEBUG
                //Console.WriteLine("Slot " + n + ": " + Items [n]);
#endif
            }
        }
示例#8
0
        protected override void Parse(EndianBinaryReader r)
        {
            EID = ReadVarInt(r);
            Type = (Vehicles)r.ReadByte();
            #if DEBUGPACKET
            if (Type.ToString() == ((int)Type).ToString())
                throw new NotImplementedException(Type.ToString());
            #endif
            if (Type == Vehicles.Unknown)
                Console.WriteLine();
            Position = ReadAbsInt(r);

            Yaw = r.ReadSByte();
            Pitch = r.ReadSByte();

            SourceEntity = r.ReadInt32();
            if (SourceEntity <= 0)
                return;
            short vx = r.ReadInt16();
            short vy = r.ReadInt16();
            short vz = r.ReadInt16();			
            Velocity = new CoordInt(vx, vy, vz);
        }
示例#9
0
 protected override void Parse(EndianBinaryReader r)
 {
     EID = ReadVarInt(r);
     PlayerUUID = new Guid(r.ReadBytesOrThrow(16));
     Position = ReadAbsInt(r);
     Yaw = r.ReadSByte() * Math.PI / 128;
     Pitch = r.ReadSByte() * Math.PI / 128;
     CurrentItem = r.ReadInt16();
     try
     {
         Meta = Metadata.Read(r);
     }
     catch (Exception)
     {
         Console.WriteLine("BadMeta: " + BitConverter.ToString(PacketBuffer));
     }
     Debug.WriteLine("Parsed " + this);
 }
示例#10
0
 protected override void Parse(EndianBinaryReader r)
 {
     EID = ReadVarInt(r);
     Slot = r.ReadInt16();
     Item = SlotItem.Read(r);
 }
示例#11
0
 protected override void Parse(EndianBinaryReader r)
 {
     EID = ReadVarInt(r);
     Position = ReadAbsInt(r);
     Count = r.ReadInt16();
 }
示例#12
0
 protected override void Parse(EndianBinaryReader r)
 {
     WindowID = r.ReadByte();
     Property = r.ReadInt16();
     Value = r.ReadInt16();
 }
示例#13
0
 protected override void Parse(EndianBinaryReader r)
 {
     WindowID = r.ReadByte();
     Slot = r.ReadInt16();
     Item = SlotItem.Read(r);
 }
 protected override void Parse(EndianBinaryReader r)
 {
     WindowID = r.ReadByte();
     ActionID = r.ReadInt16();
     Accepted = r.ReadBoolean();
 }