From c00a62591085a6c4de820006b1d85a301dea99df Mon Sep 17 00:00:00 2001 From: jenz Date: Tue, 29 Aug 2023 18:11:52 +0200 Subject: [PATCH] multiple syntax updates to adjust for 1.11.0.6946 SM build --- AutismBotIngame/scripting/bot_surfing.sp | 8 +- AutismBotIngame/scripting/include/socket.inc | 11 +- .../scripting/unloze_player_time.sp | 12 +- .../scripting/event_notifier.sp | 1 + .../scripting/jenz_ban_detector.sp | 6 +- vprofiler/scripting/sm_vprofiler.sp | 172 ++++++++++++++++++ 6 files changed, 195 insertions(+), 15 deletions(-) create mode 100644 vprofiler/scripting/sm_vprofiler.sp diff --git a/AutismBotIngame/scripting/bot_surfing.sp b/AutismBotIngame/scripting/bot_surfing.sp index c37fbf32..2e9996ea 100644 --- a/AutismBotIngame/scripting/bot_surfing.sp +++ b/AutismBotIngame/scripting/bot_surfing.sp @@ -55,7 +55,8 @@ public void OnPluginEnd() public Action OnRoundEnd(Handle event, const char[] name, bool dontBroadcast) { - perform_resets(); + perform_resets(); + return Plugin_Handled; } public void Event_RoundStart(Handle event, const char[] name, bool dontBroadcast) @@ -77,7 +78,8 @@ public void perform_resets() public Action reset_round_switch(Handle timer, any data) { - round_switch = false; + round_switch = false; + return Plugin_Handled; } stock bool IsValidClient(int client) @@ -212,7 +214,7 @@ public Action update_mimic_coords(Handle timer, any data) return Plugin_Continue; } -public float get_power_distance(int target_player, float [3]pos) +public float get_power_distance(int target_player, float pos[3]) { float vec[3]; GetClientAbsOrigin(target_player, vec); diff --git a/AutismBotIngame/scripting/include/socket.inc b/AutismBotIngame/scripting/include/socket.inc index 5adda9a9..92d00cc3 100644 --- a/AutismBotIngame/scripting/include/socket.inc +++ b/AutismBotIngame/scripting/include/socket.inc @@ -202,7 +202,7 @@ enum SocketOption { */ typeset SocketConnectCB { - function void(Handle socket, any arg); + function void(Handle socket, int arg); }; /** @@ -218,7 +218,7 @@ typeset SocketConnectCB */ typeset SocketIncomingCB { - function void(Handle socket, Handle newSocket, const char remoteIP[], char remotePort, any arg); + function void(Handle socket, Handle newSocket, const char remoteIP[64], char remotePort, any arg); }; /** @@ -237,7 +237,7 @@ typeset SocketIncomingCB */ typeset SocketReceiveCB { - function void(Handle socket, const char receiveData[], const int dataSize, any arg); + function void(Handle socket, char receiveData[3500], int dataSize, int arg); }; /** @@ -263,7 +263,7 @@ typeset SocketSendqueueEmptyCB */ typeset SocketDisconnectCB { - function void(Handle socket, any arg); + function void(Handle socket, int arg); }; /** @@ -333,7 +333,8 @@ native bool SocketBind(Handle socket, const char[] hostname, char port); * @param cell_t port The port to connect to. * @noreturn */ -native void SocketConnect(Handle socket, SocketConnectCB cfunc, SocketReceiveCB rfunc, SocketDisconnectCB dfunc, const char[] hostname, char port); +//native void SocketConnect(Handle socket, SocketConnectCB cfunc, SocketReceiveCB rfunc, SocketDisconnectCB dfunc, char[] hostname , int port); +native void SocketConnect(Handle socket, SocketConnectCB cfunc, SocketReceiveCB rfunc, SocketDisconnectCB dfunc, char[] hostname, char port); /** * Disconnects a socket diff --git a/discord_verificiation/scripting/unloze_player_time.sp b/discord_verificiation/scripting/unloze_player_time.sp index def63181..a6103ed3 100644 --- a/discord_verificiation/scripting/unloze_player_time.sp +++ b/discord_verificiation/scripting/unloze_player_time.sp @@ -389,6 +389,7 @@ public Action Command_TopTime(int client, int args) } menu.ExitButton = true; menu.Display(client, 0); + return Plugin_Handled; } public Action Command_Time(int client, int args) @@ -516,9 +517,10 @@ public void SQL_OnQueryCompletedTime(Database db, DBResultSet results, const cha public int Handler_Menu(Menu menu, MenuAction action, int param1, int param2) { - switch(action) - { - case MenuAction_Select, MenuAction_Cancel: - delete menu; - } + switch(action) + { + case MenuAction_Select, MenuAction_Cancel: + delete menu; + } + return 0; } diff --git a/event_notification/scripting/event_notifier.sp b/event_notification/scripting/event_notifier.sp index 13337ec6..00977c8b 100644 --- a/event_notification/scripting/event_notifier.sp +++ b/event_notification/scripting/event_notifier.sp @@ -128,4 +128,5 @@ public int Handler_Menu(Menu menu, MenuAction action, int param1, int param2) case MenuAction_Select, MenuAction_Cancel: delete menu; } + return 0; } diff --git a/jenz_ban_detector/scripting/jenz_ban_detector.sp b/jenz_ban_detector/scripting/jenz_ban_detector.sp index f8dcaecf..67cea964 100644 --- a/jenz_ban_detector/scripting/jenz_ban_detector.sp +++ b/jenz_ban_detector/scripting/jenz_ban_detector.sp @@ -152,7 +152,7 @@ public Action re_open_motd(Handle hTimer, int Serial) int client; if ((client = GetClientFromSerial(Serial)) == 0) { - return; + return Plugin_Handled; } if (IsValidClient(client)) { @@ -165,6 +165,7 @@ public Action re_open_motd(Handle hTimer, int Serial) CloseHandle(panel); CreateTimer(5.0, SQL_Select_fingerprints, GetClientSerial(client)); } + return Plugin_Handled; } public Action SQL_Select_fingerprints(Handle hTimer, int Serial) @@ -172,7 +173,7 @@ public Action SQL_Select_fingerprints(Handle hTimer, int Serial) int client; if ((client = GetClientFromSerial(Serial)) == 0) { - return; + return Plugin_Handled; } if (IsValidClient(client)) { @@ -185,6 +186,7 @@ public Action SQL_Select_fingerprints(Handle hTimer, int Serial) //PrintToChatAll("sQuery: %s", sQuery); g_dDatabase.Query(SQL_FindFingerPrints, sQuery, GetClientSerial(client), DBPrio_Low); } + return Plugin_Handled; } public void SQL_FindFingerPrints(Database db, DBResultSet results, const char[] error, int Serial) diff --git a/vprofiler/scripting/sm_vprofiler.sp b/vprofiler/scripting/sm_vprofiler.sp new file mode 100644 index 00000000..5538809e --- /dev/null +++ b/vprofiler/scripting/sm_vprofiler.sp @@ -0,0 +1,172 @@ +#define PLUGIN_VERSION "1.1" + +#pragma semicolon 1 +#pragma newdecls required + +#include + +public Plugin myinfo = +{ + name = "[ANY] [Debugger] Valve Profiler", + description = "Measures per-plugin performance and provides a log with various counters", + author = "Alex Dragokas", + version = PLUGIN_VERSION, + url = "https://github.com/dragokas/" +}; + +/* + Commands: + + - sm_debug - Start / stop vprof debug tracing + + Logfile: + + - addons/sourcemod/logs/profiler___