Raised This Month: $51 Target: $400
 12% 

[TF2] Play Or Leave - a safer method of detecting AFKs [12/7/2014]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
sheo
SourceMod Donor
Join Date: Jul 2013
Location: Russia, Moscow
Plugin ID:
4238
Plugin Version:
1.4
Plugin Category:
Server Management
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Takes appropriate actions on AFK players
    Old 06-07-2014 , 07:04   [TF2] Play Or Leave - a safer method of detecting AFKs [12/7/2014]
    Reply With Quote #1

    Description
    What, another AFK manager? Not really, this one checks client`s buttons activity rather than checking his world and eye positions every given period of time. This method appears to be much more reliable than that usual one.

    What exactly this plugin can do?
    Move AFKs to Spectators team; kick AFKs only if the server is almost full; warn players if they will be kicked/moved soon

    Cvars:
    tf2_sheoafk_manager_version - version cvar
    sm_sheoafk_free_slots_before_kick - How many slots should left on the server when AFK manager starts kicking spectators. (def: 4)
    sm_sheoafk_seconds_before_spec - How many seconds to wait before spectating an afk player. (def: 60.0)
    sm_sheoafk_seconds_before_kick - How many seconds to wait before kicking an afk spectator. This counts from the moment the player joins spectator team. (def: 120.)
    sm_sheoafk_seconds_before_warn - How many seconds before kick/spec a player should be warned about oncoming action. (def: 15.0)
    sm_sheoafk_ignore_admins - Set to 1 to ignore admins. This does not include the native and forwards, they are working for all players. (def: 0)

    Additionally:
    The plugin adds some new target filters for other plugins
    @afk/@afks - everyone who is marked as AFK
    @notafk/@notafks/@active - everyone who is in game and not marked as AFK
    Also it provides some useful functions for other plugins. Look into .inc file for more info.

    Requirements:
    SourceMod 1.5 or higher + translation file (attached)

    Installation:
    1) Put the plugin to your plugins folder
    2) Put afk_manager.txt to your translations folder
    3) Set up cvars values in your server.cfg if wanted

    Changelog:
    Spoiler
    Attached Files
    File Type: txt afk_manager.txt (859 Bytes, 773 views)
    File Type: inc afk_manager.inc (353 Bytes, 583 views)
    File Type: sp Get Plugin or Get Source (afk_manager.sp - 1692 views - 11.0 KB)

    Last edited by sheo; 08-01-2014 at 00:57.
    sheo is offline
    sheo
    SourceMod Donor
    Join Date: Jul 2013
    Location: Russia, Moscow
    Old 06-07-2014 , 07:34   Re: [TF2] Play Or Leave - a safer method of detecting AFKs
    Reply With Quote #2

    Why can`t I edit plugin description and version fields? It simply ignores all my changes
    sheo is offline
    Drixevel
    AlliedModders Donor
    Join Date: Sep 2009
    Location: Somewhere headbangin'
    Old 06-07-2014 , 10:14   Re: [TF2] Play Or Leave - a safer method of detecting AFKs
    Reply With Quote #3

    You could use...
    Code:
    if (GetEngineVersion() != Engine_TF2)
    instead of...
    Code:
    if (GetAppID() != 440)
    .

    I also believe that even then, this should work with a good number of games since I think the 'Player_Team' event is in a good number of them.

    Also, since SDKTools is needed for it, you might want to upload an SMX compiled for people to download.

    One more thing, You might want to change the plugin name to not confuse people since the plugin name here is the same.

    - Jack (Nice Job)

    Last edited by Drixevel; 06-07-2014 at 10:19.
    Drixevel is offline
    sheo
    SourceMod Donor
    Join Date: Jul 2013
    Location: Russia, Moscow
    Old 06-07-2014 , 10:36   Re: [TF2] Play Or Leave - a safer method of detecting AFKs
    Reply With Quote #4

    Quote:
    Originally Posted by r3dw3r3w0lf View Post
    You could use...
    Code:
    if (GetEngineVersion() != Engine_TF2)
    instead of...
    Code:
    if (GetAppID() != 440)
    .
    True that, but GetAppID was a completed snippet, so i just copypasted it instead of looking through engine enums. Actually, there is no any harm if i open a file to detect a game.

    Quote:
    Originally Posted by r3dw3r3w0lf View Post
    I also believe that even then, this should work with a good number of games since I think the 'Player_Team' event is in a good number of them.
    Also true, but TF2 is the only game i play that needs afk managers, i don`t want to make plugins for games i can`t maintain. You know, in any other game there may be completely different system of game joining/team switching.

    Quote:
    Originally Posted by r3dw3r3w0lf View Post
    Also, since SDKTools is needed for it, you might want to upload an SMX compiled for people to download.
    Oops, thank you for the remind

    Quote:
    Originally Posted by r3dw3r3w0lf View Post
    One more thing, You might want to change the plugin name to not confuse people since the plugin name here is the same.
    Does it actually confuse them? More over, it`s good, because they won`t occasionally run two afk managers together
    sheo is offline
    Drixevel
    AlliedModders Donor
    Join Date: Sep 2009
    Location: Somewhere headbangin'
    Old 06-07-2014 , 10:46   Re: [TF2] Play Or Leave - a safer method of detecting AFKs
    Reply With Quote #5

    Quote:
    Originally Posted by sheo View Post
    Also true, but TF2 is the only game i play that needs afk managers, i don`t want to make plugins for games i can`t maintain. You know, in any other game there may be completely different system of game joining/team switching.
    Well, your plugin would work well regardless since most games have that event and it's the only hook you use that could mean make it or break it for other games. You would just have to look up if the mod has that event and role with it but I can see where you're coming from.
    Drixevel is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 06-07-2014 , 16:09   Re: [TF2] Play Or Leave - a safer method of detecting AFKs [v1.0]
    Reply With Quote #6

    I made a similar AFK detecting plugin; I was working on making it suitable for public release. I guess you beat me to it lol.

    In my plugin, I also reset a player's afk time based on commands; you may want to consider placing calls to OnClientButtonsChanged(client) within a command listener, like this.

    PHP Code:
    public OnPluginStart() {
        
    AddCommandListener(CommandListener);
    }

    public 
    Action:CommandListener(client, const String:strCommand[], iArgs) {
        
    OnClientButtonsChanged(client);

    __________________
    ddhoward is offline
    sheo
    SourceMod Donor
    Join Date: Jul 2013
    Location: Russia, Moscow
    Old 06-07-2014 , 16:42   Re: [TF2] Play Or Leave - a safer method of detecting AFKs [v1.0]
    Reply With Quote #7

    Quote:
    Originally Posted by ddhoward View Post
    you may want to consider placing calls to OnClientButtonsChanged(client) within a command listener
    All calls for timer reset except buttons pressing/releasing were not added intentionally. As you can see, this plugin even does not check your mouse movements
    __________________
    sheo is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 06-07-2014 , 16:57   Re: [TF2] Play Or Leave - a safer method of detecting AFKs [v1.0]
    Reply With Quote #8

    I figured that was because the other methods (eye angles, player position) could be interfered with by other players, teleporters, etc. AFAIK, it's not possible for a regular player to force another player to run a command. ;)
    __________________
    ddhoward is offline
    sheo
    SourceMod Donor
    Join Date: Jul 2013
    Location: Russia, Moscow
    Old 06-07-2014 , 18:30   Re: [TF2] Play Or Leave - a safer method of detecting AFKs [v1.0]
    Reply With Quote #9

    Whats the point of keeping executing console commands without actually playing?
    __________________
    sheo is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 06-07-2014 , 18:36   Re: [TF2] Play Or Leave - a safer method of detecting AFKs [v1.0]
    Reply With Quote #10

    Trade servers where not moving but still using the chat is acceptable.
    __________________
    ddhoward is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 05:38.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode