Skip to content

3.0.0

Latest

Choose a tag to compare

@bumseb1ene bumseb1ene released this 25 Oct 22:20
· 2 commits to main since this release

Changelog

All notable changes to this project will be documented in this file.

[3.0.0] — 2025-10-26

🚨 Breaking changes

  • Environment variable rename: .env now uses API_BASE_URLS (plural) instead of API_BASE_URL.
    This enables multiple CRCON instances. You must update your environment. See “Migration guide” below.
  • API request body: switch_player_now now sends player_id (Steam64 / platform ID) instead of player_name.
    The bot and api_client.py have been updated accordingly.

Added

  • Multi-RCON support: The bot can query multiple CRCON endpoints and automatically selects the correct one based on where the player is currently connected.
  • Resilient player lookup: ID-first matching with safe fallback to name match when needed.
  • Queue logic across servers: The switch queue re-detects the player’s current server at processing time (no stale server binding).

Changed

  • .env structure: Introduced API_BASE_URLS to accept a comma-separated list (or JSON array) of base URLs that all share the same API_TOKEN.
  • Logging: Minor improvements to daily log rotation and compression.

Fixed

  • More robust handling of get_detailed_players / get_gamestate responses before switching.

Migration guide

1) Update your .env

Rename API_BASE_URLAPI_BASE_URLS and list all CRCON endpoints (sharing the same token).

Before

API_BASE_URL=https://rcon.example.com
API_TOKEN=your-shared-token

After (comma-separated)

API_BASE_URLS=https://rcon.example.com,https://rcon2.example.com
API_TOKEN=your-shared-token

Alternative (JSON array)

API_BASE_URLS=["https://rcon.example.com","https://rcon2.example.com"]
API_TOKEN=your-shared-token

Notes
• Keep using a single API_TOKEN if all instances share it.
• Do not include trailing slashes in URLs.
• Remove unused USERNAME / PASSWORD variables (not used by the current code).
• Never commit real tokens to your repository.

2) No DB migration required

The existing users(discord_id, steam_id, player_name) table remains valid.
steam_id is used as player_id for switching.

3) Code expectations

  • api_client.py now posts {"player_id": "<Steam64>"} to /api/switch_player_now.
  • bot.py discovers the correct CRCON by checking each API_BASE_URLS endpoint for the player presence.

Examples

Minimal .env example

DISCORD_BOT_TOKEN=your-discord-bot-token
ALLOWED_CHANNEL_ID=123456789012345678
LANGUAGE=de
DB_FILE=switch.db
COMMAND_SWITCH=switch
COMMAND_REG=reg

API_TOKEN=your-shared-token
API_BASE_URLS=https://rcon.example.com,https://rcon2.example.com

Deprecations

  • Single-endpoint API_BASE_URL is kept as a fallback for now, but will be removed in a future major release. Please migrate to API_BASE_URLS.