X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_geo_maxmind.cpp;h=2850e050162af7c84e389e0a9446fe129fd4648f;hb=3151d60c1ecc9462e4c335282ee6c31672f45111;hp=6f84f31a3ffc95fe2d82f164f238352a1041092f;hpb=0b0443687d072bb1d4a4274828a72bbc9a171ede;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_geo_maxmind.cpp b/src/modules/extra/m_geo_maxmind.cpp index 6f84f31a3..2850e0501 100644 --- a/src/modules/extra/m_geo_maxmind.cpp +++ b/src/modules/extra/m_geo_maxmind.cpp @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 Peter Powell + * Copyright (C) 2019-2020 Sadie Powell + * Copyright (C) 2019 Matt Schatz * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -16,9 +17,12 @@ * along with this program. If not, see . */ +/// $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 /// $PackageInfo: require_system("darwin") libmaxminddb pkg-config /// $PackageInfo: require_system("debian" "9.0") libmaxminddb-dev pkg-config /// $PackageInfo: require_system("ubuntu" "16.04") libmaxminddb-dev pkg-config @@ -31,11 +35,11 @@ #include "modules/geolocation.h" #include -class GeolocationExtItem : public LocalExtItem +class GeolocationExtItem : public ExtensionItem { public: GeolocationExtItem(Module* parent) - : LocalExtItem("geolocation", ExtensionItem::EXT_USER, parent) + : ExtensionItem("geolocation", ExtensionItem::EXT_USER, parent) { } @@ -152,13 +156,13 @@ class ModuleGeoMaxMind : public Module 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; @@ -177,7 +181,7 @@ class ModuleGeoMaxMind : public Module void OnGarbageCollect() CXX11_OVERRIDE { for (LocationMap::iterator iter = geoapi.locations.begin(); iter != geoapi.locations.end(); ) - { + { Geolocation::Location* location = iter->second; if (location->GetUseCount()) {