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!"); } bot.Configuration.Register(ConfigType.String, this.InternalName, "group", "Members Group", this._bot.Character); string group = this._bot.Configuration.GetString(this.InternalName, "group", this._bot.Character); this._bot.UsersOverride(new VhanetMembers(this._bot, group, this._database)); bot.Events.ConfigurationChangedEvent += new ConfigurationChangedHandler(Events_ConfigurationChangedEvent); }
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"); }
public VhanetMembers(BotShell bot, string group, VhanetDatabase database) { this._bot = bot; this._group = group; this._database = database; }