Skip to content

Conversation

Copy link

Copilot AI commented Jul 7, 2025

Implements automatic match config loading when a map starts, similar to the Get5 get5_autoload_config ConVar functionality.

Changes Made

New ServerConfig Properties

  • autoload_config: URL or file path to automatically load match config on map start
  • autoload_config_auth_token: Optional authentication token for URL-based config loading

Implementation Details

  • Modified OnMapStartHandler to check for autoload configuration when no match is running
  • Added TryAutoloadConfig async method that handles both URL and file-based config loading
  • Automatic detection of URL vs file path using Uri.TryCreate
  • Reuses existing LoadMatchConfigFromUrlAsync and LoadMatchConfigFromFileAsync methods
  • Proper error handling and logging for troubleshooting

Example Configuration

{
  "locale": "en",
  "allow_players_without_match": true,
  "autoload_config": "https://example.com/match-config.json",
  "autoload_config_auth_token": "your-auth-token-here"
}

Behavior

  • Trigger: When a map starts (OnMapStart event)
  • Condition: Only loads config if no match is currently running
  • Source: Automatically detects URL vs file path
  • Authentication: Uses auth token for URL requests when provided
  • Logging: Comprehensive logging for success/failure scenarios

Testing

  • Added comprehensive unit tests for ServerConfig serialization/deserialization
  • Verified JSON property names match expected format
  • All existing tests continue to pass
  • Both Debug and Release builds successful

This feature streamlines match setup for tournament servers, scrim servers, and event environments by eliminating the need for manual config loading.

Fixes #331.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 127.0.0.11

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Feature Request: Automatically load a match config on map load Feature: Automatically load match config on map start Jul 7, 2025
Copilot AI requested a review from MD-V July 7, 2025 08:29
Copilot finished work on behalf of MD-V July 7, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Automatically load a match config on map load

2 participants