[Bypass Guard] Provider: iphub.info - ошибка API ключа

Статус
В этой теме нельзя размещать новые ответы.

Fi4

Сообщения
21
Реакции
0
Ошибка
L 09/07/2020 - 11:29:22: [Error] Can't get AS number for IP '78.85.49.100'
L 09/07/2020 - 11:29:22: HTTP status: 403
L 09/07/2020 - 11:29:22: Response body: {"error":"Invalid API key (1)"}
L 09/07/2020 - 11:29:22: [Error] Can't get proxy status for IP '78.85.49.100'
L 09/07/2020 - 11:29:22: [Check] 123 | 78.85.49.100:6437 | STEAM_1:0:1105557907 | N/A | N/A | RU | Russia
L 09/07/2020 - 11:29:22: Check fail flags: ab
L 09/07/2020 - 11:29:22: HTTP status: 403
L 09/07/2020 - 11:29:22: Response body: {"error":"Invalid API key (1)"}
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5271
Билд
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.696-dev
Build date: 18:46:47 May 18 2020 (2228)
ReGamedll
ReGameDLL version: 5.18.0.474-dev
Build date: 11:07:34 Jul 16 2020
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Список метамодулей
Currently loaded plugins:  
description stat pend file vers src load unload
[ 1] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92c ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 6] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5271 ini Start ANY
[ 7] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 8] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 9] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[10] GeoIP+ RUN - geoip_amxx_i386.so v1.3.0 pl6 ANY ANY
[11] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl6 ANY Never
[12] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[13] MySQL RUN - mysql_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[14] ReAPI RUN - reapi_amxx_i386.so v5.15.0.197-dev pl6 ANY Never
[15] gRIP RUN - grip_amxx_i386.so v0.1.5 Beta pl6 ANY ANY
[16] Fun RUN - fun_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[17] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[18] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[19] CSX RUN - csx_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[20] Engine RUN - engine_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
20 plugins, 20 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] FreshBans 1.4.3b kanagava fresh_bans_143_ running
[ 2] Admin Loader 3.5 neygomon admin_loader.am running
[ 3] [BG] Provider: iphub.i 0.5 mx?! bg_provider_iph running
[ 4] [BG] Provider: GeoIP 0.2 mx?! bg_provider_geo running
[ 5] Bypass Guard 1.0.1 mx?! bypass_guard.am running
[ 6] WalkGuard 1.3.4 mogel no_kill_zones_r debug
[ 7] Surf Shop 6.4 Fi4 cmd_shop.amxx running
[ 8] Remove Corpses 0.0.1 Vaqtincha remove_corpses. running
[ 9] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 10] ReChecker Logging 1.0 custom rc_logging.amxx running
[ 11] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 12] Map Manager: Sub Plugi 0.1 Mistrick mapmanager_subp running
[ 13] Ultimate Chats Control 5.2(c) neygomon ucc.amxx running
[ 14] unknown unknown unknown ucc_api_example running
[ 15] AntiReklama 1.1 Fi4 mat_warning.amx running
[ 16] mutebot 1.1 Nomad mutebot.amxx running
[ 17] Reklama 30.11.2018 mx?! reklama.amxx running
[ 18] Anti Flood 1.9.0.5271 AMXX Dev Team antiflood.amxx running
[ 19] Lite Translit 3.2 neygomon+Fi4 lite_translit.a running
[ 20] Keys 1.0 daywer rpg_key.amxx running
[ 21] Team Balance Control 1.3.9 gyxoBka TeamBalanceCont running
[ 22] Trigger_find 1.0 Fi4 Trigger_find.am running
[ 23] FreeSurf_2 3.3 Fi4 freesurf.amxx debug
[ 24] Knife Selector 2.2 ReymonARG knife_selector. debug
[ 25] Restrict Weapons 1.9.0.5249 AMXX Dev Team restmenu.amxx running
[ 26] Same ID 0.1b Rafa steamid.amxx running
[ 27] Reset_Score 1.0 9 rpamm!? resetscore.amxx running
[ 28] Magic Marker 3.1 stupok69 magic_marker.am running
[ 29] unknown unknown unknown goldtransfer.am running
[ 30] Grab+ 1.2.3 Ian Cammarata jb_grab.amxx running
[ 31] Mega-Jetpack 1.7 Fi4 surf_jetpack1.a running
[ 32] Online Logger 06.04.18 mx?! online_logger.a running
[ 33] Menus 3.8 Fi4 cmd_menu.amxx running
[ 34] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx running
[ 35] Multi-Lingual System 1.9.0.5271 AMXX Dev Team multilingual.am running
[ 36] AmxModMenu 1.5 Fi4 menufront.amxx running
[ 37] Commands Menu 1.9.0.5271 AMXX Dev Team cmdmenu.amxx running
[ 38] Players Menu 1.9.0.5271 AMXX Dev Team plmenu_ab_base. running
[ 39] Maps Menu 1.9.0.5271 AMXX Dev Team mapsmenu.amxx running
[ 40] Admin Chat 1.9.0.5271 AMXX Dev Team adminchat.amxx running
[ 41] Admin Votes 1.9.0.5271 Wildness Team adminvote.amxx running
[ 42] Pause Plugins 1.9.0.5271 AMXX Dev Team pausecfg.amxx running
[ 43] CS Misc. Stats 1.9.0.5271 AMXX Dev Team miscstats.amxx running
[ 44] StatsX (MastaMan Editi 1.8.1.3746 AMXX Dev Team & statsx_shell.am running
[ 45] Stats Configuration 1.9.0.5249 AMXX Dev Team statscfg.amxx running
[ 46] Damager 1.0 Prayer damager.amxx running
[ 47] get_user_info 0.0.1 holy new_hook.amxx running
[ 48] Entity Remover 0.4 Exolent entity_remover. running
[ 49] Custom Models 1.3.2 neugomon custom_models.a running
[ 50] Lite Admin ESP 1.0 neygomon admin_esp.amxx running
[ 51] Demo Recorder 2.4.0 F@nt0M demo_recorder.a running
[ 52] [SISA] Epic Sky Admin 1.9 Fi4 ss_admin_system running
[ 53] unknown unknown unknown say_adminka_sur running
[ 54] HudTextArgs Blocker 1.1 joaquimandrade HUD.amxx running
[ 55] Steam Bonus new 1.4 Stimul/ghostride New_Steam_bonus running
[ 56] AFK Control 1.4.1 [Rnd neygomon afk_time.amxx running
[ 57] Spawn Protection 7.0 Peli spawnprotection running
[ 58] Block 'Fire in the hol 0.1 Safety1st block_fire_in_t running
[ 59] SpecList 1.3 Fi4 speclist_rus.am running
[ 60] Bad nick 1.1 pike Bad_nick.amxx running
[ 61] Anti Double AuthID 0.2 Fintok! sameid.amxx running
[ 62] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 63] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 64] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 65] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 66] ss2: Rules Watcher 1.1 xPaw surf_ski_2_rule running
[ 67] surf_ski_2 Jail remove 1.0 xPaw surf_ski_2_jail running
[ 68] ss2: Rules Watcher1 1.1.1 xPaw || Fi4 surf_ski_2_rule running
68 plugins, 68 running
Автор плагина
BlackSignature
Версия плагина
0.5
Исходный код
/*
Данный плагин является модулем-провайдером информации для основного плагина (ядра), - Bypass Guard.
Данный плагин может как предоставлять AS-номер, так и проверять IP-адрес на proxy/VPN (регулируется кварами).

Используемый сервис: https://iphub.info/ (требуется регистрация; вход через прокси, если не открывается)
Описание API: https://iphub.info/api

Плюсы:
* Высокий уровень точности проверки на proxy/VPN
* Возможность задать несколько ключей

Минусы:
* Необходима регистрация
* Зачастую невнятное описание провайдера при получении AS-номера

Использование:
1) Зарегистрируйтесь на сервисе и получите бесплатный ключ (используйте прокси, если сайт не открывается)
2) Пропишите ключ (на новой строке) в конфиг 'iphub_api_keys.ini'
3) Запустите плагин
4) Отредактируйте квары плагина в конфиге в 'configs/plugins'
5) Смените карту, чтобы новые значения кваров вступили в силу
*/

