GeoIP2

GeoIP2 1.1.2 [Databases from April 19, 2022]

Paranoiiik

хачю клиентмод
Сообщения
2,047
Реакции
1,490
  • Автор ресурса
  • #1
Paranoiiik добавил(а) новый ресурс:

GeoIP2 - Переписанное расширение GeoIP из дистрибутива SourceMod для нового формата базы данных от MaxMind

GeoIP2 - модифицированная версия расширения для SourceMod для работы с геолокацией игроков.
geoip.inc:
/**
* @section IP addresses can contain ports, the ports will be stripped out.
*/

/**
* Gets the two character country code from an IP address. (US, CA, etc)
*
* @param ip            Ip to...

Узнать больше об этом ресурсе...
 
Последнее редактирование:

counter

Участник
Сообщения
186
Реакции
22
наверное один из долгожданных плагинов.
но не могли бы вы написать навскидку какие плагины его используют?
мне на вскидку припомнился

MF Connect Info​

но перекомпилировал его с новой инклюдой и вообще не получил никакой информации.
пришлось вернуть все назад.
 

Paranoiiik

хачю клиентмод
Сообщения
2,047
Реакции
1,490
  • Автор ресурса
  • #3
наверное один из долгожданных плагинов.
Это не плагин, а расширение.
мне на вскидку припомнился

MF Connect Info​

но перекомпилировал его с новой инклюдой и вообще не получил никакой информации.
пришлось вернуть все назад.
MF Connect Info не использует ни GeoIP, ни GeoIP2.
 

counter

Участник
Сообщения
186
Реакции
22
Это не плагин, а расширение.

MF Connect Info не использует ни GeoIP, ни GeoIP2.
спасибо. не знал. а откуда он берет свою базу не подскажите?

и еще вопрос ваш экстеншен для каких плагинов известных необходим?
 

Paranoiiik

хачю клиентмод
Сообщения
2,047
Реакции
1,490
  • Автор ресурса
  • #5
а откуда он берет свою базу не подскажите?
Не подскажу. Вся информация есть в теме того плагина.
ваш экстеншен для каких плагинов известных необходим?
  1. Это не моё расширение. Я просто выложил его на этот форум, чтобы людям было удобнее его находить и скачивать.
  2. Для тех, у которых в требованиях написано, что оно нужно для их работы.
    Сейчас мало плагинов используют это расширение. Например, модуль ExStats GeoIP для Levels Ranks или GameEvents (который пока лишь для CS:S v34).
 

Paranoiiik

хачю клиентмод
Сообщения
2,047
Реакции
1,490
  • Автор ресурса
  • #6
Paranoiiik обновил(а) ресурс GeoIP2 новой записью:

  • Обновление баз до версии от 31 августа 2021 года
  • Убрал ссылку на GitHub, так как расширение давно вошло в состав SourceMod 1.11, и разработчик удалил или скрыл его репозиторий
 
Последнее редактирование:

GLUCK

Участник
Сообщения
82
Реакции
9
Всем доброго времени суток. Произошла такая проблема: Живу в Украине, город Ивано-Франковск, но почему-то отображается Русский флаг. Ранее года 1.5-2 назад менял страну в магазине, сейчас пришло время, что я страну поменял обратно на Украину, все поставилось и везде гривны, но почему-то отображается Русский флаг. Пожалуйста, помогите.
 

SAPSAN 隼

Не было б печали, если бы ключи мне дали!
Сообщения
820
Реакции
776
Всем доброго времени суток. Произошла такая проблема: Живу в Украине, город Ивано-Франковск, но почему-то отображается Русский флаг. Ранее года 1.5-2 назад менял страну в магазине, сейчас пришло время, что я страну поменял обратно на Украину, все поставилось и везде гривны, но почему-то отображается Русский флаг. Пожалуйста, помогите.
Скорее всего сервис бьёт не верно информацию по ip или возможно есть то чего мы не знаем
 
Последнее редактирование модератором:

БлагоЯр

Участник
Сообщения
898
Реакции
86
Конфиг куда кидать? в cfg или config?

И расширение и базы кинул, а в списке нет и ошибок тоже нет.
 
Последнее редактирование:

CTe6eJIeK_vRn

Участник
Сообщения
2,114
Реакции
1,867
Перекомпиленная версия из sm1.11. Работает на sm 1.10. Мне понадобился для плагина [TF2/Any?] SourceMod Smart FastDownloads - FastDL client routing by location! - AlliedModders. Да и этот плагин [Fork] Game Events+, переделать - 2 строчки.
Вывод языка:
C-подобный:
 * @param client        Client index in order to return the result in the player's language
 *                      -1: the default language, which is english.
 *                      0: the server language. You can use LANG_SERVER define.
 *                      >=1: the player's language.
 * @return              True on success, false otherwise.


C-подобный:
/**
 * @section IP addresses can contain ports, the ports will be stripped out.
 */

