- Players on a playable team are considered active only when their view angles change.
- Spawn AFK tracking starts on player spawn, team change when the player becomes alive on T/CT, and round freeze end for alive T/CT players.
- View angle checks use a small tolerance to avoid false positives from tiny jitter.
- Dead players are ignored and their AFK timer is reset while they wait to respawn.
- Players with no selected team are tracked separately by time spent in the no-team/team-selection state. They are not treated as spectators and are not exempted by
ignore_spectators. - Spectators are ignored by default with
ignore_spectators. This does not ignore players who are still in team selection.
- The plugin checks players on
check_interval_seconds; it does not run AFK detection every server tick. - The default interval is 5 seconds. For very full public servers, 5-10 seconds is a good practical range.
- The periodic check reuses internal collections and caches admin immunity flags to avoid avoidable allocations during normal operation.
- Language files are loaded only on plugin load/config reload, not during every player check.
- Logging is disabled by default. If
log_actionsis enabled, only real actions such as move/kick attempts are logged; repeated warnings are not logged.
The plugin uses the language configured in CounterStrikeSharp ServerLanguage.
Example: if CounterStrikeSharp is configured with ServerLanguage set to es, AFK Manager uses Lang/es.json.
Language files live in:
AfkManager/Lang/
Included files:
de.jsones.jsonen.jsonfr.jsonpt.jsonru.jsonzh.json
Warnings and kick reasons are loaded from the language file. Warnings are chat-only.
All thresholds are seconds. Set a threshold to 0 to disable that stage.
For team players:
spawn_warning_time_seconds: how many seconds before the spawn move action countdown warnings start.spawn_move_to_spectator_time_seconds: moves a player to spectator if they spawned and never moved their view.- After the player has moved their view once,
warning_time_secondscontrols how many seconds before the normal move/kick action countdown warnings start. move_to_spectator_time_seconds: moves the player to spectator once.kick_time_seconds: kicks the player once with the language file'skick_reason. If the plugin already moved the player to spectator, the kick timer can still finish without sending spectator warning spam. Default is0, disabled.
For players who have not chosen a team:
no_team_move_to_spectator_time_seconds: moves them to spectator if they do not choose a team. Default is10.no_team_kick_time_seconds: kicks them withno_team_kick_reason. Ifno_team_move_to_spectator_time_secondsmoved them first, the kick timer can still finish. Default is0, disabled.
Countdown warning steps are controlled by repeat_warning_interval_seconds.
Example: if spawn_move_to_spectator_time_seconds is 15, spawn_warning_time_seconds is 10, and repeat_warning_interval_seconds is 5, the player is warned at 10 seconds remaining and 5 seconds remaining.
If a warning time is higher than the action time, it is capped internally to the action time.
afkmanager/
AfkManager.csproj
AfkManagerPlugin.cs
Config/
AfkManagerConfig.cs
Core/
AfkService.cs
PlayerAfkState.cs
Localization/
AfkLanguage.cs
AfkLanguageManager.cs
Lang/
de.json
es.json
en.json
fr.json
pt.json
ru.json
zh.json
Samples/
afkmanager.example.json
README.md
- Create a plugin folder on the server:
game/csgo/addons/counterstrikesharp/plugins/afkmanager/
- Copy the release output files into that folder.
- Start the server once so CounterStrikeSharp can generate the config, or copy
Samples/afkmanager.example.jsoninto the plugin config location used by your CounterStrikeSharp install. - Adjust thresholds in CounterStrikeSharp's generated plugin config and reload the plugin or run
css_afk_reload.
The active config is normally generated by CounterStrikeSharp under:
game/csgo/addons/counterstrikesharp/configs/plugins/afkmanager/afkmanager.json
css_afk_reload: reload config. Requires@css/config.css_afk_config: print active runtime config values. Requires@css/config.css_afk_enabled: print runtime enabled state. Requires@css/config.css_afk_enabled <0|1>: disable or enable AFK Manager until config reload/map/plugin reload. Requires@css/config.css_afk_status: print status for all players. Requires@css/generic.css_afk_status <name|#userid>: print status for matching players.css_afk_reset: reset your AFK timer. Requires@css/generic.css_afk_reset <name|#userid>: reset a target timer.
- No team balancing logic is included.
- Bot, spectator, and admin immunity behavior are configurable.
- State is cleared on map end, map start, disconnect, plugin unload, and reconnect identity changes.