/* История обновлений:
0.1 (17.09.2019):
* Открытый релиз
0.2 (20.09.2019):
* Исправление логики переключения между несколькими API-ключами
0.3 (27.09.2019):
* Исправление логики получения AS-номеров (вайтлист/блеклист AS не работал)
0.4 (26.10.2019):
* Улучшение логики работы с несколькими ключами
0.5 (28.12.2019):
* Улучшение логики работы с несколькими ключами (thx Rey)
*/

new const PLUGIN_VERSION[] = "0.5"

/* ----------------------- */

#define AUTO_CFG // Создавать конфиг с кварами в 'configs/plugins', и запускать его ?

const MAX_KEYS = 2 // Макс. кол-во API-ключей. Увеличить при необходимости.

new const KEY_FILE_NAME[] = "iphub_api_keys.ini"

/* ----------------------- */

#include <amxmodx>
#include <grip>
#include <bypass_guard>

#define chx charsmax
#define chx_len(%0) charsmax(%0) - iLen

#define MAX_API_KEY_LEN 64

enum _:CHECK_TYPE_ENUM {
CHECK_TYPE__AS,
CHECK_TYPE__PROXY
}

enum _:CHECK_EXT_DATA_STRUCT {
CHECK_EXT_DATA__TYPE,
CHECK_EXT_DATA__CHECK_TRIES,
CHECK_EXT_DATA__PLAYER_USERID,
CHECK_EXT_DATA__IP[MAX_IP_LENGTH],
CHECK_EXT_DATA__KEY_NUMBER
}

