Skip to main content

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

Project description

afk_spec

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_spec'

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.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.1.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.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyplanet_afk_spec-0.7.1.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.1.tar.gz
Algorithm Hash digest
SHA256 56c2ef5050e116e04ca880b0a6aec3b160823cb7c8236ce0e0308c4677a19242
MD5 e0d7d1b18c4e95d736a9826ec42e54ee
BLAKE2b-256 d4936dd829c035605eabb3cf67a364c44604af84bd0fb43a4f0b2883826b3814

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyplanet_afk_spec-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46518fc8850eceed6c493d863a02c99a8529a434a90928ab2c63d92e2f341394
MD5 decd881e0cc601c249b5910d9ab99757
BLAKE2b-256 d0673cc56a99e12f1b19173a612e4fbc383f104079f3e860d193c76c4cddc51a

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