From 42238034490fb5479d787bd1695750387d508200 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 24 Nov 2014 14:27:23 -0500 Subject: Rewrite serializable to have field level granularity Represent serializable objects in a digraph, and as a result made most object relationships implicitly defined, and use the graph to trace references between objects to determine relationships. Edges may also be marked as having a dependency of the object they point to, which allows for automatic cleanup and deletion of most objects when no longer needed. Additionally, this allows not having to require in-memory copies of everything when using external databases. db_sql has been rewritten for this and now always requires a database to function. db_sql with MySQL now requires InnoDB to make use of transactions and foreign key constraints. --- modules/commands/bs_control.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'modules/commands/bs_control.cpp') diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index 74e978404..fc97cd163 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -34,14 +34,14 @@ class CommandBSSay : public Command if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration")) { - source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->name); + source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->GetName()); return; } - if (!ci->bi) + if (!ci->GetBot()) { - source.Reply(_("There is no bot assigned to \002{0}\002. One must be assigned to the channel before this command can be used."), ci->name); - BotInfo *bi; + source.Reply(_("There is no bot assigned to \002{0}\002. One must be assigned to the channel before this command can be used."), ci->GetName()); + ServiceBot *bi; Anope::string name; Command::FindCommandFromService("botserv/assign", bi, name); CommandInfo *help = source.service->FindCommand("generic/help"); @@ -51,9 +51,9 @@ class CommandBSSay : public Command return; } - if (!ci->c || !ci->c->FindUser(ci->bi)) + if (!ci->c || !ci->c->FindUser(ci->GetBot())) { - source.Reply(_("Bot \002{0}\002 is not on channel \002{1}\002."), ci->bi->nick, ci->name); + source.Reply(_("Bot \002{0}\002 is not on channel \002{1}\002."), ci->GetBot()->nick, ci->GetName()); return; } @@ -63,8 +63,8 @@ class CommandBSSay : public Command return; } - IRCD->SendPrivmsg(*ci->bi, ci->name, "%s", text.c_str()); - ci->bi->lastmsg = Anope::CurTime; + IRCD->SendPrivmsg(ci->GetBot(), ci->GetName(), "%s", text.c_str()); + ci->GetBot()->lastmsg = Anope::CurTime; bool override = !source.AccessFor(ci).HasPriv("SAY"); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << text; @@ -106,14 +106,14 @@ class CommandBSAct : public Command if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration")) { - source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->name); + source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->GetName()); return; } - if (!ci->bi) + if (!ci->GetBot()) { - source.Reply(_("There is no bot assigned to \002{0}\002. One must be assigned to the channel before this command can be used."), ci->name); - BotInfo *bi; + source.Reply(_("There is no bot assigned to \002{0}\002. One must be assigned to the channel before this command can be used."), ci->GetName()); + ServiceBot *bi; Anope::string name; Command::FindCommandFromService("botserv/assign", bi, name); CommandInfo *help = source.service->FindCommand("generic/help"); @@ -123,9 +123,9 @@ class CommandBSAct : public Command return; } - if (!ci->c || !ci->c->FindUser(ci->bi)) + if (!ci->c || !ci->c->FindUser(ci->GetBot())) { - source.Reply(_("Bot \002{0}\002 is not on channel \002{1}\002."), ci->bi->nick, ci->name); + source.Reply(_("Bot \002{0}\002 is not on channel \002{1}\002."), ci->GetBot()->nick, ci->GetName()); return; } @@ -133,8 +133,8 @@ class CommandBSAct : public Command if (message.empty()) return; - IRCD->SendAction(*ci->bi, ci->name, "%s", message.c_str()); - ci->bi->lastmsg = Anope::CurTime; + IRCD->SendAction(ci->GetBot(), ci->GetName(), "%s", message.c_str()); + ci->GetBot()->lastmsg = Anope::CurTime; bool override = !source.AccessFor(ci).HasPriv("SAY"); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << message; -- cgit