/**
 * Gets the two character country code from an IP address. (US, CA, etc)
 *
 * @param ip            Ip to determine the country code.
 * @param ccode         Destination string buffer to store the code.
 * @return              True on success, false otherwise.
 */
native bool GeoipCode2(const char[] ip, char ccode[3]);

/**
 * Gets the three character country code from an IP address. (USA, CAN, etc)
 *
 * @param ip            Ip to determine the country code.
 * @param ccode         Destination string buffer to store the code.
 * @return              True on success, false otherwise.
 */
native bool GeoipCode3(const char[] ip, char ccode[4]);

/**
 * Gets the region code with country code from an IP address. (US-IL, CH-CHE, etc)
 *
 * @param ip            Ip to determine the region code.
 * @param ccode         Destination string buffer to store the code.
 * @return              True on success, false otherwise.
 */
native bool GeoipRegionCode(const char[] ip, char ccode[12]);

/**
 * Gets the two character continent code from an IP address. (EU, AS, etc)
 *
 * @param ip            Ip to determine the continent code.
 * @param ccode         Destination string buffer to store the code.
 * @return              The continent id on success, 0 otherwise.
 */
native Continent GeoipContinentCode(const char[] ip, char ccode[3]);

/**
 * Gets the full country name.
 *
 * @param ip            Ip to determine the country code.
 * @param name          Destination string buffer to store the country name.
 * @param maxlength     Maximum length of output string buffer.
 * @return              True on success, false otherwise.
 */
native bool GeoipCountry(const char[] ip, char[] name, int maxlength);

/**
 * Gets the full country name.
 *
 * @param ip            Ip to determine the country code.
 * @param name          Destination string buffer to store the country name.
 * @param maxlength     Maximum length of output string buffer.
 * @param client        Client index in order to return the result in the player's language
 *                      -1: the default language, which is english.
 *                      0: the server language. You can use LANG_SERVER define.
 *                      >=1: the player's language.
 * @return              True on success, false otherwise.
 */
native bool GeoipCountryEx(const char[] ip, char[] name, int maxlength, int client = -1);

/**
 * Gets the full continent name.
 *
 * @param ip            Ip to determine the continent code.
 * @param name          Destination string buffer to store the continent name.
 * @param maxlength     Maximum length of output string buffer.
 * @param client        Client index in order to return the result in the player's language
 *                      -1: the default language, which is english.
 *                      0: the server language. You can use LANG_SERVER define.
 *                      >=1: the player's language.
 * @return              True on success, false otherwise.
 */
native bool GeoipContinent(const char[] ip, char[] name, int maxlength, int client = -1);

/**
 * Gets the full region name.
 *
 * @param ip            Ip to determine the region code.
 * @param name          Destination string buffer to store the region name.
 * @param maxlength     Maximum length of output string buffer.
 * @param client        Client index in order to return the result in the player's language
 *                      -1: the default language, which is english.
 *                      0: the server language. You can use LANG_SERVER define.
 *                      >=1: the player's language.
 * @return              True on success, false otherwise.
 */
