SteamID Limiter by Mistrick | SQL QueryHandleCheckPlayer error

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
223
Реакции
146
Помог
4 раз(а)
Ошибка
SQL QueryHandleCheckPlayer error
ОС
Linux
Amx Mod X
AMX Mod X 1.10.0.5250 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Feb 11 2019 03:16:53
Built from: https://github.com/alliedmodders/amxmodx/commit/f623126
Build ID: 5250:f623126
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.668-dev
Build date: 06:03:17 Aug 8 2018 (1579)
Build from: https://github.com/s1lentq/rehlds/commit/b23f658
ReGamedll
ReGameDLL version: 5.7.0.312-dev
Build date: 07:53:34 May 31 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/26db32e
Версия Metamod
Metamod-r v1.3.0.127, API (5:13)
Metamod-r build: 10:49:17 Jun 15 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0fff979
Список метамодулей
description      stat pend  file                        vers            src  load  unload
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5250 ini Start ANY
[ 2] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 3] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 4] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 5] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 6] WHBlocker RUN - whblocker_mm_i386.so v1.5.695 ini Chlvl ANY
[ 7] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 8] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.8 ini Chlvl ANY
[ 9] MySQL RUN - mysql_amxx_i386.so v1.10.0.5250 pl1 ANY ANY
[10] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl1 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5250 pl1 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5250 pl1 ANY ANY
[13] ReAPI RUN - reapi_amxx_i386.so v5.6.0.159-dev pl1 ANY Never
[14] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5250 pl1 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.10.0.5250 pl1 ANY ANY
[16] Engine RUN - engine_amxx_i386.so v1.10.0.5250 pl1 ANY ANY
[17] Fun RUN - fun_amxx_i386.so v1.10.0.5250 pl1 ANY ANY
17 plugins, 17 running
Список плагинов
name                    version     author            file             status
[ 1] FreshBans 1.3.6 kanagava fresh_bans_136. running
[ 2] DopBan 3.0.3b kanagava dop_ban303_.amx running
[ 3] Fix fast download to r 0.0.3 PomanoB \ Bos93 FIxFastDL.amxx debug
[ 4] SteamID Limiter 0.4 Mistrick steamid_limiter running
[ 5] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 6] Rechecker Log 0.1 F@nt0M rc_log.amxx running
[ 7] Stop the Bastards 1.6.6 F@nt0M stop_the_bastar debug
[ 8] Admin Load 3.9.2 Dev F@nt0M adminload.amxx running
[ 9] Admin Commands Log 1.1 w0w admin_commands_ running
[ 10] CSStatsX SQL 0.7.4+1 serfreeman1337 csstatsx_sql.am running
[ 11] Online Helper 1.0.1 Nordic Warrior online_helper.a running
[ 12] Admin Commands 1.10.0.525 AMXX Dev Team admincmd.amxx running
[ 13] Slots Reservation 1.10.0.525 AMXX Dev Team adminslots.amxx running
[ 14] Menus Front-End 1.10.0.525 AMXX Dev Team menufront.amxx running
[ 15] Commands Menu 1.10.0.525 AMXX Dev Team cmdmenu.amxx running
[ 16] Players Menu 1.10.0.525 AMXX Dev Team plmenu.amxx running
[ 17] Maps Menu 1.10.0.525 AMXX Dev Team mapsmenu.amxx running
[ 18] Plugin Menu 1.10.0.525 AMXX Dev Team pluginmenu.amxx running
[ 19] Admin Chat 1.10.0.525 AMXX Dev Team adminchat.amxx running
[ 20] Anti Flood 1.10.0.525 AMXX Dev Team antiflood.amxx running
[ 21] Scrolling Message 1.10.0.525 AMXX Dev Team scrollmsg.amxx running
[ 22] Info. Messages 1.10.0.525 AMXX Dev Team imessage.amxx running
[ 23] Admin Votes 1.10.0.525 AMXX Dev Team adminvote.amxx running
[ 24] NextMap 1.10.0.525 AMXX Dev Team nextmap.amxx running
[ 25] TimeLeft 1.10.0.525 AMXX Dev Team timeleft.amxx running
[ 26] Pause Plugins 1.10.0.525 AMXX Dev Team pausecfg.amxx running
[ 27] Stats Configuration 1.10.0.525 AMXX Dev Team statscfg.amxx running
[ 28] Restrict Weapons 1.10.0.525 AMXX Dev Team restmenu.amxx running
[ 29] StatsX 1.10.0.525 AMXX Dev Team statsx.amxx running
[ 30] CS Misc. Stats 1.10.0.525 AMXX Dev Team miscstats.amxx running
[ 31] CS Stats Logging 1.10.0.525 AMXX Dev Team stats_logging.a running
[ 32] Auto Demo Recorder 2.2.1 F@nt0M demo_recorder.a running
[ 33] Mode 2x2 2.5re s1lent mode.amxx running
[ 34] Ping Checker 26.0.1 RC1 h1k3 ping_checker.am running
[ 35] CS AFK Manager 1.0.6 (amx Freeman afk_manager_1-8 running
[ 36] Online Logger 06.04.18 mx?! online_logger.a running
[ 37] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 38] ViP Player 1.2 Much Autors vip_csg_1.8.3.a running
[ 39] [ReAPI] Best player of 0.6 F@nt0M best_player_of_ running
[ 40] Flashbang Ban 0.2 mx?! flashbang_ban.a running
[ 41] Thunderbolt TK 24.11.2018 mx?! thunderbolt_tk. running
[ 42] Reset Score 0.0.2f wopox1337 ResetScore.amxx running
[ 43] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx running
[ 44] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 45] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 46] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 47] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 48] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 49] AES: Bonus CSTRIKE 0.5.9 [REA serfreeman1337/s aes_bonus_cstri running
[ 50] AES Bonus: Flags 0.2 Sonyx aes_bonus_flags running
[ 51] AES: StatsX 0.5 Vega serfreeman1337 aes_statsx_cstr running
[ 52] spec_hud_info 0.1 perf spec_hud_info.a running
[ 53] Map Manager: Core 3.0.0 Mistrick map_manager_cor running
[ 54] Map Manager: Scheduler 0.1.0 Mistrick map_manager_sch running
[ 55] Map Manager: Rtv 0.0.4 Mistrick map_manager_rtv running
[ 56] Map Manager: Nominatio 0.0.8 Mistrick map_manager_nom running
[ 57] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 58] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 59] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 60] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 61] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
61 plugins, 61 running
Автор плагина
0.4
Версия плагина
Mistrick
Исходный код
/**
* Credits: Safety1st for whitelist.
*/
#include <amxmodx>
#include <sqlx>

