Changelog
All notable changes to this project will be documented in this file.
[3.0.0] — 2025-10-26
🚨 Breaking changes
- Environment variable rename:
.envnow usesAPI_BASE_URLS(plural) instead ofAPI_BASE_URL.
This enables multiple CRCON instances. You must update your environment. See “Migration guide” below. - API request body:
switch_player_nownow sendsplayer_id(Steam64 / platform ID) instead ofplayer_name.
The bot andapi_client.pyhave 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
.envstructure: IntroducedAPI_BASE_URLSto accept a comma-separated list (or JSON array) of base URLs that all share the sameAPI_TOKEN.- Logging: Minor improvements to daily log rotation and compression.
Fixed
- More robust handling of
get_detailed_players/get_gamestateresponses before switching.
Migration guide
1) Update your .env
Rename API_BASE_URL → API_BASE_URLS and list all CRCON endpoints (sharing the same token).
Before
API_BASE_URL=https://rcon.example.com
API_TOKEN=your-shared-tokenAfter (comma-separated)
API_BASE_URLS=https://rcon.example.com,https://rcon2.example.com
API_TOKEN=your-shared-tokenAlternative (JSON array)
API_BASE_URLS=["https://rcon.example.com","https://rcon2.example.com"]
API_TOKEN=your-shared-tokenNotes
• Keep using a singleAPI_TOKENif all instances share it.
• Do not include trailing slashes in URLs.
• Remove unusedUSERNAME/PASSWORDvariables (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.pynow posts{"player_id": "<Steam64>"}to/api/switch_player_now.bot.pydiscovers the correct CRCON by checking eachAPI_BASE_URLSendpoint 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.comDeprecations
- Single-endpoint
API_BASE_URLis kept as a fallback for now, but will be removed in a future major release. Please migrate toAPI_BASE_URLS.