Example #1
0
        internal static ClientEventInfo Parse(BinaryReader br)
        {
            var type = br.ReadByte();

            CollisionType colType;

            switch (type)
            {
            case 10:
                colType = CollisionType.CollisionWithCar;
                break;

            case 11:
                colType = CollisionType.CollisionWithEnv;
                break;

            default:
                throw new Exception($"Unknown Client Event Type: {type}");
            }

            return(new ClientEventInfo(
                       colType,
                       br.ReadByte(),
                       colType == CollisionType.CollisionWithCar ? br.ReadByte() : (byte?)null,
                       br.ReadSingle(),
                       Vector3F.Parse(br),
                       Vector3F.Parse(br)
                       ));
        }
Example #2
0
 internal static CarUpdateInfo Parse(BinaryReader br)
 {
     return(new CarUpdateInfo(
                br.ReadByte(),
                Vector3F.Parse(br),
                Vector3F.Parse(br),
                br.ReadByte(),
                br.ReadUInt16(),
                br.ReadSingle()
                ));
 }