enum _:CHECK_CACHE_DATA_STRUCT {
CHECK_CACHE__AS[MAX_AS_LEN],
CHECK_CACHE__DESC[MAX_DESC_LEN],
bool:CHECK_CACHE__IS_PROXY
}

enum _:CVAR_ENUM {
CVAR__USE_FOR_AS,
CVAR__USE_FOR_PROXY,
CVAR__BAN_SUSPICIOUS,
CVAR__CURRENT_KEY
}

new g_eCvar[CVAR_ENUM]
new bool:g_bPluginEnded
new Trie:g_tCheckExtData
new Trie:g_tCheckCache
new g_szApiKey[MAX_KEYS][MAX_API_KEY_LEN]
new g_iLoadedKeys
new g_pCvarCurrKey

/* ----------------------- */

public plugin_init() {
register_plugin("[BG] Provider: iphub.info", PLUGIN_VERSION, "mx?!")

g_tCheckExtData = TrieCreate()
g_tCheckCache = TrieCreate()

bind_pcvar_num( create_cvar("bg_iphub_use_for_as", "1",
.description = "Use this provider for getting AS number?^n\
Set this cvar to 0 if you use another plugin for that purpose"),
g_eCvar[CVAR__USE_FOR_AS]
);

bind_pcvar_num( create_cvar("bg_iphub_use_for_proxy", "1",
.description = "Use this provider for proxy status checking?^n\
Set this cvar to 0 if you use another plugin for that purpose"),
g_eCvar[CVAR__USE_FOR_PROXY]
);

bind_pcvar_num( create_cvar("bg_iphub_ban_suspicious", "0",
.description = "Count suspicious IPs as proxy (can bring false detections)?^n\
Has no effect if 'bg_iphub_use_for_proxy' is set to 0"),
g_eCvar[CVAR__BAN_SUSPICIOUS]
);

#if defined AUTO_CFG
AutoExecConfig()
#endif

/* --- */

g_pCvarCurrKey = get_cvar_pointer("_bg_iphub_current_key")

if(g_pCvarCurrKey) {
bind_pcvar_num(g_pCvarCurrKey, g_eCvar[CVAR__CURRENT_KEY])
}

/* --- */

func_LoadApiKeys()
}

/* ----------------------- */

public OnConfigsExecuted() {
if(g_pCvarCurrKey) {
return
}

g_pCvarCurrKey = create_cvar("_bg_iphub_current_key", "0", .description = "Utility, don't touch!")
bind_pcvar_num(g_pCvarCurrKey, g_eCvar[CVAR__CURRENT_KEY])
}

/* ----------------------- */

public BypassGuard_RequestAsInfo(pPlayer, szIP[], iMaxTries) {
if(!g_eCvar[CVAR__USE_FOR_AS]) {
return PLUGIN_CONTINUE
}

new eCheckCache[CHECK_CACHE_DATA_STRUCT]

// NOTE: 'bg_get_as_by_ip' command depends on this cache (instant return), see main plugin
if(TrieGetArray(g_tCheckCache, szIP, eCheckCache, sizeof(eCheckCache))) {
BypassGuard_SendAsInfo( pPlayer, eCheckCache[CHECK_CACHE__AS],
eCheckCache[CHECK_CACHE__DESC], .bSuccess = true );

return PLUGIN_HANDLED
}

func_MakeRequest(pPlayer, szIP, iMaxTries, CHECK_TYPE__AS)
return PLUGIN_HANDLED
}

