protected override void OnCollision(MsgClientEvent msg) { // Contact handling is now done by the backend completely - that is we just report any // collision with another car if (msg.Subtype == (byte)ACSProtocol.MessageType.ACSP_CE_COLLISION_WITH_CAR) { DriverInfo driver = null; if (!PluginManager.TryGetDriverInfo(Convert.ToByte(msg.CarId), out driver)) { throw new Exception("Driver not found: " + msg.CarId); } DriverInfo otherDriver = null; if (!PluginManager.TryGetDriverInfo(Convert.ToByte(msg.OtherCarId), out otherDriver)) { throw new Exception("(Other) Driver not found: " + msg.OtherCarId); } var driversCache = GetDriversCache(driver, 980); var otherDriversCache = GetDriversCache(otherDriver, 980); var driversDistance = _distancesToReport[driver]; _distancesToReport[driver] = new MRDistanceHelper(); TrySendDistance(driver, true); MRBackend.CollisionAsyncV22(msg.CreationDate, msg.CarId, msg.OtherCarId, msg.RelativeVelocity, driver.LastSplinePosition, msg.RelativePosition.X, msg.RelativePosition.Z, msg.WorldPosition.X, msg.WorldPosition.Z, driversCache.ToArray(), otherDriversCache.ToArray(), driversDistance); } }
public void OnCollision(MsgClientEvent msg) { if (msg.RelativeVelocity > 1 && msg.CarId != msg.OtherCarId) { if (msg.CarId < Leaderboard.Count) { ++Leaderboard[msg.CarId].Collisions; } if (msg.OtherCarId < Leaderboard.Count) { ++Leaderboard[msg.OtherCarId].Collisions; } } }
protected override void OnCollision(MsgClientEvent msg) { base.OnCollision(msg); }
public virtual void OnCollision(MsgClientEvent msg) { }
protected internal virtual void OnCollision(MsgClientEvent msg) { }