コード例 #1
0
ファイル: ReportPlugin.cs プロジェクト: flitzi/AC_SERVER_APPS
        protected override void OnCollision(IncidentInfo incident)
        {
            if (this.BroadcastIncidents > 0)
            {
                DriverInfo driver = this.PluginManager.GetDriverByConnectionId(incident.ConnectionId1);

                if (incident.Type == (byte)ACSProtocol.MessageType.ACSP_CE_COLLISION_WITH_CAR)
                {
                    DriverInfo driver2 = this.PluginManager.GetDriverByConnectionId(incident.ConnectionId2);

                    this.PluginManager.BroadcastChatMessage(
                        string.Format(
                            "Collision between {0} and {1} with {2}km/h",
                            driver.DriverName,
                            driver2.DriverName,
                            Math.Round(incident.ImpactSpeed)));
                }
                else if (this.BroadcastIncidents > 1)
                {
                    this.PluginManager.BroadcastChatMessage(
                        string.Format("{0} crashed into wall with {1}km/h", driver.DriverName, Math.Round(incident.ImpactSpeed)));
                }
            }
        }
コード例 #2
0
ファイル: AcServerPlugin.cs プロジェクト: flitzi/acplugins
 protected internal virtual void OnCollision(IncidentInfo msg)
 {
 }