public override void OnLoad(BotShell bot) { try { this._database = (VhanetDatabase)bot.Plugins.GetPlugin("VhanetDatabase"); } catch { throw new Exception("Unable to connect to 'Vhanet :: Database' Plugin!"); } if (!this._database.Connected) { throw new Exception("Not connected to the database!"); } try { this._host = (VhanetMembersHost)bot.Plugins.GetPlugin("VhanetMembersHost"); } catch { throw new Exception("Unable to connect to 'Vhanet :: Members Host' Plugin!"); } }
public override void OnLoad(BotShell bot) { this._bot = bot; try { this._database = (VhanetDatabase)bot.Plugins.GetPlugin("VhanetDatabase"); } catch { throw new Exception("Unable to connect to 'Vhanet :: Database' Plugin!"); } if (!this._database.Connected) { throw new Exception("Not connected to the database!"); } try { this._host = (VhanetMembersHost)bot.Plugins.GetPlugin("VhanetMembersHost"); } catch { throw new Exception("Unable to connect to 'Vhanet :: Members Host' Plugin!"); } bot.Timers.Minute += new EventHandler(Timers_Minute); bot.Timers.EightHours += new EventHandler(OnTimer); bot.Events.UserLogonEvent += new UserLogonHandler(Events_UserLogonEvent); bot.Events.UserLogoffEvent += new UserLogoffHandler(Events_UserLogoffEvent); this._database.ExecuteNonQuery("UPDATE members SET online = 0"); this._database.ExecuteNonQuery("UPDATE alts SET online = 0"); }