summaryrefslogtreecommitdiff
path: root/modules/extra/stats
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2022-01-12 22:05:59 +0000
committerSadie Powell <sadie@witchery.services>2022-01-12 22:08:35 +0000
commita631028660d527f509c3b028cfa5f2903a125077 (patch)
tree830ba6644bb312af32847db654bfb842ed44a7cd /modules/extra/stats
parent4e5fc9797c2ea285e855f808dc65694d1cdba358 (diff)
parent04257b9d6ab0fa1a63ade1d2ad0edc2d08eb74ce (diff)
Merge branch '2.0' into 2.1.
Diffstat (limited to 'modules/extra/stats')
-rw-r--r--modules/extra/stats/cs_fantasy_stats.cpp2
-rw-r--r--modules/extra/stats/cs_fantasy_top.cpp2
-rw-r--r--modules/extra/stats/irc2sql/irc2sql.cpp2
-rw-r--r--modules/extra/stats/irc2sql/irc2sql.h2
-rw-r--r--modules/extra/stats/irc2sql/tables.cpp93
-rw-r--r--modules/extra/stats/irc2sql/utils.cpp2
-rw-r--r--modules/extra/stats/m_chanstats.cpp2
7 files changed, 55 insertions, 50 deletions
diff --git a/modules/extra/stats/cs_fantasy_stats.cpp b/modules/extra/stats/cs_fantasy_stats.cpp
index ba0d216cb..6054d613a 100644
--- a/modules/extra/stats/cs_fantasy_stats.cpp
+++ b/modules/extra/stats/cs_fantasy_stats.cpp
@@ -1,6 +1,6 @@
/* Chanstats core functions
*
- * (C) 2003-2021 Anope Team
+ * (C) 2003-2022 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
diff --git a/modules/extra/stats/cs_fantasy_top.cpp b/modules/extra/stats/cs_fantasy_top.cpp
index 3d4d75241..b5fad641f 100644
--- a/modules/extra/stats/cs_fantasy_top.cpp
+++ b/modules/extra/stats/cs_fantasy_top.cpp
@@ -1,6 +1,6 @@
/* Chanstats core functions
*
- * (C) 2003-2021 Anope Team
+ * (C) 2003-2022 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
diff --git a/modules/extra/stats/irc2sql/irc2sql.cpp b/modules/extra/stats/irc2sql/irc2sql.cpp
index f0667e2e4..209f8831b 100644
--- a/modules/extra/stats/irc2sql/irc2sql.cpp
+++ b/modules/extra/stats/irc2sql/irc2sql.cpp
@@ -1,6 +1,6 @@
/*
*
- * (C) 2013-2021 Anope Team
+ * (C) 2013-2022 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
diff --git a/modules/extra/stats/irc2sql/irc2sql.h b/modules/extra/stats/irc2sql/irc2sql.h
index 41dfce38d..039839855 100644
--- a/modules/extra/stats/irc2sql/irc2sql.h
+++ b/modules/extra/stats/irc2sql/irc2sql.h
@@ -1,6 +1,6 @@
/*
*
- * (C) 2013-2021 Anope Team
+ * (C) 2013-2022 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
diff --git a/modules/extra/stats/irc2sql/tables.cpp b/modules/extra/stats/irc2sql/tables.cpp
index 28110fa9e..45fa301dd 100644
--- a/modules/extra/stats/irc2sql/tables.cpp
+++ b/modules/extra/stats/irc2sql/tables.cpp
@@ -1,6 +1,6 @@
/*
*
- * (C) 2013-2021 Anope Team
+ * (C) 2013-2022 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
@@ -25,52 +25,57 @@ void IRC2SQL::CheckTables()
this->GetTables();
- if (GeoIPDB.equals_ci("country") && !this->HasTable(prefix + "geoip_country"))
- {
- query = "CREATE TABLE `" + prefix + "geoip_country` ("
- "`start` INT UNSIGNED NOT NULL,"
- "`end` INT UNSIGNED NOT NULL,"
- "`countrycode` varchar(2),"
- "`countryname` varchar(50),"
- "PRIMARY KEY `end` (`end`),"
- "KEY `start` (`start`)"
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
- this->RunQuery(query);
- }
- if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_blocks"))
+ if (GeoIPDB.equals_ci("country"))
{
- query = "CREATE TABLE `" + prefix + "geoip_city_blocks` ("
- "`start` INT UNSIGNED NOT NULL,"
- "`end` INT UNSIGNED NOT NULL,"
- "`locId` INT UNSIGNED NOT NULL,"
- "PRIMARY KEY `end` (`end`),"
- "KEY `start` (`start`)"
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
- this->RunQuery(query);
-
+ if (!this->HasTable(prefix + "geoip_country"))
+ {
+ query = "CREATE TABLE `" + prefix + "geoip_country` ("
+ "`start` INT UNSIGNED NOT NULL,"
+ "`end` INT UNSIGNED NOT NULL,"
+ "`countrycode` varchar(2),"
+ "`countryname` varchar(50),"
+ "PRIMARY KEY `end` (`end`),"
+ "KEY `start` (`start`)"
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
+ this->RunQuery(query);
+ }
}
- if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_location"))
+ else if (GeoIPDB.equals_ci("city"))
{
- query = "CREATE TABLE `" + prefix + "geoip_city_location` ("
- "`locId` INT UNSIGNED NOT NULL,"
- "`country` CHAR(2) NOT NULL,"
- "`region` CHAR(2) NOT NULL,"
- "`city` VARCHAR(50),"
- "`latitude` FLOAT,"
- "`longitude` FLOAT,"
- "`areaCode` INT,"
- "PRIMARY KEY (`locId`)"
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
- this->RunQuery(query);
- }
- 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,"
- "`regionname` VARCHAR(100) NOT NULL,"
- "PRIMARY KEY (`country`,`region`)"
- ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
- this->RunQuery(query);
+ if (!this->HasTable(prefix + "geoip_city_blocks"))
+ {
+ query = "CREATE TABLE `" + prefix + "geoip_city_blocks` ("
+ "`start` INT UNSIGNED NOT NULL,"
+ "`end` INT UNSIGNED NOT NULL,"
+ "`locId` INT UNSIGNED NOT NULL,"
+ "PRIMARY KEY `end` (`end`),"
+ "KEY `start` (`start`)"
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
+ this->RunQuery(query);
+ }
+ if (!this->HasTable(prefix + "geoip_city_location"))
+ {
+ query = "CREATE TABLE `" + prefix + "geoip_city_location` ("
+ "`locId` INT UNSIGNED NOT NULL,"
+ "`country` CHAR(2) NOT NULL,"
+ "`region` CHAR(2) NOT NULL,"
+ "`city` VARCHAR(50),"
+ "`latitude` FLOAT,"
+ "`longitude` FLOAT,"
+ "`areaCode` INT,"
+ "PRIMARY KEY (`locId`)"
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
+ this->RunQuery(query);
+ }
+ if (!this->HasTable(prefix + "geoip_city_region"))
+ { query = "CREATE TABLE `" + prefix + "geoip_city_region` ("
+ "`country` CHAR(2) NOT NULL,"
+ "`region` CHAR(2) NOT NULL,"
+ "`regionname` VARCHAR(100) NOT NULL,"
+ "PRIMARY KEY (`country`,`region`)"
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
+ this->RunQuery(query);
+ }
}
if (!this->HasTable(prefix + "server"))
{
diff --git a/modules/extra/stats/irc2sql/utils.cpp b/modules/extra/stats/irc2sql/utils.cpp
index c04b55960..888fc0cb0 100644
--- a/modules/extra/stats/irc2sql/utils.cpp
+++ b/modules/extra/stats/irc2sql/utils.cpp
@@ -1,6 +1,6 @@
/*
*
- * (C) 2013-2021 Anope Team
+ * (C) 2013-2022 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp
index 92f361f64..4f5ed9e55 100644
--- a/modules/extra/stats/m_chanstats.cpp
+++ b/modules/extra/stats/m_chanstats.cpp
@@ -1,6 +1,6 @@
/*
*
- * (C) 2012-2021 Anope Team
+ * (C) 2012-2022 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.