Beispiel #1
0
        /// <summary>
        /// Creates a new pit stop packet.
        /// </summary>
        /// <param name="buffer">A buffer contaning the packet data.</param>
        public IS_PIT(byte[] buffer)
            : this()
        {
            PacketReader reader = new PacketReader(buffer);

            Size     = reader.ReadByte();
            Type     = (PacketType)reader.ReadByte();
            ReqI     = reader.ReadByte();
            PLID     = reader.ReadByte();
            LapsDone = reader.ReadUInt16();
            Flags    = (PlayerFlags)reader.ReadUInt16();
            reader.Skip(1);
            Penalty  = (PenaltyValue)reader.ReadByte();
            NumStops = reader.ReadByte();
            reader.Skip(1);
            Tyres = new Tyres(
                (TyreCompound)reader.ReadByte(),
                (TyreCompound)reader.ReadByte(),
                (TyreCompound)reader.ReadByte(),
                (TyreCompound)reader.ReadByte());
            Work = (PitWorkFlags)reader.ReadUInt32();
        }
Beispiel #2
0
 /// <summary>
 /// Creates a new new player packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_NPL(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     PLID = reader.ReadByte();
     UCID = reader.ReadByte();
     PType = (PlayerTypes)reader.ReadByte();
     Flags = (PlayerFlags)reader.ReadUInt16();
     PName = reader.ReadString(24);
     Plate = reader.ReadString(8);
     CName = reader.ReadString(4);
     SName = reader.ReadString(16);
     Tyres = new Tyres(
         (TyreCompound)reader.ReadByte(),
         (TyreCompound)reader.ReadByte(),
         (TyreCompound)reader.ReadByte(),
         (TyreCompound)reader.ReadByte());
     H_Mass = reader.ReadByte();
     H_TRes = reader.ReadByte();
     Model = reader.ReadByte();
     Pass = (PassengerFlags)reader.ReadByte();
     reader.Skip(1);
     SetF = (SetupFlags)reader.ReadByte();
     NumP = reader.ReadByte();
 }
Beispiel #3
0
 /// <summary>
 /// Creates a new pit stop packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_PIT(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     PLID = reader.ReadByte();
     LapsDone = reader.ReadUInt16();
     Flags = (PlayerFlags)reader.ReadUInt16();
     reader.Skip(1);
     Penalty = (PenaltyValue)reader.ReadByte();
     NumStops = reader.ReadByte();
     reader.Skip(1);
     Tyres = new Tyres(
         (TyreCompound)reader.ReadByte(),
         (TyreCompound)reader.ReadByte(),
         (TyreCompound)reader.ReadByte(),
         (TyreCompound)reader.ReadByte());
     Work = (PitWorkFlags)reader.ReadUInt32();
 }