From 3609e065f6dac5124ac88a4703af78ea5e03c6c5 Mon Sep 17 00:00:00 2001 From: gsd Date: Wed, 6 Mar 2024 17:45:24 +0300 Subject: [PATCH] =?UTF-8?q?=D1=85=D1=83=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FSB_BanSystem/fsb.sp | 61 +++++- FSB_BanSystem/modules/bans.sp | 4 + FSB_BanSystem/modules/killfeed.sp | 61 ++++++ FSB_BanSystem/modules/messages.sp | 78 ++++++++ FSB_BanSystem/plugins/killfeed.smx | Bin 0 -> 3884 bytes FSB_BanSystem/plugins/messages.smx | Bin 0 -> 3426 bytes PipeRemover/pipe_remover.sp | 32 ++++ TradeBlocker.sp | 103 ++++++++++ plugins/fsb.smx | Bin 0 -> 14740 bytes plugins/pipe_remover.smx | Bin 0 -> 3214 bytes sql_userconnections.sp | 294 +++++++++++++++++++++++++++++ 11 files changed, 629 insertions(+), 4 deletions(-) create mode 100644 FSB_BanSystem/modules/killfeed.sp create mode 100644 FSB_BanSystem/modules/messages.sp create mode 100644 FSB_BanSystem/plugins/killfeed.smx create mode 100644 FSB_BanSystem/plugins/messages.smx create mode 100644 PipeRemover/pipe_remover.sp create mode 100644 TradeBlocker.sp create mode 100644 plugins/fsb.smx create mode 100644 plugins/pipe_remover.smx create mode 100644 sql_userconnections.sp diff --git a/FSB_BanSystem/fsb.sp b/FSB_BanSystem/fsb.sp index 1ea2497..6a7d3e5 100644 --- a/FSB_BanSystem/fsb.sp +++ b/FSB_BanSystem/fsb.sp @@ -1,7 +1,10 @@ #include #define _ban_module -//#define _mute_module +#define _message_module +#define _mute_module +#define _killfeed_module + //#define _steam_backend #if defined _ban_module @@ -12,7 +15,16 @@ #include "modules/mutes.sp" #endif -#define PLUGIN_VERSION "2.0" +#if defined _message_module +#include "modules/messages.sp" +#endif + +#if defined _killfeed_module +#include "modules/killfeed.sp" +#endif + + +#define PLUGIN_VERSION "3.0" public Plugin:myinfo = { name = "Facti13 System Browser", author = "gsd", @@ -22,19 +34,52 @@ public Plugin:myinfo = { }; char g_Database_Name[32] = "sql_bans"; -char g_MainChatPrefix[32] = "[FSB]" +char g_MainChatPrefix[32] = "[FSB]"; +Handle g_server_id_convar = INVALID_HANDLE; //MAIN public OnPluginStart() { + g_server_id_convar = CreateConVar("sm_fsb_server_id", "", "fsb server id"); LoadConfig(); SetupDB(); #if defined _mute_module - MuteSetup() + MuteSetup(); + #endif + + #if defined _message_module + MessageSetup(); + #endif + + #if defined _killfeed_module + KillfeedSetup(); #endif RegAdminCmd("sm_fsb_reload", COMMAND_ReloadCfg, ADMFLAG_ROOT); + HookConVarChange(g_server_id_convar, OnServerIdChanged); +} + +public OnServerIdChanged(Handle:cvar, const String:oldVal[], const String:newVal[]) { + #if defined _message_module + messagesSetServerId(newVal, 32); + #endif + #if defined _killfeed_module + killfeedSetServerId(newVal, 32); + #endif +} + +public OnMapStart() { + char server_id[32]; + GetConVarString(g_server_id_convar, server_id, sizeof(server_id)); + #if defined _message_module + messagesSetServerId(server_id, 32); + #endif + #if defined _killfeed_module + killfeedSetServerId(server_id, 32); + #endif + if (strlen(server_id) == 0) + LogError("sm_fsb_server_id is not setted"); } public OnPluginEnd() { @@ -78,6 +123,14 @@ public GotDatabase(Handle:owner, Handle:hndl, const String:error[], any:data) { #if defined _mute_module g_hMuteDatabase = hndl; #endif + /////////////////////////////// + #if defined _message_module + g_hMessageDatabase = hndl; + #endif + /////////////////////////////// + #if defined _killfeed_module + g_hKillfeedDatabase = hndl; + #endif } } diff --git a/FSB_BanSystem/modules/bans.sp b/FSB_BanSystem/modules/bans.sp index 0fcdae2..531ecec 100644 --- a/FSB_BanSystem/modules/bans.sp +++ b/FSB_BanSystem/modules/bans.sp @@ -226,6 +226,10 @@ public Callback_Unban(Handle:owner, Handle:hndl, const String:error[], any:data) //ACTIONS public Action:OnBanClient(int client, int time, int flags, const String:reason[], const String:kick_message[], const String:command[], any:admin) { + if (client == 0) { + ReplyToCommand(client, "Cannot ban from RCON"); + return Plugin_Stop; + } char Query[512]; char QueryPayload[11][256]; /* 0/5 - Client SteamID diff --git a/FSB_BanSystem/modules/killfeed.sp b/FSB_BanSystem/modules/killfeed.sp new file mode 100644 index 0000000..0973ada --- /dev/null +++ b/FSB_BanSystem/modules/killfeed.sp @@ -0,0 +1,61 @@ +#include + +char g_KillfeedChatPrefix[16] = "[FSB.Message]"; +char g_KillfeedTableName[32] = "user_killfeed"; + +char g_SQL_QUERY_ADDKILL[512] = "INSERT INTO `%s` (`attacker_id`, `victim_id`, `assister_id`, `utime`, `weapon_name`, `weapon_id`, `weapon_classname`, `weapon_index`, `custom_kill`, `crit_type`, `server_id`) VALUES ('%d', '%d', '%d', '%d', '%s', '%d', '%s', '%d', '%d', '%d', '%s')"; + +Handle g_hKillfeedDatabase = INVALID_HANDLE; +char g_kf_server_id[32] = ""; + +stock KillfeedSetup(){ + HookEvent("player_death", Event_PlayerDeath, EventHookMode_Post); +} + +stock killfeedSetServerId(const char[] server_id, int size) { + strcopy(g_kf_server_id, size, server_id); + PrintToServer("%s server id is setted: %s", g_KillfeedChatPrefix, g_kf_server_id) +} + +public CallBack_AddKill(Handle:owner, Handle:hndl, const String:error[], any:data) { + if (hndl == INVALID_HANDLE) { + LogError("%s Query failed! %s", g_KillfeedChatPrefix, error); + return; + } +} + +stock void AddKill(int victim_id, int attacked_id, int assister_id, + const String:weapon_name[], int weapon_id, const String:weapon_classname[], + int weapon_index, int custom_kill, int crit_type) { + char Query[512]; + Format(Query, sizeof(Query), g_SQL_QUERY_ADDKILL, g_KillfeedTableName, + attacked_id, victim_id, assister_id, + GetTime(), weapon_name, weapon_id, weapon_classname, weapon_index, + custom_kill, crit_type, g_kf_server_id); + SQL_TQuery(g_hKillfeedDatabase, CallBack_AddKill, Query, 0); +} + +public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast) { + //user data + int victim_id = GetEventInt(event, "userid"); //user ID who died + if (victim_id > 0) victim_id = GetSteamAccountID(GetClientOfUserId(victim_id), true); + + int attacker_id = GetEventInt(event, "attacker"); //user ID who killed + if (attacker_id > 0) attacker_id = GetSteamAccountID(GetClientOfUserId(attacker_id), true); + + int assister_id = GetEventInt(event, "assister"); //user ID of assister + if (assister_id > 0) assister_id = GetSteamAccountID(GetClientOfUserId(assister_id), true); + //weapon data + char weapon_name[64]; + GetEventString(event, "weapon", weapon_name, sizeof(weapon_name)); //weapon name killer used + int weapon_id = GetEventInt(event, "weaponid"); //ID of weapon killed used + char weapon_classname[64]; + GetEventString(event, "weapon_logclassname", weapon_classname, sizeof(weapon_classname)); //weapon name that should be printed on the log + int weapon_index = GetEventInt(event, "weapon_def_index"); //item def index of weapon killer used + //death data + int custom_kill = GetEventInt(event, "customkill");//type of custom kill + int crit_type = GetEventInt(event, "crit_type");//Crit type of kill. (0: None, 1: Mini, 2: Full) + + AddKill(victim_id, attacker_id, assister_id, weapon_name, weapon_id, weapon_classname, weapon_index, custom_kill, crit_type); + return Plugin_Continue; +} \ No newline at end of file diff --git a/FSB_BanSystem/modules/messages.sp b/FSB_BanSystem/modules/messages.sp new file mode 100644 index 0000000..ded2b15 --- /dev/null +++ b/FSB_BanSystem/modules/messages.sp @@ -0,0 +1,78 @@ +#include + +char g_MessageChatPrefix[16] = "[FSB.Message]"; +char g_MessageTableName[32] = "user_messages"; + +char g_SQL_QUERY_ADDMESSAGE[512] = "INSERT INTO `%s` (`account_id`, `utime`, `message`, `server_id`) VALUES ('%d', '%d', '%s', '%s')"; + +Handle g_hMessageDatabase = INVALID_HANDLE; +char g_messages_server_id[32] = ""; + +stock messagesSetServerId(const char[] server_id, int size) { + strcopy(g_messages_server_id, size, server_id); + PrintToServer("%s server id is setted: %s", g_MessageChatPrefix, g_messages_server_id) +} + +stock MessageSetup(){ + RegConsoleCmd("say", SayHook); + RegConsoleCmd("say_team", SayHook); +} + + +stock bool MessageTable_VerifyTable(const char[] database_name, const char[] table_name){ + char error[255], query[2048]; + new db = SQL_Connect(database_name, true, error, sizeof(error)); + if (db == INVALID_HANDLE) { + LogError("%s Cannot connect to Database: %s", g_MessageChatPrefix, database_name); + return false; + } + + Format(query, sizeof(query), "%s%s%s%s%s%s%s%s", + "CREATE TABLE IF NOT EXISTS `", + g_MessageTableName, + "`id` int(11) NOT NULL," + "`account_id` int(11) NOT NULL," + "`utime` bigint(20) NOT NULL," + "`message` varchar(512) NOT NULL," + "`server_id` varchar(32) NOT NULL" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;"); + + bool success = SQL_FastQuery(db, query); + if(!success) { + SQL_GetError(db, error, sizeof(error)); + LogError("%s [ERROR] Unable to verify %s table:%s", g_MessageChatPrefix, g_MessageTableName, query); + LogError("%s [ERROR] %s", g_MessageChatPrefix, error); + } + + CloseHandle(db); + return true; + } + +stock void AddMessage(int account_id, const String:message[]) { + char Query[512]; + char EscMessage[256]; + SQL_EscapeString(g_hMessageDatabase, message, EscMessage, sizeof(EscMessage)); + Format(Query, sizeof(Query), g_SQL_QUERY_ADDMESSAGE, g_MessageTableName, account_id, GetTime(), EscMessage, g_messages_server_id); + SQL_TQuery(g_hMessageDatabase, CallBack_AddMessage, Query, 0); +} + +public CallBack_AddMessage(Handle:owner, Handle:hndl, const String:error[], any:data) { + if (hndl == INVALID_HANDLE) { + LogError("%s Query failed! %s", g_MessageChatPrefix, error); + return; + } +} + +public Action SayHook(int cid, int args){ + char message[256]; + GetCmdArgString(message, sizeof(message)); + StripQuotes(message); + + if (message[1] == '!' || message[0] == '!'){//1 потому что ебаные " при вызове GetCmdArgString + return Plugin_Continue; + } + + int account_id = GetSteamAccountID(cid, true); + AddMessage(account_id, message); + return Plugin_Continue; +} \ No newline at end of file diff --git a/FSB_BanSystem/plugins/killfeed.smx b/FSB_BanSystem/plugins/killfeed.smx new file mode 100644 index 0000000000000000000000000000000000000000..9db15a686cca0176e0ca2f4bb832dbfe294a2eb3 GIT binary patch literal 3884 zcmYL{c|6qX7stP2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@cEvGsV=nSg`QX9k3whhLboPrbe@?@=k~x4QdlCr6CY<2;HEgNQ?_{%|XGS6BxvS zq7hJ=%NC>?1qvarAbAiNq=4?#i6)wQqX+NDk@(NOB#jS*W;J{ao-@u)n-b$qUnNMU zb=G}=^JC1>aKnU&$00e{`r#O`c+M=J{mcFdmRPqK0?IkJt;el^e@PafKhif5LP=ik1TFAdVQeubWwY zb231kF7IP(CqkZv<Sn^hmNHD-l9TMg0Zmhje|6x$lJrmf!GkmqvM<+*B%q04fZm4QauUz%1{Z25{?!Bz&P zsV%m8MZ!;IWv!O(@7YDm{d~ zUpKyeUXYRS;j?&Q`&%K#C33lVXuYgD-6ea8H0(7t)A)D!Jjo9;!gNbEI#@=Rv)UC! vd^zS#Fs5_D8P@I2#c3%UBRNM4pVxPm9G#?3=qdgmq{K}r literal 0 HcmV?d00001 diff --git a/FSB_BanSystem/plugins/messages.smx b/FSB_BanSystem/plugins/messages.smx new file mode 100644 index 0000000000000000000000000000000000000000..8d3e35efb6363fd623b1f70aed3d0ba05208bdba GIT binary patch literal 3426 zcmYL^c|4Ts8^&L|7{*E2g%&3qW8YGiY)O_VOJWQLlNsAgq%f9DmW-rGV^<_69W}?2 z-Plt0U7|^aV`*d#V(@!(>ht^Kdav(&Ki6}=&uwmQ=fKX!<|zO{wZB7X3iL)p2yYYt1tEg2dSWqN_#Y68 z3IPy+B49$%KL7_Tgh0Ujm;FIFG{G;>`)B)C^v4N0;41ECpAa5|_D1{sth}%&JpTWs z4+f0|0}$Sxz6c)-cJEJnh{Xi_LQH^9;D60ufBTW}#Rht!u)pGgUVD6PV(H=6Kq(9H z4&UCjwnXXl464|f`S|v~tq0$XR}3B%uwPs~raeZUSxq&)e6?!r*^)y~SkJQim7+S{ z!x!)J8FQv}Ci8NgFL3NiK5W*)5)wOpX8>Ze=Y10G$|oQsYsAJs@L+a4JTz==aaP7C zo4RALIzFBi?vtDIK4+!ogq-3ihMg!G&+5KwPS-WDI3neuYtyf1O@9e9>}K%88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6dZO7-Ju*FcLM*O2VcX`mUSC)YBDTRb zo&Rr&kxtX2Z;+qx+zq4kSc3$7+okWR!W#J$u*f>t5)PJe1)Fj+iO;g*7~BD-yT%ky z`+$`q!AeJf908wa5_7U^MU1Knb{9U?<0YwF+qbqV4{r0kC-1~n7VK(;lvCK>$Lz!z zkapsh+3RnQqUuIExrQXQzHwnn%@O&b!(C=0W%;S7$(ECKlC$c49cod=>mS}6nA-|o z<)U)Tuv3L+L^a95mF_)N|Ek{lS`_b+z3z}N(^Sp5E!&-%=Zr=?vwL9PnR$UwhCgqNomEv}}6mXVD{s)~nVFCaE literal 0 HcmV?d00001 diff --git a/PipeRemover/pipe_remover.sp b/PipeRemover/pipe_remover.sp new file mode 100644 index 0000000..da31d6b --- /dev/null +++ b/PipeRemover/pipe_remover.sp @@ -0,0 +1,32 @@ +#pragma semicolon 1 +#include +#include + +#define nigga_bomb "tf_projectile_pipe_remote" + +public Plugin:myinfo = +{ + name = "Pipe remover", + author = "gsd", + description = "i hate bugs", + version = "1.0", + url = "https://tf2.pblr-nyk.pro/" +} + +public OnEntityCreated (entity, const String:classname[]) { + if(StrEqual(classname, nigga_bomb)) + { + //PrintToChatAll("%d place pipe", GetEntPropEnt(entity, Prop_Data, "m_hOwnerEntity")); + SDKHook(entity, SDKHook_Touch, OnPipeTouch); + } +} + +public OnPipeTouch(entity, place) { + char place_name[64]; + GetEdictClassname(place, place_name, 64); + //PrintToChatAll("pipe touch, %d, %d, %s", entity, place, place_name); + if (StrEqual(place_name, "prop_dynamic")) { + //PrintToChatAll("pipe need dead"); + RemoveEntity(entity); + } +} \ No newline at end of file diff --git a/TradeBlocker.sp b/TradeBlocker.sp new file mode 100644 index 0000000..79f107a --- /dev/null +++ b/TradeBlocker.sp @@ -0,0 +1,103 @@ +#include +#include + +#define MAX_ARRAY_SIZE 32 +#define MAX_MESSAGE_SIZE 256 + +//TODO MySql Get +char badwords[MAX_ARRAY_SIZE][MAX_MESSAGE_SIZE]; + + +public OnPluginStart() { + fillMe() + AddCommandListener(IncomingMessage, "say"); + AddCommandListener(IncomingMessage, "say_team"); + AddCommandListener(IncomingMessage, "say2"); +} + +public OnPluginEnd() { + clearMe() + RemoveCommandListener(IncomingMessage, "say"); + RemoveCommandListener(IncomingMessage, "say_team"); + RemoveCommandListener(IncomingMessage, "say2"); +} + +public Action:IncomingMessage(client, const String:command[], args) { + char message[MAX_MESSAGE_SIZE]; + GetCmdArgString(message, sizeof(message)); + StripQuotes(message); + if (search(message)) { + //FakeClientCommand(client, "explode"); + createGayBomb(client); + return Plugin_Handled; + } else return Plugin_Continue; +} + +stock clearMe() { + for (int i = 0; i < MAX_ARRAY_SIZE;i++) { + badwords[i][0] = '\0'; + } +} + +stock fillMe() { + clearMe() + Format(badwords[0], MAX_MESSAGE_SIZE, "трейд"); + Format(badwords[1], MAX_MESSAGE_SIZE, "trade"); + Format(badwords[2], MAX_MESSAGE_SIZE, "обмен"); + Format(badwords[3], MAX_MESSAGE_SIZE, "oбмен"); + Format(badwords[4], MAX_MESSAGE_SIZE, "обмeн"); + Format(badwords[5], MAX_MESSAGE_SIZE, "oбмeн"); + Format(badwords[6], MAX_MESSAGE_SIZE, "trаde"); + Format(badwords[7], MAX_MESSAGE_SIZE, "tradе"); + Format(badwords[8], MAX_MESSAGE_SIZE, "trаdе"); + Format(badwords[9], MAX_MESSAGE_SIZE, "трeйд"); + Format(badwords[10], MAX_MESSAGE_SIZE, "тpейд"); + Format(badwords[11], MAX_MESSAGE_SIZE, "тpeйд"); + Format(badwords[12], MAX_MESSAGE_SIZE, "куплю"); + Format(badwords[13], MAX_MESSAGE_SIZE, "продам"); + Format(badwords[14], MAX_MESSAGE_SIZE, "sell"); + Format(badwords[15], MAX_MESSAGE_SIZE, "sеll"); +} + +stock genMessage(char[] buffer, int size) { + switch (GetRandomInt(0, 3)) { + case 0: { + Format(buffer, size, "Отсосу за %d рефов", GetRandomInt(10, 99)); + } + case 1: { + Format(buffer, size, "Отдам жопу за %d ключей", GetRandomInt(5, 14)); + } + case 2: { + Format(buffer, size, "Отдаю родную мать за %d ключей и %d рефов", GetRandomInt(10, 99), GetRandomInt(5,84)); + } + case 3: { + Format(buffer, size, "Бесплатно отдамся в руки фембойчику"); + } + } +} + +stock bool search(const char[] message) { + for (int i = 0; i < MAX_ARRAY_SIZE;i++) { + if (strlen(badwords[i]) == 0) return false; + if (StrContains(message, badwords[i], false) != -1) { + PrintToServer("Found bad word: %s", badwords[i]); + return true; + } + } + return false; +} + +stock createGayBomb(client) { + int uid = GetClientUserId(client); + CreateTimer(0.01, GayBomb, uid, TIMER_FLAG_NO_MAPCHANGE); +} + +public Action GayBomb(Handle timer, any data) { + int client = GetClientOfUserId(data); + if (client != 0) { + char b[MAX_MESSAGE_SIZE]; + genMessage(b, MAX_MESSAGE_SIZE); + FakeClientCommand(client, "say \"%s\"", b); + } + return Plugin_Stop; +} \ No newline at end of file diff --git a/plugins/fsb.smx b/plugins/fsb.smx new file mode 100644 index 0000000000000000000000000000000000000000..6798e57415578af49a6b241260ac3ec385d7265c GIT binary patch literal 14740 zcmY+m1yEc;*R73ffMCHrxO;GS5AG1$-5r9vyNBSe0}SpO+$}f+7~BT9^S<}{>i+*! zt+Sury-xRIwlzQ+FFri~oWHq`11f z+x%bef62kZ-P+0gf7<_R{qKy0qld%)^xb`&EzB(}|34!)3-|vSnc17Vx&6OMOB)OO z|6T6CE4aIQnEkK!|22&N$H!v+!-~by#{NI~{)6^5j{l1`j+RdUxB0&r|Ld@_clu#! z|G#!8v;VO7`b7YSx5kRcF-iPq7`QQM1XFWAs1P_Lb}X1!5q4R^5IFI%c@qh7O0*oY zdEZ~jR?=;-T4%jwZz}Q`srKcs_a*X9Bdf%+KTCI4$~av#EH1o zx_*sW&R!L~Zg*Wx3(A>zwHM+A7|aCpdVTD;%?dphydIHmvq&CkB=#8>?DhsqDU1Vu z8DIj~01{{UGJ~&%ph1==WIS*ls_<^8v1@;Q=Ps`S2osMO;}m3ow|N{2am2HDr=o5j zh0+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(OQ0^R&+UGQKtJsv*7kCUVB)#kA;fmVHBeR{$_72V z0U<|%rYgkp(nUr#qh;Mxne&Amk*+jI8CJ;xqg-~q$_IPmpsXI#TapBc+vn8dBCSIA P7c}Bi5L8e)6UYAnxP3qo literal 0 HcmV?d00001 diff --git a/plugins/pipe_remover.smx b/plugins/pipe_remover.smx new file mode 100644 index 0000000000000000000000000000000000000000..1fc1d952536b8717ac038b56b4bf4221ac7f2d78 GIT binary patch literal 3214 zcmXw!2|UyPAIHBm%8{w4hz=d3B9ddnl8hu|$raKJ!#4L^o0empy5v3@rV#2!l%tK( zlxwb5AY8ZqrVE|AA`OPi>*a7aj zo?|NjfCcC#pcE7VKp%7)Q1*Y>8RP_zWkB}<^$g@IpofFn1P+M@Jq}bN$m_EnfGP%A z7Xkq3Ade~mfHdfNpnii4-U%oLCBGj4vOs5odING9=xS(!I|fj5cMEa@)ck_4`eM<6 ze;~vy00g{S5H2~Wc;9CG+Nh3D2d zJ(A0Nw?Xj*^wS2YF6ycNJnh8nz=oU)aCy4w`U6`vqHC+F+IHS4A6y`|a#wqX7lsob zak-H*HDl@hdW?vfH)A0hw2PDC#%+YV?F_lk2ijSBxYMfpGKSH}8?BoJ2~1a+MG;D? zgy27BiCCo3K!u29%E+QOrDR8_`9KvUQ+Dw+Q<0J-y@;hSRCsm}veCetFykoCN7z+* zF`Maxt_u~5tYM;r`w#LiP^`oR$xJH=0fy2lw!Wi;pqvSJOdOkpWNr;*Fj*oqn*=dT zaPFVLLvW-Zk7+wO8+n(hBOy3T@f0yU$U_Sw_VWUT5$ZfWitE-zTZ-$B#bcDh@)5ox zg&++c%Syc3bs$H0&yG-&0TzU8KHv!b`2x4?y;)sa?DAP!;Ger>V7Gx40D4| z9Q>e9Wj^W1<8I{2efC&MC#s~IIaXx71S@&F-Lml&LE`Rm2AnwlMYSA(^eN=QBz}Y$ zj=mbpB|onmiR+2XKA}r|qpj|j_HNo|$fv^3*#+MEuX-p!cV502RkkEPn;>4smwt368~0i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plpDxJgMz-&{2E+bM^d(0x7{gS~}=ej2shl=*nRR_jTvR(AD*LaUxuKf7w? zoc_YmL-Qwhgh^%leC93h9U0QE_{N%RjMiuA=g#YQv;;P*W)eQ{TwRGMDt0z_t{d zPZQM7Y$ffBCEsRLlhPQ^NK{6G^QiijetHIee8EemZInB=L$zQ|Y#gdG@dPofeh!hH zp*wEd?QnfHSxI_nTXz_BHG#3n=CDo1TN|QcYFj@>jjK1TZC9jGX$++`8spF!jRW=w zi?=@#K<73@jc;CU{|VzmR}A=2`p!<%EN3a_o?@;?ci8l`-^Os-koD4Q!;WI^Vh1~h zMm)pSoR?DRUEw?-8WUbkmNY7E8Yb=xe>$6?buMW9>)sxk=gq_8HS8hwvSdxEnT8qs zCe*sgs9&T;iX>gR$=Q@BkN-}UtPzjU39@^dX)8sXDB%Q;zZ*u(*MQnGn{^2XI%zmc zxz+IXFP#T#>}IgOFuP}o3`%HrPi3rtYKUAdVV~&KFS{*prExQy*!bB!3%FDP6@PGz zW-yGHo&eWPgX{dk{DyELM|!ApK6gZ9yjQF7dFR3^%mT8&{-jQ`i=%D}AH$0-0re55 zTiflnh9~01RalVuTAK34ySmz z&d)~ua+jY4=SRlbz{GGE#P-myxT-x4Qtyi9W?*(C%>ceABTTXS!Z*z=;oU{QGYu_w zUcE{$bo5Aj5;3ZL8fv=MRJu>MrK +#include +#define PLUGIN_VERSION "1.3" + +public Plugin:myinfo = { + name = "[ANY] User Control", + author = "gsd", + description = "Append user connect and disconnect inforamations, for control.Nickname, SteamID, IP, Total game time on server.", + version = PLUGIN_VERSION, + url = "https://kremlin.ru" +}; + +int iPlayedTime[101] = {-1, ...}; +new Handle:hDatabase = INVALID_HANDLE; + +//////////////////////////////////////////////////////////// +public APLRes:AskPluginLoad2(Handle:hMyself, bool:bLate, String:strError[], iErr_Max){ + RegPluginLibrary("usercontrol"); + CreateNative("UserControl_PlayedTime", Native_GetClientPlayerTime); + return APLRes_Success; +} + +public Native_GetClientPlayerTime(Handle:plugin, numParams){ + new client = GetNativeCell(1); + + if(client < 1 || client > MaxClients){ + ThrowNativeError(SP_ERROR_PARAM, "Invalid client or client index %i", client); + return false; + } + + if(!IsClientInGame(client)){ + ThrowNativeError(SP_ERROR_PARAM, "Client %i is not in game!", client); + return false; + } + + return iPlayedTime[client]; +} +//////////////////////////////////////////////////////////// + + +public OnPluginStart() { + VerifyTable(); + StartSQL(); + CreateConVar("sm_ucontrol_version", PLUGIN_VERSION, "User Connection Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY); + HookEvent("player_disconnect", event_PlayerDisconnect, EventHookMode_Pre); +} + +StartSQL() { + SQL_TConnect(GotDatabase, "usercontrol"); +} + +public GotDatabase(Handle:owner, Handle:hndl, const String:error[], any:data) { + if (hndl == INVALID_HANDLE) { + LogError("Database Connection Error: %s", error); + } else { + hDatabase = hndl; + } +} + +public int CopyString(const String:Source[], String:Buffer[]){ + new EndPos; + for (new CurrentPos = 0; CurrentPos < strlen(Source); CurrentPos++){ + Buffer[CurrentPos] = Source[CurrentPos]; + EndPos = CurrentPos; + } + Buffer[EndPos+1] = '\0'; + return EndPos; +} + +bool:VerifyTable() { + + decl String:error[255]; + decl String:query[512]; + query[0] = '\0'; + + new Handle:db = SQL_Connect("usercontrol", true, error, sizeof(error)); + if (db == INVALID_HANDLE) { + LogError("Could Not Connect to Database, error: %s", error); + return false; + } + + Format(query, sizeof(query), "%s%s%s%s%s%s%s%s%s%s", + "CREATE TABLE IF NOT EXISTS `user_connections` (", + " `player_name` VARCHAR(64) NOT NULL ,", + " `steam_id` VARCHAR(32) NOT NULL ,", + " `connect_ip` VARCHAR(15) NOT NULL ,", + " `account_id` BIGINT NOT NULL ,", + " `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,", + " `map` VARCHAR(256) NOT NULL ,", + " `connection_type` VARCHAR(10) NOT NULL ,", + " `connect_duration` INT NOT NULL ", + ") ENGINE = MyISAM DEFAULT CHARSET=utf8mb4; "); + + new bool:success = SQL_FastQuery(db, query); + if(!success) { + SQL_GetError(db, error, sizeof(error)); + LogError("Unable to verify mysql_bans table:%s", query); + } + + CloseHandle(db); + return true; +} + +public T_SendQuery(Handle:owner, Handle:hndl, const String:error[], any:data) { + if (hndl == INVALID_HANDLE) { + LogError("Query failed! %s", error); + } + return; +} + +////////////////////////////////////////////////////////////////////////////////////////////// + +public void OnClientAuthorized(int client) +{ + GetPlayTimeTotal(client); +} + +int GetPlayTimeTotal(int client) { + char Query[512]; + int AccountID = GetSteamAccountID(client, true); + char Map[128]; + GetCurrentMap(Map,sizeof(Map)); + Format(Query, sizeof(Query), "SELECT SUM(connect_duration) total FROM user_connections WHERE connection_type LIKE 'disconnect' AND account_id = %d AND map LIKE '%s'", AccountID, Map); + SQL_TQuery(hDatabase, GetPlayTimeTotalCallback, Query, GetClientUserId(client)); + return 0; +} + +stock void GetPlayTimeTotalCallback(Handle owner, Handle hndl, char [] error, any data) { + int client; + if((client = GetClientOfUserId(data)) == 0) + { + return; + } + + char PlayerName[64]; + GetClientName(client, PlayerName, sizeof(PlayerName)); + + if(hndl == INVALID_HANDLE) + { + LogError("Query failure: %s", error); + return; + } + + if (SQL_FetchRow(hndl)) { + iPlayedTime[client] = SQL_FetchInt(hndl, 0); + } else { + iPlayedTime[client] = -1; + } +} + +public void OnClientDisconnect(int client) +{ + iPlayedTime[client] = -1; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +public OnClientPostAdminCheck(client) { + //User Connect to Server + if(IsFakeClient(client)) { + return; + } + //Vars + new String:error[1024]; + DataPack hPayload = new DataPack(); + /* + 0 - User ID INT + 1 - Account ID INT + 2 - Steam ID STRING + 3 - Connection Type STRING + 4 - Conncetion IP STRING + 5 - Player Name STRING + 6 - Disconnect Reason STRING + 7 - Game Time On Server STRING + */ + WritePackCell(hPayload, GetClientUserId(client)); + WritePackCell(hPayload, GetSteamAccountID(client, true)); + char SteamID[64]; + GetClientAuthString(client, SteamID, sizeof(SteamID)); + WritePackString(hPayload, SteamID); + char ConnectionType[16]; + Format(ConnectionType, sizeof(ConnectionType), "%s", "connect"); + WritePackString(hPayload, ConnectionType); + char ConnectionIP[16]; + GetClientIP(client, ConnectionIP, sizeof(ConnectionIP)); + WritePackString(hPayload, ConnectionIP); + char PlayerName[64]; + GetClientName(client, PlayerName, sizeof(PlayerName)); + WritePackString(hPayload, PlayerName); + WritePackString(hPayload, ""); + WritePackCell(hPayload, 0); + ///////////////////////////////////////////////////////////////////////////////////////// + SQL_TQuery(hDatabase, T_QueryPost, error, hPayload); + return; +} + +public Action:event_PlayerDisconnect(Handle:event, const String:name[], bool:dontBroadcast) { + new String:error[1024]; + DataPack hPayload = new DataPack(); + new client = GetClientOfUserId(GetEventInt(event, "userid")); + if(client == 0){ + return Plugin_Continue; + } + /* + 0 - User ID INT + 1 - Account ID INT + 2 - Steam ID STRING + 3 - Connection Type STRING + 4 - Conncetion IP STRING + 5 - Player Name STRING + 6 - Disconnect Reason STRING + 7 - Game Time On Server INT + */ + WritePackCell(hPayload, GetEventInt(event, "userid")); + WritePackCell(hPayload, GetSteamAccountID(client, true)); + char SteamID[64]; + GetEventString(event, "networkid", SteamID, sizeof(SteamID)); + WritePackString(hPayload, SteamID); + char ConnectionType[16]; + Format(ConnectionType, sizeof(ConnectionType), "%s", "disconnect"); + WritePackString(hPayload, ConnectionType); + char ConnectionIP[16]; + GetClientIP(client, ConnectionIP, sizeof(ConnectionIP)); + WritePackString(hPayload, ConnectionIP); + char PlayerName[64]; + GetEventString(event, "name", PlayerName, sizeof(PlayerName)); + WritePackString(hPayload, PlayerName); + char DisconnectReason[256]; + GetEventString(event, "reason", DisconnectReason, sizeof(DisconnectReason)); + WritePackString(hPayload, DisconnectReason); + WritePackCell(hPayload, RoundFloat(GetClientTime(client))); + SQL_TQuery(hDatabase, T_QueryPost, error, hPayload); + return Plugin_Continue; +} + +public T_QueryPost(Handle:owner, Handle:hndl, const String:error[], any:hPayload) { + new String:query[1024]; + ResetPack(hPayload); + int UserID; + int AccountID; + char Map[256]; + char SteamID[64]; + char ConnectionType[16]; + char ConnectionIP[16]; + char PlayerName[64]; + char DisconnectReason[256]; + int GameTime; + /* + 0 - User ID INT + 1 - Account ID INT + 2 - Steam ID STRING + 3 - Connection Type STRING + 4 - Conncetion IP STRING + 5 - Player Name STRING + 6 - Disconnect Reason STRING + 7 - Game Time On Server INT + */ + UserID = ReadPackCell(hPayload); + AccountID = ReadPackCell(hPayload); + ReadPackString(hPayload, SteamID, sizeof(SteamID)); + ReadPackString(hPayload, ConnectionType, sizeof(ConnectionType)); + ReadPackString(hPayload, ConnectionIP, sizeof(ConnectionIP)); + ReadPackString(hPayload, PlayerName, sizeof(PlayerName)); + ReadPackString(hPayload, DisconnectReason, sizeof(DisconnectReason)); + GameTime = ReadPackCell(hPayload); + GetCurrentMap(Map, sizeof(Map)); + + //for (new i = 0; i < sizeof(sUserData); i++) { + // SQL_EscapeString(hDatabase, sUserData[i], Payload[i], strlen(Payload[i]) * 2); + //} + char SQL_PlayerName[64]; + SQL_EscapeString(hDatabase, PlayerName, SQL_PlayerName, sizeof(SQL_PlayerName)); + char SQL_Reason[256]; + SQL_EscapeString(hDatabase, DisconnectReason, SQL_Reason, sizeof(SQL_Reason)); + char SQL_Map[256]; + SQL_EscapeString(hDatabase, Map, SQL_Map, sizeof(SQL_Map)); + + if (StrEqual(ConnectionType, "connect")) + { + Format(query, sizeof(query), "INSERT INTO user_connections (player_name, steam_id, connect_ip, account_id, timestamp, connection_type, map) VALUES ('%s', '%s', '%s', '%d', CURRENT_TIMESTAMP, '%s', '%s')", SQL_PlayerName, SteamID, ConnectionIP, AccountID, ConnectionType, SQL_Map); + //LogMessage("New connection %s, %s(%s), U:1:%d", sUserData[4], sUserData[0], sUserData[2], iUserData[1]); + LogMessage("Player connected: %s %s|U:1:%d|%s", PlayerName, SteamID, AccountID, ConnectionIP); + } + else + { + Format(query, sizeof(query), "INSERT INTO user_connections (player_name, account_id, connection_type, connect_duration, reason, map) VALUES ('%s', '%d', '%s', '%d', '%s', '%s')", SQL_PlayerName, AccountID, ConnectionType, GameTime, SQL_Reason, SQL_Map); + //LogMessage("%s | U:1:%d disconnect from server, total game time %d seconds", sUserData[0], iUserData[1], iUserData[2]); + LogMessage("Player disconnected: %s %s|U:1:%d|%s\nGame Time: %d sec. Reason: %s", PlayerName, SteamID, AccountID, ConnectionIP,GameTime, DisconnectReason); + } + //LogMessage(query); + CloseHandle(hPayload); + SQL_TQuery(hDatabase, T_SendQuery, query); + return; +} \ No newline at end of file