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/extra/stats/irc2sql/irc2sql.cpp | 8 ++++---- modules/extra/stats/irc2sql/irc2sql.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/extra/stats/irc2sql') diff --git a/modules/extra/stats/irc2sql/irc2sql.cpp b/modules/extra/stats/irc2sql/irc2sql.cpp index 8c0aa83ab..bc302c575 100644 --- a/modules/extra/stats/irc2sql/irc2sql.cpp +++ b/modules/extra/stats/irc2sql/irc2sql.cpp @@ -25,7 +25,7 @@ void IRC2SQL::OnReload(Configuration::Conf *conf) const Anope::string &snick = block->Get("client"); if (snick.empty()) throw ConfigException(Module::name + ": must be defined"); - StatServ = BotInfo::Find(snick, true); + StatServ = ServiceBot::Find(snick, true); if (!StatServ) throw ConfigException(Module::name + ": no bot named " + snick); @@ -99,7 +99,7 @@ void IRC2SQL::OnUserConnect(User *u, bool &exempt) query.SetValue("ident", u->GetIdent()); query.SetValue("vident", u->GetVIdent()); query.SetValue("secure", u->HasMode("SSL") || u->HasExt("ssl") ? "Y" : "N"); - query.SetValue("account", u->Account() ? u->Account()->display : ""); + query.SetValue("account", u->Account() ? u->Account()->GetDisplay() : ""); query.SetValue("fingerprint", u->fingerprint); query.SetValue("signon", u->signon); query.SetValue("server", u->server->GetName()); @@ -158,7 +158,7 @@ void IRC2SQL::OnUserLogin(User *u) { query = "UPDATE `" + prefix + "user` SET account=@account@ WHERE nick=@nick@"; query.SetValue("nick", u->nick); - query.SetValue("account", u->Account() ? u->Account()->display : ""); + query.SetValue("account", u->Account() ? u->Account()->GetDisplay() : ""); this->RunQuery(query); } @@ -255,7 +255,7 @@ void IRC2SQL::OnTopicUpdated(Channel *c, const Anope::string &user, const Anope: this->RunQuery(query); } -void IRC2SQL::OnBotNotice(User *u, BotInfo *bi, Anope::string &message) +void IRC2SQL::OnBotNotice(User *u, ServiceBot *bi, Anope::string &message) { Anope::string versionstr; if (bi != StatServ) diff --git a/modules/extra/stats/irc2sql/irc2sql.h b/modules/extra/stats/irc2sql/irc2sql.h index 1ce118f38..175e37681 100644 --- a/modules/extra/stats/irc2sql/irc2sql.h +++ b/modules/extra/stats/irc2sql/irc2sql.h @@ -27,7 +27,7 @@ class IRC2SQL : public Module std::vector TableList, ProcedureList, EventList; Anope::string prefix, GeoIPDB; bool quitting, introduced_myself, ctcpuser, ctcpeob, firstrun; - BotInfo *StatServ; + ServiceBot *StatServ; PrimitiveExtensibleItem versionreply; void RunQuery(const SQL::Query &q); @@ -71,7 +71,7 @@ class IRC2SQL : public Module void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) override; - void OnBotNotice(User *u, BotInfo *bi, Anope::string &message) override; + void OnBotNotice(User *u, ServiceBot *bi, Anope::string &message) override; }; -- cgit