View Single Post
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Old 09-15-2019 , 09:10   Re: [ANY] AFK Manager (Version 4.3.0 / Updated July 2nd 2018)
Reply With Quote #2001

Hi,
Great plugin, thx. I found out 2 errors:

1: Can't compile cuz it says

Code:
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// afk_manager4.sp
//
// C:\Users\Bast\Downloads\last dls\csgosl-windows\csgosl\server\csgo\addons\sourcemod\scripting\afk_manager4.sp(904) : error 180: function return type differs from prototype. expected 'void', but got 'int'
//
// 1 Error.
//
// Compilation Time: 0,98 sec
// ----------------------------------------

Press enter to exit ...
So ofc I changed the public int Updater_OnPluginUpdated() to public void Updater_OnPluginUpdated() and it worked.

*** EDIT: I had an old version of updater.inc. ***

2: Then, before I made the changes above, I had this error when a AFK player who did not choose a team, was forced to join a team by the game, and THEN moved to spec (meaning the player actually did not do anything after connecting).

Code:
L 09/15/2019 - 14:07:02: SourceMod error session started
L 09/15/2019 - 14:07:02: Info (map "surf_ace") (file "errors_20190915.log")
L 09/15/2019 - 14:07:02: [SM] Exception reported: Script execution timed out
L 09/15/2019 - 14:07:02: [SM] Blaming: afk_manager4.smx
L 09/15/2019 - 14:07:02: [SM] Call stack trace:
L 09/15/2019 - 14:07:02: [SM]   [0] ForcePlayerSuicide
L 09/15/2019 - 14:07:02: [SM]   [1] Line 2365, /home/forums/content/files/3/2/0/9/1/170330.attach::MoveAFKClient
L 09/15/2019 - 14:07:02: [SM]   [2] Line 2204, /home/forums/content/files/3/2/0/9/1/170330.attach::Timer_CheckPlayer
L 09/15/2019 - 14:25:32: Error log file session closed.
By luck I could check the console when it happened, and I noticed that the client had the "No user logon" error:
Code:
PutClientInServer: no info_player_start on level
L 09/15/2019 - 14:02:53: "S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á<148><STEAM_1:0:123456789><>" entered the game
L 09/15/2019 - 14:03:25: "S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á<148><STEAM_1:0:123456789>" switched from team <Unassigned> to <TERRORIST>
L 09/15/2019 - 14:04:55: [afk_manager4.smx] S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á<148><STEAM_1:0:161302819><> was moved to spectate for being AFK too long.
L 09/15/2019 - 14:07:02: [SM] Exception reported: Script execution timed out
L 09/15/2019 - 14:07:02: [SM] Blaming: afk_manager4.smx
L 09/15/2019 - 14:07:02: [SM] Call stack trace:
L 09/15/2019 - 14:07:02: [SM]   [0] ForcePlayerSuicide
L 09/15/2019 - 14:07:02: [SM]   [1] Line 2365, /home/forums/content/files/3/2/0/9/1/170330.attach::MoveAFKClient
L 09/15/2019 - 14:07:02: [SM]   [2] Line 2204, /home/forums/content/files/3/2/0/9/1/170330.attach::Timer_CheckPlayer
L 09/15/2019 - 14:07:02: "S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á<148><STEAM_1:0:123456789><TERRORIST>" [-4400 -512 3972] committed suicide with "world"
L 09/15/2019 - 14:07:02: "S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á<148><STEAM_1:0:123456789>" switched from team <TERRORIST> to <Spectator>
STEAMAUTH: Client S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á received failure code 6
L 09/15/2019 - 14:07:02: STEAMAUTH: Client S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á received failure code 6
L 09/15/2019 - 14:07:02: "S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á<148><STEAM_1:0:123456789><Spectator>" disconnected (reason "No user logon")
L 09/15/2019 - 14:07:03: "S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á<148><STEAM_1:0:123456789>" switched from team <Spectator> to <Unassigned>
Dropped S¤ü╬▒ÐÅÐé╬╣╬▒Ðé╬Á from server: No user logon
I supposed it was a problem with the ForcePlayerSuicide function like the error log says, but indeed, after looking at the code, everything was normal there.
So I looked at the rest and noticed that all the hooks were default or post hooks, which means they should NOT return a value, see here: https://wiki.alliedmods.net/Events_(SourceMod_Scripting)

So I changed the 'public Action' on Post Hooks to 'public void', removed the return values in them, and after my first test, I don't have the error anymore.
But anyway this error might have been due to the No user logon situation.

Cheers,
St00ne
__________________

*** *** ***
-My plugins-

Last edited by St00ne; 09-19-2019 at 09:44.
St00ne is offline