summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-01-21 17:33:57 -0500
committerAdam <Adam@anope.org>2014-01-21 17:33:57 -0500
commit1027ec667a84b918f21b57fc4842bf6bb818105e (patch)
treefc8f137c2f5cc1bc471f7b9c104a4c7d0eecac2c /modules
parent4d9273efa42a16380de8ac81c615eaac89052f68 (diff)
Made the chanstats confs try and look similar to every other configuration file
Diffstat (limited to 'modules')
-rw-r--r--modules/extra/stats/cs_fantasy_stats.cpp4
-rw-r--r--modules/extra/stats/cs_fantasy_top.cpp4
-rw-r--r--modules/extra/stats/irc2sql/irc2sql.cpp3
-rw-r--r--modules/extra/stats/irc2sql/irc2sql.h2
-rw-r--r--modules/extra/stats/irc2sql/tables.cpp20
-rw-r--r--modules/extra/stats/m_chanstats.cpp4
6 files changed, 15 insertions, 22 deletions
diff --git a/modules/extra/stats/cs_fantasy_stats.cpp b/modules/extra/stats/cs_fantasy_stats.cpp
index 43f7eb04a..ce5195122 100644
--- a/modules/extra/stats/cs_fantasy_stats.cpp
+++ b/modules/extra/stats/cs_fantasy_stats.cpp
@@ -75,9 +75,7 @@ class CSStats : public Module
void OnReload(Configuration::Conf *conf) anope_override
{
- prefix = conf->GetModule("m_chanstats")->Get<const Anope::string>("prefix");
- if (prefix.empty())
- prefix = "anope_";
+ prefix = conf->GetModule("m_chanstats")->Get<const Anope::string>("prefix", "anope_");
this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule("m_chanstats")->Get<const Anope::string>("engine"));
}
diff --git a/modules/extra/stats/cs_fantasy_top.cpp b/modules/extra/stats/cs_fantasy_top.cpp
index f747bebd8..b110a58ce 100644
--- a/modules/extra/stats/cs_fantasy_top.cpp
+++ b/modules/extra/stats/cs_fantasy_top.cpp
@@ -100,9 +100,7 @@ class CSTop : public Module
void OnReload(Configuration::Conf *conf) anope_override
{
- prefix = conf->GetModule("m_chanstats")->Get<const Anope::string>("prefix");
- if (prefix.empty())
- prefix = "anope_";
+ prefix = conf->GetModule("m_chanstats")->Get<const Anope::string>("prefix", "anope_");
this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule("m_chanstats")->Get<const Anope::string>("engine"));
}
diff --git a/modules/extra/stats/irc2sql/irc2sql.cpp b/modules/extra/stats/irc2sql/irc2sql.cpp
index e5d94fec9..d20e1a420 100644
--- a/modules/extra/stats/irc2sql/irc2sql.cpp
+++ b/modules/extra/stats/irc2sql/irc2sql.cpp
@@ -12,8 +12,7 @@ void IRC2SQL::OnReload(Configuration::Conf *conf)
{
Configuration::Block *block = Config->GetModule(this);
prefix = block->Get<const Anope::string>("prefix", "anope_");
- UseGeoIP = block->Get<bool>("GeoIPLookup", "no");
- GeoIPDB = block->Get<const Anope::string>("GeoIPDatabase", "country");
+ GeoIPDB = block->Get<const Anope::string>("geoip_database");
ctcpuser = block->Get<bool>("ctcpuser", "no");
ctcpeob = block->Get<bool>("ctcpeob", "yes");
Anope::string engine = block->Get<const Anope::string>("engine");
diff --git a/modules/extra/stats/irc2sql/irc2sql.h b/modules/extra/stats/irc2sql/irc2sql.h
index 1e28d99d4..0c516f5e3 100644
--- a/modules/extra/stats/irc2sql/irc2sql.h
+++ b/modules/extra/stats/irc2sql/irc2sql.h
@@ -26,7 +26,7 @@ class IRC2SQL : public Module
SQL::Query query;
std::vector<Anope::string> TableList, ProcedureList, EventList;
Anope::string prefix, GeoIPDB;
- bool quitting, introduced_myself, UseGeoIP, ctcpuser, ctcpeob, firstrun;
+ bool quitting, introduced_myself, ctcpuser, ctcpeob, firstrun;
BotInfo *StatServ;
PrimitiveExtensibleItem<bool> versionreply;
diff --git a/modules/extra/stats/irc2sql/tables.cpp b/modules/extra/stats/irc2sql/tables.cpp
index d80f37535..661069443 100644
--- a/modules/extra/stats/irc2sql/tables.cpp
+++ b/modules/extra/stats/irc2sql/tables.cpp
@@ -17,7 +17,7 @@ void IRC2SQL::CheckTables()
this->GetTables();
- if (UseGeoIP && GeoIPDB.equals_ci("country") && !this->HasTable(prefix + "geoip_country"))
+ if (GeoIPDB.equals_ci("country") && !this->HasTable(prefix + "geoip_country"))
{
query = "CREATE TABLE `" + prefix + "geoip_country` ("
"`start` INT UNSIGNED NOT NULL,"
@@ -29,7 +29,7 @@ void IRC2SQL::CheckTables()
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
this->RunQuery(query);
}
- if (UseGeoIP && GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_blocks"))
+ if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_blocks"))
{
query = "CREATE TABLE `" + prefix + "geoip_city_blocks` ("
"`start` INT UNSIGNED NOT NULL,"
@@ -41,7 +41,7 @@ void IRC2SQL::CheckTables()
this->RunQuery(query);
}
- if (UseGeoIP && GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_location"))
+ if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_location"))
{
query = "CREATE TABLE `" + prefix + "geoip_city_location` ("
"`locId` INT UNSIGNED NOT NULL,"
@@ -55,7 +55,7 @@ void IRC2SQL::CheckTables()
") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
this->RunQuery(query);
}
- if (UseGeoIP && GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_region"))
+ if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_region"))
{ query = "CREATE TABLE `" + prefix + "geoip_city_region` ("
"`country` CHAR(2) NOT NULL,"
"`region` CHAR(2) NOT NULL,"
@@ -157,10 +157,8 @@ void IRC2SQL::CheckTables()
if (this->HasProcedure(prefix + "UserConnect"))
this->RunQuery(SQL::Query("DROP PROCEDURE " + prefix + "UserConnect"));
- if (UseGeoIP)
- {
- if (GeoIPDB.equals_ci("country"))
- geoquery = "UPDATE `" + prefix + "user` AS u "
+ if (GeoIPDB.equals_ci("country"))
+ geoquery = "UPDATE `" + prefix + "user` AS u "
"JOIN ( SELECT `countrycode`, `countryname` "
"FROM `" + prefix + "geoip_country` "
"WHERE INET_ATON(ip_) <= `end` "
@@ -168,8 +166,8 @@ void IRC2SQL::CheckTables()
"ORDER BY `end` ASC LIMIT 1 ) as c "
"SET u.geocode = c.countrycode, u.geocountry = c.countryname "
"WHERE u.nick = nick_; ";
- else if (GeoIPDB.equals_ci("city"))
- geoquery = "UPDATE `" + prefix + "user` as u "
+ else if (GeoIPDB.equals_ci("city"))
+ geoquery = "UPDATE `" + prefix + "user` as u "
"JOIN ( SELECT * FROM `" + prefix + "geoip_city_location` "
"WHERE `locID` = ( SELECT `locID` "
"FROM `" + prefix + "geoip_city_blocks` "
@@ -185,7 +183,7 @@ void IRC2SQL::CheckTables()
"WHERE `country` = l.country "
"AND `region` = l.region )"
"WHERE u.nick = nick_;";
- }
+
query = "CREATE PROCEDURE `" + prefix + "UserConnect`"
"(nick_ varchar(255), host_ varchar(255), vhost_ varchar(255), "
"chost_ varchar(255), realname_ varchar(255), ip_ varchar(255), "
diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp
index 1ca670368..4151c4579 100644
--- a/modules/extra/stats/m_chanstats.cpp
+++ b/modules/extra/stats/m_chanstats.cpp
@@ -491,8 +491,8 @@ class MChanstats : public Module
SmileysHappy = block->Get<const Anope::string>("SmileysHappy");
SmileysSad = block->Get<const Anope::string>("SmileysSad");
SmileysOther = block->Get<const Anope::string>("SmileysOther");
- NSDefChanstats = block->Get<bool>("NSDefChanstats", "no");
- CSDefChanstats = block->Get<bool>("CSDefChanstats", "no");
+ NSDefChanstats = block->Get<bool>("ns_def_chanstats");
+ CSDefChanstats = block->Get<bool>("cs_def_chanstats");
Anope::string engine = block->Get<const Anope::string>("engine");
this->sql = ServiceReference<SQL::Provider>("SQL::Provider", engine);
if (sql)