/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2019-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/// $CompilerFlags: require_version("libmaxminddb" "0" "1.2.1") warning("The version of libmaxminddb you are using may cause a segmentation fault if given a corrupt database file!")
/// $CompilerFlags: find_compiler_flags("libmaxminddb" "")
+
/// $LinkerFlags: find_linker_flags("libmaxminddb" "-lmaxminddb")
/// $PackageInfo: require_system("arch") libmaxminddb pkgconf
Version GetVersion() CXX11_OVERRIDE
{
- return Version("Provides Geolocation lookups using the libMaxMindDB library", VF_VENDOR);
+ return Version("Allows the server to perform geolocation lookups on both IP addresses and users.", VF_VENDOR);
}
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* tag = ServerInstance->Config->ConfValue("maxmind");
- const std::string file = ServerInstance->Config->Paths.PrependConfig(tag->getString("file", "GeoLite2-Country.mmdb"));
+ const std::string file = ServerInstance->Config->Paths.PrependConfig(tag->getString("file", "GeoLite2-Country.mmdb", 1));
// Try to read the new database.
MMDB_s mmdb;
void OnGarbageCollect() CXX11_OVERRIDE
{
for (LocationMap::iterator iter = geoapi.locations.begin(); iter != geoapi.locations.end(); )
- {
+ {
Geolocation::Location* location = iter->second;
if (location->GetUseCount())
{