Skip to main content

A Pyplanet server controller plugin to automatically move players to spectator mode if they are AFK.

Project description

afk

PyPlanet plugin to detect AFK players and move them into spectator mode.

This plugin works by repeatedly querying the player's inputs and checking if the player is currently steering, braking or pressing the gas pedal. If the player is found not to be pressing any inputs for a (configurable) period of time, they are considered AFK and moved to spectator.

The plugin also lets you adda a button to rejoin the game for new players who may be confused with the spectator mode.

Installation

python -m pip install --upgrade pyplanet-afk-spec

Then open settings/apps.py with a text editor and append to the list in 'default':

'feor.afk'

Configuration

  • AFK Duration Allowed: Duration players can stay inactive until they are declared AFK, in seconds. [Default: 120]

  • AFK Check Frequency: Time to wait before querying a player's inputs again, in ms. Lower values may impact performance. [Default: 1000]

  • AFK Wait: Time to wait before checking again whether a player is AFK, in seconds. [Default: 10]

  • Display AFK Message: If this setting is enabled, a message will be displayed when a player is moved to spectator. [Default: True]

  • AFK Message: Message to display when a player is moved to spectator. Use {nickname} to insert the player's nickname. [Default: {nickname}$z has been moved to spectator due to inactivity.]

  • Display Rejoin Button: If this setting is enabled, players in spectator mode will see a "Rejoin Game" button at the center of the screen.

Changelog

0.7.2

  • Renamed plugin

0.7.1

  • Moved position of rejoin button and added icon

0.7.0

  • Added a rejoin button that displays for players in spectator mode
  • Added a setting to disable the rejoin button

0.6.0

  • Removed Grace Period/Timeout Delay settings in favor of a single AFK Wait setting
  • Added Display AFK Message setting
  • Added AFK Message setting
  • Refactored AFK checking code and removed some checks (PendingEvents, UISequence)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyplanet_afk_spec-0.7.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyplanet_afk_spec-0.7.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file pyplanet_afk_spec-0.7.2.tar.gz.

File metadata

  • Download URL: pyplanet_afk_spec-0.7.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.5

File hashes

Hashes for pyplanet_afk_spec-0.7.2.tar.gz
Algorithm Hash digest
SHA256 6e640514c4233c0bcc62a5be36cc3d82909f8587655f4346cd223424a73ade13
MD5 db1ddfb24d0e073a82b96c191fde6e24
BLAKE2b-256 17c5c30cb3c9c0558ed9665c99e2cb296b6d07020484627c1fb1cb064b518e15

See more details on using hashes here.

File details

Details for the file pyplanet_afk_spec-0.7.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyplanet_afk_spec-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e811520ddefd88b69a5d302a79e19222e6a9849c9c86e76b15e3240d6dd0ce47
MD5 1fe9061377339b6c14e664636f04a2fb
BLAKE2b-256 ee1ddc54c6cc49bbb923be2795526d8e7fc37a3cd6e3bfa47e984dcc2393c419

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page