/* ----------------------- */

public BypassGuard_RequestProxyStatus(pPlayer, szIP[], iMaxTries) {
if(!g_eCvar[CVAR__USE_FOR_PROXY]) {
return PLUGIN_CONTINUE
}

new eCheckCache[CHECK_CACHE_DATA_STRUCT]

// NOTE: 'bg_check_ip' command depends on this cache (instant return), see main plugin
if(TrieGetArray(g_tCheckCache, szIP, eCheckCache, sizeof(eCheckCache))) {
BypassGuard_SendProxyStatus(pPlayer, eCheckCache[CHECK_CACHE__IS_PROXY], .bSuccess = true)
return PLUGIN_HANDLED
}

func_MakeRequest(pPlayer, szIP, iMaxTries, CHECK_TYPE__PROXY)
return PLUGIN_HANDLED
}

/* ----------------------- */

func_MakeRequest(pPlayer, szIP[], iMaxTries, iCheckType) {
new iDataID = func_GetCheckID()

new eExtData[CHECK_EXT_DATA_STRUCT]

new iCurrentKey = func_GetCurrentKey()

eExtData[CHECK_EXT_DATA__TYPE] = iCheckType
eExtData[CHECK_EXT_DATA__CHECK_TRIES] = iMaxTries
eExtData[CHECK_EXT_DATA__PLAYER_USERID] = get_user_userid(pPlayer) // return 0 if out of range
copy(eExtData[CHECK_EXT_DATA__IP], MAX_IP_LENGTH - 1, szIP)
eExtData[CHECK_EXT_DATA__KEY_NUMBER] = iCurrentKey

TrieSetArray(g_tCheckExtData, fmt("%i", iDataID), eExtData, sizeof(eExtData))

new GripRequestOptions:hRequestOptions = grip_create_default_options(.timeout = -1.0)

grip_options_add_header(hRequestOptions, "X-Key", g_szApiKey[iCurrentKey])

grip_request( fmt("http://v2.api.iphub.info/ip/%s", szIP),
Empty_GripBody, GripRequestTypeGet, "OnCheckComplete", hRequestOptions, iDataID );

grip_destroy_options(hRequestOptions)
}

/* ----------------------- */

func_GetCheckID() {
new iDataID

do {
iDataID = random_num(0, 10000)
}
while(TrieKeyExists(g_tCheckExtData, fmt("%i", iDataID)))

return iDataID
}

/* -------------------- */

public OnCheckComplete(iDataID) {
if(g_bPluginEnded) {
return
}

new eExtData[CHECK_EXT_DATA_STRUCT]

if(!TrieGetArray(g_tCheckExtData, fmt("%i", iDataID), eExtData, sizeof(eExtData))) {
BypassGuard_LogError( fmt("[Error] Can't find data for check with id %i", iDataID) )
return
}

TrieDeleteKey(g_tCheckExtData, fmt("%i", iDataID))

new pPlayer = find_player("k", eExtData[CHECK_EXT_DATA__PLAYER_USERID])

func_AgregateCheckResponse(pPlayer, iDataID, eExtData)
}

/* -------------------- */

