Monthly Target: $400 Donations: $147
 36% 

Basic AFK Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Liam
SourceMod Developer
Join Date: Jan 2008
Location: Atlanta, GA
Plugin ID:
473
Plugin Version:
2.8
Plugin Category:
Admin Commands
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    77 
    Plugin Description:
    Old 07-20-2008 , 16:03   Basic AFK Manager
    Reply With Quote #1

    This plugin has been designed to handle AFK players. It checks each player every 10 seconds to see if they are still in the same place, and if so, will kick them after a specified amount of time.

    This has been tested on TF2 and CSS.

    Changelog
    1.0
    - Initial Release
    1.1
    - Fixed a bug where it wasn't clearing out the AFK times.
    1.2
    - Adjusted the code to check the clients eye position to verify AFK so that Snipers / Campers don't get kicked for not moving.
    1.3
    - Added a new cVar, sm_minplayerskick, to specify the minimum amount of players to have before kicking.
    - Renamed sm_minplayers to sm_minplayersmove, to specify the minimum amount of players to have before moving them to spec.
    - Suggestion: delete the old afk_manager.cfg so that it can generate a new one with the updated fields.
    1.4
    - Corrected the bad cVar bug that was spamming the log files.
    - Corrected the version info for when the plugin is loaded.
    1.5
    - Corrected the issue with the AFK Manager not kicking players from spec.
    1.6
    - Corrected issue with players not on a team or class in TF2 not getting kicked.
    - Corrected issue with picking a team not resetting the AFK timer.
    - Corrected issue with it not kicking players from spec correctly.
    1.7
    - Rewrote the handlers that checked the players view. It was not updating on the fly, so if the player ever moved from spawn, they would not be counted as AFK.
    - Corrected a bug in the code that prevented players from getting kicked.
    - Corrected a bug in the code that made the plugin ignore players and not bots. (Yes, I had a ! in the wrong place )
    - NOTE: Unload Sourcemod when you reload this, or reboot your server. I removed some of the event hooks and we need to make sure they're cleared.
    1.8
    - Added a check in to deal with dead players.
    1.9
    - Fixed the glitch that prevented spectating players from getting kicked.
    2.0
    - Added in PrintToChat messages to notify the in-game players when someone was moved/kicked.
    2.1
    - Moved the Log and Kick messages above KickClient( ) to get rid of errors.
    2.2
    - Added in debug messages which can be enabled by setting _DEBUG to 1.
    - Moved the check for MinPlayers, which shouldn't make any difference.
    - Added a timer to delay the start of AFK checking so players have time to join the game.
    2.3
    - Corrected issues with the plugin kicking admins.
    - Corrected issues with the plugin not paying attention to the MinPlayerCount restrictions.
    2.4
    - Corrected an issue where players joined a team from spec and got moved back because the AFK Timer wasn't reset.
    2.5
    - Fixed a bug where dead players would get moved to spec if they were floating in one place and didn't move for the afk timelimit.
    2.6
    - Added support for Synergy.
    - Corrected a bug in the 'same place' eye check.
    2.7
    - Corrected an issue with TF2 Arena moving players into 'Waiting to Play' instead of 'Spectate'.
    - Corrected a bug where if a player moved in the last few seconds before a kick it would not register their movement and kick them anyway.
    2.8
    - fixed hook event issue with CSS

    cVars:
    - sm_afkenable - Enable or Disable the AFK manager
    - sm_minplayersmove - Minimum number of players needed before AFK players are moved to spec.
    - sm_minplayerskick - Minimum number of players needed before AFK players are kicked from spec.
    - sm_adminsimmune - Are admins immune to being kicked for AFK? (Note: They'll still get moved to spec)
    - sm_movespec - Move AFK players to spec before kicking them.
    - sm_timetomove - Amount of time to wait before moving an AFK player.
    - sm_timetokick - Amount of time to wait before kicking an AFK player.

    Please let me know if you experience any issues or problems. The cfg file should be in cfg\sourcemod\afk_manager.cfg.
    Attached Files
    File Type: sp Get Plugin or Get Source (afkmanager.sp - 10095 views - 10.3 KB)
    __________________
    Please don't PM me for support of my plugins. If you have a question, reply in the appropriate thread.

    Weapon Restrictions w/ Warmup
    High Ping Kicker - Lite Edition
    AFK Manager

    Last edited by Liam; 09-10-2010 at 11:23.
    Liam is offline
    PStar
    Veteran Member
    Join Date: Mar 2008
    Old 07-20-2008 , 16:19   Re: AFK Manager
    Reply With Quote #2

    Hmm doesn't it put a heavy load on a big server? If every player is chechked in 10 sec? I think it would be enough to check for 20 sec or 30 sec.
    Anyway nice to have an old plugin reworked to get it working.
    PStar is offline
    Kigen
    BANNED
    Join Date: Feb 2008
    Old 07-20-2008 , 16:21   Re: AFK Manager
    Reply With Quote #3

    Quote:
    Originally Posted by PStar View Post
    Hmm doesn't it put a heavy load on a big server? If every player is chechked in 10 sec? I think it would be enough to check for 20 sec or 30 sec.
    Anyway nice to have an old plugin reworked to get it working.
    Not really.

    Now if it was in a callback like OnGameFrame() then it would be a heavy load on the server.
    Kigen is offline
    Liam
    SourceMod Developer
    Join Date: Jan 2008
    Location: Atlanta, GA
    Old 07-20-2008 , 16:27   Re: AFK Manager
    Reply With Quote #4

    I didn't notice any CPU difference running this every 10 seconds. Your only talking about 20-30 iterations of a loop, which is done in less than one second.
    Liam is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 07-20-2008 , 16:40   Re: AFK Manager
    Reply With Quote #5

    Quote:
    Originally Posted by Liam View Post
    I didn't notice any CPU difference running this every 10 seconds. Your only talking about 20-30 iterations of a loop, which is done in less than one second.
    More like 0.0001 seconds
    __________________
    Greyscale is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 07-20-2008 , 16:47   Re: AFK Manager
    Reply With Quote #6

    When you say amount of time to kick is it in minutes, seconds, or miliseconds lol. nvm, didnt know it created its own cfg.
    __________________


    Last edited by DontWannaName; 07-20-2008 at 17:38.
    DontWannaName is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 07-20-2008 , 19:16   Re: AFK Manager
    Reply With Quote #7

    How does it handle players who were bumped by teamates in TF2?
    bl4nk is offline
    Jokerz99
    Senior Member
    Join Date: Apr 2008
    Old 07-20-2008 , 19:35   Re: AFK Manager
    Reply With Quote #8

    Quote:
    Originally Posted by DontWannaName View Post
    When you say amount of time to kick is it in minutes, seconds, or miliseconds lol. nvm, didnt know it created its own cfg.

    seconds
    __________________
    Jokerz99 is offline
    Kigen
    BANNED
    Join Date: Feb 2008
    Old 07-20-2008 , 20:08   Re: AFK Manager
    Reply With Quote #9

    Quote:
    Originally Posted by bl4nk View Post
    How does it handle players who were bumped by teamates in TF2?
    Well, since its checking the player's eye position it'll probably see them as moving. I played with eye positions when I recreated Death Match in a SourceMod plugin (making it so you could get newer guns when you went back to your spawn point).
    Kigen is offline
    Liam
    SourceMod Developer
    Join Date: Jan 2008
    Location: Atlanta, GA
    Old 07-20-2008 , 20:38   Re: AFK Manager
    Reply With Quote #10

    It doesn't check their eyeposition, it checks their physical location.
    Liam is offline
    Reply


    Thread Tools
    Display Modes

    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 22:31.


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