Skip to content

Add auto-kick for inactive players

Hanicef requested to merge Hanicef/SRB2:add-auto-kick-idle-players into next

This feature is something that most game with multiplayer capabilities tend to have, and for good reasons, since AFK players can stall a game for an extended period of time. SRB2 is no exception here: it's a pretty common issue that some servers have no mechanism to take care of players that remains inactive for an extended period of time, which can stall maps for hours as one player remains AFK while everyone else are collectively playing as Tails, carrying the AFK player throughout the entire damn map. With this feature, though, players that remain AFK will just be automatically kicked if they remain inactive for an extended period of time.

The auto-kick timeout can be configured with the idletime console variable, which is the amount of time that players are allowed to remain idle until are disconnected. It defaults to 0, which means it's disabled by default. in addition, it also exposes lastinputtime on player_t in Lua, so addon developers can use it for custom idle logic.

Edited by Hanicef

Merge request reports