Beispiel #1
0
 protected internal virtual void OnLapCompleted(LapInfo msg)
 {
 }
Beispiel #2
0
 protected override void OnLapCompleted(LapInfo lap)
 {
     if (this.BroadcastFastestLap > 0)
     {
         DriverInfo driver = PluginManager.GetDriverByConnectionId(lap.ConnectionId);
         // check if this is a new fastest lap for this session
         if (lap.Cuts == 0 && this.PluginManager.CurrentSession.Laps.FirstOrDefault(l => l.Cuts == 0 && l.Laptime < lap.Laptime) == null)
         {
             this.PluginManager.BroadcastChatMessage(
                     string.Format("{0} has set a new fastest lap: {1}", driver.DriverName, AcServerPluginManager.FormatTimespan((int)lap.Laptime)));
         }
         else if (this.BroadcastFastestLap > 1)
         {
             if (lap.Cuts == 0)
             {
                 this.PluginManager.BroadcastChatMessage(
                         string.Format("{0} completed a lap: {1}", driver.DriverName, AcServerPluginManager.FormatTimespan((int)lap.Laptime)));
             }
             else
             {
                 this.PluginManager.BroadcastChatMessage(
                         string.Format("{0} did a lap with {1} cut(s): {2}", driver.DriverName, lap.Cuts, AcServerPluginManager.FormatTimespan((int)lap.Laptime)));
             }
         }
     }
 }