#define PLUGIN "SteamID Limiter"
#define VERSION "0.4"
#define AUTHOR "Mistrick"

#pragma semicolon 1

#define STEAMID_PER_IP 2
#define SAVE_LASTDAYS 1
#define REASON "Wrong SteamID"

//#define WHITELIST // uncomment to enable whitelist

#if defined WHITELIST
new const g_szWhiteList[][] =
{
"127.0.0.0/8", // loopback interface (usually assigned IP is 127.0.0.1)
"192.168.0.0/24" // 192.168.0.0/24 subnet, IPs range 192.168.0.0 ... 192.168.0.255
};
enum _:WhitelistData
{
NET_IP,
NET_MASK
};
new Array:g_aWhitelist;
#endif

new const DATABASE[] = "addons/amxmodx/data/steamidlimiter.db";

new Handle:g_Tuple, g_szQuery[256];

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
SQLite_Init();

#if defined WHITELIST
new eNetData[WhitelistData];
g_aWhitelist = ArrayCreate(WhitelistData);

for( new i; i < sizeof(g_szWhiteList); i++ )
{
net_to_long( g_szWhiteList[i], eNetData[NET_IP], eNetData[NET_MASK] );
ArrayPushArray( g_aWhitelist, eNetData );
}
#endif
}
SQLite_Init()
{
SQL_SetAffinity("sqlite");

if(!file_exists(DATABASE))
{
new file = fopen(DATABASE, "w");
if(!file)
{
new szMsg[128]; formatex(szMsg, charsmax(szMsg), "%s file not found and cant be created.", DATABASE);
set_fail_state(szMsg);
}
fclose(file);
}

g_Tuple = SQL_MakeDbTuple("", "", "", DATABASE, 0);

formatex(g_szQuery, charsmax(g_szQuery),
"CREATE TABLE IF NOT EXISTS `players`( \
id INTEGER PRIMARY KEY,\
ip TEXT NOT NULL, \
steamid TEXT NOT NULL,\
lastseen INTEGER)");
SQL_ThreadQuery(g_Tuple, "QueryHandleCreate", g_szQuery);

formatex(g_szQuery, charsmax(g_szQuery), "DELETE FROM `players` WHERE lastseen<%d", get_systime() - SAVE_LASTDAYS * 86400);
SQL_ThreadQuery(g_Tuple, "QueryHandleCreate", g_szQuery);
}
public QueryHandleCreate(failstate, Handle:query, error[], errnum, data[], size)
{
if(failstate != TQUERY_SUCCESS)
{
log_amx("SQL QueryHandleCreate error: %s", error);
}
}
public client_authorized(id)
{
if(is_user_steam(id) || is_user_bot(id) || is_user_hltv(id)) return;

new szPlayerIp[32]; get_user_ip(id, szPlayerIp, charsmax(szPlayerIp), 1);
new szPlayerSteamid[32]; get_user_authid(id, szPlayerSteamid, charsmax(szPlayerSteamid));

if(containi(szPlayerSteamid, "lan") != -1) return;

#if defined WHITELIST
new eNetData[WhitelistData];
for( new i; i < sizeof(g_szWhiteList); i++ )
{
ArrayGetArray( g_aWhitelist, i, eNetData );
if( eNetData[NET_IP] == ip_to_long(szPlayerIp) & eNetData[NET_MASK] ) return;
}
#endif

new data[1]; data[0] = id;
formatex(g_szQuery, charsmax(g_szQuery), "SELECT * FROM `players` WHERE ip='%s' LIMIT %d", szPlayerIp, STEAMID_PER_IP);
SQL_ThreadQuery(g_Tuple, "QueryHandleCheckPlayer", g_szQuery, data, sizeof(data));
}
public QueryHandleCheckPlayer(failstate, Handle:query, error[], errnum, data[], size)
{
if(failstate != TQUERY_SUCCESS)
{
log_amx("SQL QueryHandleCheckPlayer error: %s", error);
return;
}

new id = data[0];
new szPlayerIp[32]; get_user_ip(id, szPlayerIp, charsmax(szPlayerIp), 1);
new szPlayerSteamid[32]; get_user_authid(id, szPlayerSteamid, charsmax(szPlayerSteamid));

if(SQL_MoreResults(query))
{
new index = SQL_ReadResult(query, 0);
new szLoadedIp[32]; SQL_ReadResult(query, 1, szLoadedIp, charsmax(szLoadedIp));
new szLoadedSteamid[32]; SQL_ReadResult(query, 2, szLoadedSteamid, charsmax(szLoadedSteamid));

if(equali(szPlayerSteamid, szLoadedSteamid))
{
UpdatePlayer(index);
}
else
{
#if STEAMID_PER_IP == 1
server_cmd("kick #%d %s", get_user_userid(id), REASON);
#else
new count = 1;

SQL_NextRow(query);
while(SQL_MoreResults(query))
{
count++;
index = SQL_ReadResult(query, 0);
SQL_ReadResult(query, 1, szLoadedIp, charsmax(szLoadedIp));
SQL_ReadResult(query, 2, szLoadedSteamid, charsmax(szLoadedSteamid));

if(equali(szPlayerSteamid, szLoadedSteamid))
{
UpdatePlayer(index);
return;
}
else if(count == STEAMID_PER_IP)
{
server_cmd("kick #%d %s", get_user_userid(id), REASON);
return;
}

SQL_NextRow(query);
}
if(count < STEAMID_PER_IP)
{
InsertPlayer(szPlayerIp, szPlayerSteamid);
}
#endif
}
}
else
{
InsertPlayer(szPlayerIp, szPlayerSteamid);
}
}
InsertPlayer(szPlayerIp[], szPlayerSteamid[])
{
formatex(g_szQuery, charsmax(g_szQuery), "INSERT INTO `players`(ip, steamid, lastseen) VALUES ('%s', '%s', %d)", szPlayerIp, szPlayerSteamid, get_systime());
SQL_ThreadQuery(g_Tuple, "QueryHandleInsertPlayer", g_szQuery);
}
public QueryHandleInsertPlayer(failstate, Handle:query, error[], errnum, data[], size)
{
if(failstate != TQUERY_SUCCESS)
{
log_amx("SQL QueryHandleInsertPlayer error: %s", error);
}
}
UpdatePlayer(index)
{
formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `players` SET lastseen=%d WHERE id=%d", get_systime(), index);
SQL_ThreadQuery(g_Tuple, "QueryHandleUpdatePlayer", g_szQuery);
}
public QueryHandleUpdatePlayer(failstate, Handle:query, error[], errnum, data[], size)
{
if(failstate != TQUERY_SUCCESS)
{
log_amx("SQL QueryHandleUpdatePlayer error: %s", error);
}
}
stock bool:is_user_steam(id)
{
static dp_pointer;
if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
{
server_cmd("dp_clientinfo %d", id);
server_exec();
return (get_pcvar_num(dp_pointer) == 2) ? true : false;
}
return false;
}

