diff options
author | Adam <Adam@anope.org> | 2014-11-24 14:27:23 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-11-24 14:27:23 -0500 |
commit | 42238034490fb5479d787bd1695750387d508200 (patch) | |
tree | c93c62e0e1c936e656ae5b9ee1b62380ce2a194c /modules/commands/cs_enforce.cpp | |
parent | d492923610d9c9146b2a2b63de38deab2cfd4ca7 (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/cs_enforce.cpp')
-rw-r--r-- | modules/commands/cs_enforce.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/modules/commands/cs_enforce.cpp b/modules/commands/cs_enforce.cpp index 80abed196..10069d3f8 100644 --- a/modules/commands/cs_enforce.cpp +++ b/modules/commands/cs_enforce.cpp @@ -26,8 +26,8 @@ class CommandCSEnforce : public Command * part of the code. This way we can enforce SECUREOPS even * if it's off. */ - bool hadsecureops = ci->HasExt("SECUREOPS"); - ci->Extend<bool>("SECUREOPS"); + bool hadsecureops = ci->HasFieldS("SECUREOPS"); + ci->SetS<bool>("SECUREOPS", true); for (Channel::ChanUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) { @@ -37,9 +37,9 @@ class CommandCSEnforce : public Command } if (!hadsecureops) - ci->Shrink<bool>("SECUREOPS"); + ci->UnsetS<bool>("SECUREOPS"); - source.Reply(_("\002Secureops\002 enforced on \002{0}\002."), ci->name); + source.Reply(_("\002Secureops\002 enforced on \002{0}\002."), ci->GetName()); } void DoRestricted(CommandSource &source, ChanServ::Channel *ci) @@ -70,7 +70,7 @@ class CommandCSEnforce : public Command ci->c->Kick(NULL, user, "%s", reason.c_str()); } - source.Reply(_("\002Restricted\002 enforced on \002{0}\002."), ci->name); + source.Reply(_("\002Restricted\002 enforced on \002{0}\002."), ci->GetName()); } void DoRegOnly(CommandSource &source, ChanServ::Channel *ci) @@ -102,7 +102,7 @@ class CommandCSEnforce : public Command ci->c->Kick(NULL, user, "%s", reason.c_str()); } - source.Reply(_("\002Registered only\002 enforced on \002{0}\002."), ci->name); + source.Reply(_("\002Registered only\002 enforced on \002{0}\002."), ci->GetName()); } void DoSSLOnly(CommandSource &source, ChanServ::Channel *ci) @@ -119,7 +119,7 @@ class CommandCSEnforce : public Command if (user->IsProtected()) continue; - if (!user->HasMode("SSL") && !user->HasExt("ssl")) + if (!user->HasMode("SSL") && !user->HasExtOK("ssl")) users.push_back(user); } @@ -134,7 +134,7 @@ class CommandCSEnforce : public Command ci->c->Kick(NULL, user, "%s", reason.c_str()); } - source.Reply(_("\002SSL only\002 enforced on %s."), ci->name.c_str()); + source.Reply(_("\002SSL only\002 enforced on %s."), ci->GetName().c_str()); } void DoBans(CommandSource &source, ChanServ::Channel *ci) @@ -163,7 +163,7 @@ class CommandCSEnforce : public Command ci->c->Kick(NULL, user, "%s", reason.c_str()); } - source.Reply(_("\002Bans\002 enforced on %s."), ci->name.c_str()); + source.Reply(_("\002Bans\002 enforced on %s."), ci->GetName().c_str()); } void DoLimit(CommandSource &source, ChanServ::Channel *ci) @@ -174,7 +174,7 @@ class CommandCSEnforce : public Command Anope::string l_str; if (!ci->c->GetParam("LIMIT", l_str)) { - source.Reply(_("There is no limit is set on \002{0}\002."), ci->name); + source.Reply(_("There is no limit is set on \002{0}\002."), ci->GetName()); return; } @@ -187,7 +187,7 @@ class CommandCSEnforce : public Command } catch (const ConvertException &) { - source.Reply(_("The limit on \002{0}\002 is not valid."), ci->name); + source.Reply(_("The limit on \002{0}\002 is not valid."), ci->GetName()); return; } @@ -218,7 +218,7 @@ class CommandCSEnforce : public Command ci->c->Kick(NULL, user, "%s", reason.c_str()); } - source.Reply(_("LIMIT enforced on \002{0}\002, \002{1]\002 users removed."), ci->name, users.size()); + source.Reply(_("LIMIT enforced on \002{0}\002, \002{1]\002 users removed."), ci->GetName(), users.size()); } public: @@ -242,13 +242,13 @@ class CommandCSEnforce : public Command if (!ci->c) { - source.Reply(_("Channel \002{0}\002 doesn't exist."), ci->name); + source.Reply(_("Channel \002{0}\002 doesn't exist."), ci->GetName()); return; } if (!source.AccessFor(ci).HasPriv("AKICK") && !source.HasPriv("chanserv/access/modify")) { - source.Reply("Access denied. You do not have the \002{0}\002 privilege on \002{1}\002.", "AKICK", ci->name); + source.Reply("Access denied. You do not have the \002{0}\002 privilege on \002{1}\002.", "AKICK", ci->GetName()); return; } |