summaryrefslogtreecommitdiff
path: root/modules/commands/bs_set.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-11-24 14:27:23 -0500
committerAdam <Adam@anope.org>2014-11-24 14:27:23 -0500
commit42238034490fb5479d787bd1695750387d508200 (patch)
treec93c62e0e1c936e656ae5b9ee1b62380ce2a194c /modules/commands/bs_set.cpp
parentd492923610d9c9146b2a2b63de38deab2cfd4ca7 (diff)
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.
Diffstat (limited to 'modules/commands/bs_set.cpp')
-rw-r--r--modules/commands/bs_set.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp
index ff788eefd..8a95edcaf 100644
--- a/modules/commands/bs_set.cpp
+++ b/modules/commands/bs_set.cpp
@@ -96,7 +96,7 @@ class CommandBSSetBanExpire : public Command
ChanServ::AccessGroup access = source.AccessFor(ci);
if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET"))
{
- source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->name);
+ source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName());
return;
}
@@ -120,15 +120,15 @@ class CommandBSSetBanExpire : public Command
return;
}
- ci->banexpire = t;
+ ci->SetBanExpire(t);
bool override = !access.HasPriv("SET");
- Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to change banexpire to " << ci->banexpire;
+ Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to change banexpire to " << arg;
- if (!ci->banexpire)
+ if (!t)
source.Reply(_("Bot bans will no longer automatically expire."));
else
- source.Reply(_("Bot bans will automatically expire after %s."), Anope::Duration(ci->banexpire, source.GetAccount()).c_str());
+ source.Reply(_("Bot bans will automatically expire after \002{0}\002."), Anope::Duration(t, source.GetAccount()));
}
bool OnHelp(CommandSource &source, const Anope::string &) override
@@ -156,7 +156,7 @@ class CommandBSSetPrivate : public Command
if (Anope::ReadOnly)
source.Reply(_("Services are in read-only mode. Any changes made may not persist."));
- BotInfo *bi = BotInfo::Find(nick, true);
+ ServiceBot *bi = ServiceBot::Find(nick, true);
if (bi == NULL)
{
source.Reply(_("Bot \002{0}\002 does not exist."), nick);
@@ -165,12 +165,12 @@ class CommandBSSetPrivate : public Command
if (value.equals_ci("ON"))
{
- bi->oper_only = true;
+ bi->bi->SetOperOnly(true);
source.Reply(_("Private mode of bot \002{0}\002 is now \002on\002."), bi->nick);
}
else if (value.equals_ci("OFF"))
{
- bi->oper_only = false;
+ bi->bi->SetOperOnly(false);
source.Reply(_("Private mode of bot \002{0}\002 is now \002off\002."), bi->nick);
}
else
@@ -203,10 +203,10 @@ class BSSet : public Module
void OnBotBan(User *u, ChanServ::Channel *ci, const Anope::string &mask) override
{
- if (!ci->banexpire)
+ if (!ci->GetBanExpire())
return;
- new CommandBSSetBanExpire::UnbanTimer(this, ci->name, mask, ci->banexpire);
+ new CommandBSSetBanExpire::UnbanTimer(this, ci->GetName(), mask, ci->GetBanExpire());
}
};