// Constructor public FloodExtension(Account account) { _account = account; Configuration = new FloodConfiguration(account); _seekChannelTimer = new Timer(SeekChannel_Callback, null, Timeout.Infinite, Timeout.Infinite); _salesChannelTimer = new Timer(SalesChannel_Callback, null, Timeout.Infinite, Timeout.Infinite); _generalChannelTimer = new Timer(GeneralChannel_Callback, null, Timeout.Infinite, Timeout.Infinite); _account.Game.Map.PlayerJoined += Map_PlayerJoined; _account.Game.Map.PlayerLeft += Map_PlayerLeft; }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { Configuration.Dispose(); _seekChannelTimer.Dispose(); _salesChannelTimer.Dispose(); _generalChannelTimer.Dispose(); } Configuration = null; _seekChannelTimer = null; _salesChannelTimer = null; _generalChannelTimer = null; _account = null; disposedValue = true; } }