/*-- Modified and simplified 'IP converter stocks' by Zetex --*/
// Gets net and mask as LONG from subnet.
stock net_to_long( net_string[], &net, &mask ) {
new i, ip[16];

i = copyc( ip, charsmax(ip), net_string, '/' );
mask = i ? cidr_to_long( net_string[i + 1] ) : 0xFFFFFFFF; /* mask /32, IP itself */

net = ip_to_long(ip) & mask;
}
// Converts mask to LONG. Returns unsigned long.
stock cidr_to_long( mask_string[] ) {
new mask = str_to_num(mask_string);
new result = (1 << 31) >> (mask - 1);

return result;
}
// Converts IP to LONG. Returns unsigned long.
stock ip_to_long( ip_string[] ) {
new right[16], part[4], octet, ip = 0;
strtok( ip_string, part, 3, right, 15, '.' );

for( new i = 0; i < 4; i++ ) {
octet = str_to_num(part);

ip += octet;

if( i == 3 )
break;

strtok( right, part, 3, right, 15, '.' );
ip = ip << 8;
}

return ip;
}
Лог ошибки:
Код:
L 04/02/2019 - 21:27:32: [steamid_limiter.amxx] SQL QueryHandleCheckPlayer error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
L 04/02/2019 - 21:29:59: [steamid_limiter.amxx] SQL QueryHandleCheckPlayer error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
L 04/02/2019 - 21:30:37: [steamid_limiter.amxx] SQL QueryHandleCheckPlayer error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
L 04/02/2019 - 21:30:42: [steamid_limiter.amxx] SQL QueryHandleCheckPlayer error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
L 04/02/2019 - 21:31:59: [steamid_limiter.amxx] SQL QueryHandleCheckPlayer error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
L 04/02/2019 - 21:32:32: [steamid_limiter.amxx] SQL QueryHandleCheckPlayer error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
5 Апр 2019
upd: Обновил amxx до last версии.
Проблема осталась.

Отключал все плагины, результат тотже:

Код:
L 04/05/2019 - 12:41:53: [steamid_limiter.amxx] SQL QueryHandleCreate error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
L 04/05/2019 - 12:41:53: [steamid_limiter.amxx] SQL QueryHandleCreate error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
223
Реакции
146
Помог
4 раз(а)
Mistrick, читал, но модуль sqlite, не включил.
Спасибо.

Решение:
Включить модуль sqlite.
 
Статус
В этой теме нельзя размещать новые ответы.

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

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