native bool GeoipRegion(const char[] ip, char[] name, int maxlength, int client = -1);

/**
 * Gets the city name.
 *
 * @param ip            Ip to determine the city code.
 * @param name          Destination string buffer to store the city name.
 * @param maxlength     Maximum length of output string buffer.
 * @param client        Client index in order to return the result in the player's language
 *                      -1: the default language, which is english.
 *                      0: the server language. You can use LANG_SERVER define.
 *                      >=1: the player's language.
 * @return              True on success, false otherwise.
 */
native bool GeoipCity(const char[] ip, char[] name, int maxlength, int client = -1);

/**
 * Gets the timezone.
 *
 * @param ip            Ip to determine the timezone.
 * @param name          Destination string buffer to store the timezone.
 * @param maxlength     Maximum length of output string buffer.
 * @return              True on success, false otherwise.
 */
native bool GeoipTimezone(const char[] ip, char[] name, int maxlength);

/**
 * Gets the city's latitude
 *
 * @param ip            Ip to determine the city latitude.
 * @return              The result of the latitude, 0 if latitude is not found
 */
native float GeoipLatitude(const char[] ip);

/**
 * Gets the city's longitude
 *
 * @param ip            Ip to determine the city longitude.
 * @return              The result of the longitude, 0 if longitude is not found
 */
native float GeoipLongitude(const char[] ip);

/*
 * Calculate the distance between geographical coordinates, latitude and longitude.
 *
 * @param lat1          The first IP latitude.
 * @param lon1          The first IP longitude.
 * @param lat2          The second IP latitude.
 * @param lon2          The second IP longitude.
 * @param system        The system of measurement, 0 = Metric(kilometers) or 1 = English(miles).
 *
 * @return              The distance as result in specified system of measurement.
 */
native float GeoipDistance(float lat1, float lon1, float lat2, float lon2, int system = SYSTEM_METRIC);

/**
 * @endsection
 */

/**
 * Do not edit below this line!
 */
public Extension __ext_geoip2 =
{
    name = "GeoIP2",
    file = "geoip2.ext",
#if defined AUTOLOAD_EXTENSIONS
    autoload = 1,
#else
    autoload = 0,
#endif
#if defined REQUIRE_EXTENSIONS
    required = 1,
#else
    required = 0,
#endif
};

#if !defined REQUIRE_EXTENSIONS
public void __ext_geoip2_SetNTVOptional()
{
    MarkNativeAsOptional("GeoipCode2");
    MarkNativeAsOptional("GeoipCode3");
    MarkNativeAsOptional("GeoipRegionCode");
    MarkNativeAsOptional("GeoipContinentCode");
    MarkNativeAsOptional("GeoipCountry");
    MarkNativeAsOptional("GeoipCountryEx");
    MarkNativeAsOptional("GeoipContinent");
    MarkNativeAsOptional("GeoipRegion");
    MarkNativeAsOptional("GeoipCity");
    MarkNativeAsOptional("GeoipTimezone");
    MarkNativeAsOptional("GeoipLatitude");
    MarkNativeAsOptional("GeoipLongitude");
    MarkNativeAsOptional("GeoipDistance");
}
#endif
 

Вложения

  • GeoIP_1.1.3.7z
    214.5 КБ · Просмотры: 126
Последнее редактирование:

Nekro

Терра инкогнита
Сообщения
4,025
Реакции
2,260
И вот тут до меня дошло, что потёр сошку..
 
Последнее редактирование:

FuckYeah

Челик
Сообщения
474
Реакции
57
Где найти поддержку ua языка, или как самому сделать?
 

lifan

Участник
Сообщения
57
Реакции
19
Может кому то пригодиться свежая GeoLite2-City.mmdb
[GEOIP2] GeoIP2 database loaded: GeoLite2-City (2023-12-12 20:20:27 UTC)
 

Вложения

  • GeoLite2-City.zip
    29.8 МБ · Просмотры: 47
Сверху Снизу