func_AgregateCheckResponse(pPlayer, iDataID, eExtData[CHECK_EXT_DATA_STRUCT]) {
new szBuffer[MAX_RESPONSE_LEN]

new GripResponseState:iResponseState = grip_get_response_state()

if(iResponseState != GripResponseStateSuccessful) {
if(func_TryRetry(pPlayer, eExtData, iDataID)) {
return
}

BypassGuard_LogError( fmt("Response state: %i", iResponseState) )

if(iResponseState == GripResponseStateError && grip_get_error_description(szBuffer, chx(szBuffer))) {
BypassGuard_LogError( fmt("%s", szBuffer) )
}

return
}

new GripHTTPStatus:iHttpStatus = grip_get_response_status_code()

if(iHttpStatus != GripHTTPStatusOk) {
/* {
"code":"TooManyRequests",
"message":"You've exceeded your rate limit of 1000 request(s) per 86400 second(s)."
} */
if(
iHttpStatus == GripHTTPStatusTooManyRequests
&&
eExtData[CHECK_EXT_DATA__KEY_NUMBER] == g_eCvar[CVAR__CURRENT_KEY]
) {
func_TrySwitchToNextKey()
}

if(func_TryRetry(pPlayer, eExtData, iDataID)) {
return
}

BypassGuard_LogError( fmt("HTTP status: %i", iHttpStatus) )

if(grip_get_response_body_string(szBuffer, chx(szBuffer))) {
BypassGuard_LogError( fmt("Response body: %s", szBuffer) )
}

return
}

new GripJSONValue:hResponceBody = grip_json_parse_response_body(szBuffer, chx(szBuffer))

if(hResponceBody == Invalid_GripJSONValue) {
if(func_TryRetry(pPlayer, eExtData, iDataID)) {
return
}

if(szBuffer[0]) {
BypassGuard_LogError( fmt("Error text: %s", szBuffer) )
}

if(grip_get_response_body_string(szBuffer, chx(szBuffer))) {
BypassGuard_LogError( fmt("Response body: %s", szBuffer) )
}

return
}

new eCheckCache[CHECK_CACHE_DATA_STRUCT]

new GripJSONValue:hAsNumber = grip_json_object_get_value(hResponceBody, "asn")
new iAsNumber = grip_json_get_number(hAsNumber)
grip_destroy_json_value(hAsNumber)
formatex(eCheckCache[CHECK_CACHE__AS], MAX_AS_LEN - 1, "AS%i", iAsNumber)

new GripJSONValue:hIsp = grip_json_object_get_value(hResponceBody, "isp")
grip_json_get_string(hIsp, eCheckCache[CHECK_CACHE__DESC], MAX_DESC_LEN - 1)
grip_destroy_json_value(hIsp)

new GripJSONValue:hProxy = grip_json_object_get_value(hResponceBody, "block")
new iProxy = grip_json_get_number(hProxy)
grip_destroy_json_value(hProxy)

if(iProxy == 1 || (g_eCvar[CVAR__BAN_SUSPICIOUS] && iProxy == 2)) {
eCheckCache[CHECK_CACHE__IS_PROXY] = true
}

TrieSetArray(g_tCheckCache, eExtData[CHECK_EXT_DATA__IP], eCheckCache, sizeof(eCheckCache))

grip_destroy_json_value(hResponceBody)

if(pPlayer) {
if(eExtData[CHECK_EXT_DATA__TYPE] == CHECK_TYPE__AS) {
BypassGuard_SendAsInfo( pPlayer, eCheckCache[CHECK_CACHE__AS],
eCheckCache[CHECK_CACHE__DESC], .bSuccess = true );
}
else { // CHECK_TYPE__PROXY
BypassGuard_SendProxyStatus(pPlayer, eCheckCache[CHECK_CACHE__IS_PROXY], .bSuccess = true)
}
}
}

/* -------------------- */

bool:func_TryRetry(pPlayer, eExtData[CHECK_EXT_DATA_STRUCT], iDataID) {
static const szCheckType[CHECK_TYPE_ENUM][] = {
"AS number",
"proxy status"
}

if(!pPlayer || --eExtData[CHECK_EXT_DATA__CHECK_TRIES] == 0) {
BypassGuard_LogError( fmt( "[Error] Can't get %s for IP '%s'",
szCheckType[ eExtData[CHECK_EXT_DATA__TYPE] ], eExtData[CHECK_EXT_DATA__IP] ) );

if(pPlayer) {
if(eExtData[CHECK_EXT_DATA__TYPE] == CHECK_TYPE__AS) {
BypassGuard_SendAsInfo(pPlayer, .szAsNumber = "", .szDesc = "", .bSuccess = false)
}
else { // CHECK_TYPE__PROXY
BypassGuard_SendProxyStatus(pPlayer, .IsProxy = false, .bSuccess = false)
}
}

return false

}

// else ->

new iCurrentKey = func_GetCurrentKey()

eExtData[CHECK_EXT_DATA__KEY_NUMBER] = iCurrentKey

TrieSetArray(g_tCheckExtData, fmt("%i", iDataID), eExtData, sizeof(eExtData))

new GripRequestOptions:hRequestOptions = grip_create_default_options(.timeout = -1.0)

grip_options_add_header(hRequestOptions, "X-Key", g_szApiKey[iCurrentKey])

grip_request( fmt("http://v2.api.iphub.info/ip/%s", eExtData[CHECK_EXT_DATA__IP]),
Empty_GripBody, GripRequestTypeGet, "OnCheckComplete", hRequestOptions, iDataID );

grip_destroy_options(hRequestOptions)

return true
}

/* ----------------------- */

func_GetCurrentKey() {
if(!g_pCvarCurrKey) {
return 0
}

if(g_eCvar[CVAR__CURRENT_KEY] >= g_iLoadedKeys) {
set_pcvar_num(g_pCvarCurrKey, 0)
return 0
}

return g_eCvar[CVAR__CURRENT_KEY]
}

/* ----------------------- */

func_TrySwitchToNextKey() {
if(g_pCvarCurrKey && g_iLoadedKeys > 1) {
new iCurrentKey = g_eCvar[CVAR__CURRENT_KEY]
new iNewKey

if(iCurrentKey < g_iLoadedKeys - 1) {
iNewKey = iCurrentKey + 1
set_pcvar_num(g_pCvarCurrKey, iNewKey)
}
else {
set_pcvar_num(g_pCvarCurrKey, 0)
}

BypassGuard_LogError( fmt( "[Error] Request limit for API key '%i', switching to API key '%i' of '%i'",
iCurrentKey + 1, iNewKey + 1, g_iLoadedKeys ) );
}
else {
BypassGuard_LogError( fmt("[Error] Request limit reached, and no more available API keys!") )
}
}

/* ----------------------- */

func_LoadApiKeys() {
new szFolderName[32]
BypassGuard_GetPluginFolderName(szFolderName, chx(szFolderName))

new szPath[PLATFORM_MAX_PATH]
new iLen = get_localinfo("amxx_configsdir", szPath, chx(szPath))
formatex(szPath[iLen], chx_len(szPath), "/%s/%s", szFolderName, KEY_FILE_NAME)

new hFile = fopen(szPath, "r")

if(!hFile) {
if(file_exists(szPath)) {
BypassGuard_LogError( fmt("[Error] Can't open existing '%s'", KEY_FILE_NAME) )
return
}

hFile = fopen(szPath, "w")

if(!hFile) {
BypassGuard_LogError( fmt("[Error] Can't create default '%s'", KEY_FILE_NAME) )
return
}

fputs( hFile,
"; Ключи к API iphub'а. Зарегистрируйтесь на https://iphub.info/ , получите бесплатный ключ (1000 проверок/сутки), и введите его сюда^n\
; При необходимости вы можете указать несколько ключей (по 1 ключу на строку)^n\
; API-keys for iphub. Register at https://iphub.info/ , get free key (1000 checks/day), and set it here^n\
; You can set multiple keys if you need to (1 key per row)"
);

fclose(hFile)
return
}

new szBuffer[MAX_API_KEY_LEN + 8]

while(!feof(hFile)) {
if(g_iLoadedKeys == MAX_KEYS) {
BypassGuard_LogError( fmt("[Error] Keys limit reached! Increase 'MAX_KEYS' in .sma !") )
break
}

fgets(hFile, szBuffer, chx(szBuffer))
trim(szBuffer)

if(szBuffer[0] == ';' || !szBuffer[0]) {
continue
}

copy(g_szApiKey[g_iLoadedKeys++], MAX_API_KEY_LEN - 1, szBuffer)
}

fclose(hFile)
}

/* ----------------------- */

public plugin_end() {
g_bPluginEnded = true

if(g_tCheckExtData) {
TrieDestroy(g_tCheckExtData)
TrieDestroy(g_tCheckCache)
}
}
Установил dev-cs.ru/resources/649, поставил [Bypass Guard] Provider: iphub.info 0.5, ввел ключи, после чего при подключении нон-стим игроков вылазила ошибка и их кикало (после перенастройки их не кикает, но ошибка вылазит)

MTAzNTY6M2diMXZ2bXh0Z0JTRHBpSVBLcHowTU45b050enl6eTc==
MTAzNTc6bzU5M1h2YWlBUTZLQUZueEFuRzM0MXAwU3Nic0FjTjc=


В обсуждении под dev-cs.ru/resources/853 уже попытался помочь добрый present, но ошибка осталась, помогите.

Заранее спасибо всем!
 
В этой теме было размещено решение! Перейти к решению.
Последнее редактирование:
Сообщения
1,304
Реакции
2,303
Помог
57 раз(а)

Вложения

Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу