2 XML Schema and Validation
Frank Harris edited this page 2026-06-20 13:04:55 -05:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

XML Schema and Validation

This page documents how GSP validates game template XML, where the schema lives, and which current differences have been confirmed against the older OGP XML documentation.

Current Validation Files

Primary files in the current panel tree:

  • Panel/Panel/modules/config_games/schema_server_config.xml
  • Panel/Panel/modules/config_games/server_config_parser.php
  • Panel/Panel/modules/config_games/tests/validate_server_configs.php
  • Panel/Panel/modules/config_games/xml_tag_descriptions.php

Runtime Validation Flow

The current parser in server_config_parser.php uses a schema-validated load path:

  1. load the XML with DOM support
  2. validate it against schema_server_config.xml
  3. import the validated DOM into SimpleXML for normal runtime access

That is materially stronger than documentation-only validation. Current GSP expects template files to be both well-formed and schema-valid.

Developer Validation Workflow

When editing a game template or the schema:

  1. update the XML file under Panel/Panel/modules/config_games/server_configs/
  2. keep the element order aligned with the schema
  3. run the bundled validation script
  4. fix every parse or schema error before treating the change as complete

Validation command:

php Panel/modules/config_games/tests/validate_server_configs.php

What The Schema Covers

The current schema validates the classic OGP-era template structure, including:

  • identification tags such as game_key and game_name
  • query and control protocol tags
  • installer and mod definitions
  • CLI templates and CLI parameter definitions
  • reserved ports
  • replace-text instructions
  • custom fields
  • player parsing and player actions
  • lifecycle scripts
  • environment variables
  • lock files
  • configuration file registration

The detailed tag guide remains in Game Template XML.

Confirmed GSP XML Differences

Compared with the older OGP XML notes, the current GSP schema clearly includes additional or more explicit behavior.

1. workshop_support block

Current GSP includes a schema-level workshop_support section. This is the largest confirmed difference from the older upstream XML notes.

Confirmed child tags:

  • enabled
  • provider
  • steam_app_id
  • workshop_app_id
  • download_method
  • install_strategy
  • install_path
  • startup_param_format
  • mod_separator
  • mod_prefix
  • mod_folder_format
  • copy_keys
  • post_install_action

2. Expanded control protocol values

Current schema confirms support for:

  • rcon
  • rcon2
  • lcon
  • armabe

and also confirms control_protocol_type values:

  • new
  • old

3. Expanded mod metadata

Current schema confirms additional mod fields beyond the older basic examples:

  • installer_login
  • betaname
  • betapwd
  • steam_bitness

4. Expanded replace-text metadata

Current schema confirms additional replacement fields:

  • alltext
  • occurrence

5. Expanded server parameter structure

Current schema confirms richer parameter metadata:

  • group
  • attribute
  • default
  • access

6. Configuration file metadata

Current schema confirms configuration_files entries with file descriptions.

Current Source Evidence

The following current templates are useful concrete examples:

  • Panel/Panel/modules/config_games/server_configs/arma3_linux64.xml
  • Panel/Panel/modules/config_games/server_configs/arma3_win64.xml
  • Panel/Panel/modules/config_games/server_configs/garrysmod_linux.xml
  • Panel/Panel/modules/config_games/server_configs/dayz_epoch_mod_win32.xml

These files demonstrate both classic template structure and current GSP additions.

Git History Notes

Current Panel history shows multiple XML-related changes, including:

  • 5a03946b woekshop phase 1
  • 69f415ad feat(steam_workshop): production rewrite with full admin profile page and server settings
  • 6d9cd28a feat: Server Content Phase 2 schema, cache mode setting, install history, manifest, requires_stop
  • de80f896 fix: wrap DayZ post_install scripts in CDATA, add XML editor auto-sanitizer
  • d564476d feat: GSP 1.0 baseline module versions, FAQ refresh, XML editor validation, Obsidian theme
  • 3e704551 removed .32bit xml files

From those commits, the most defensible current conclusions are:

  • Workshop-aware XML support has been added and revised in GSP.
  • XML editor and validation behavior has been actively maintained.
  • Some legacy templates were removed or consolidated over time.

How Admins And Developers Should Validate XML

  • use the schema validator before deploying a modified template
  • keep examples aligned with real files already present in server_configs/
  • treat parser or schema failures as blocking errors
  • verify any script-heavy template changes, especially post_install, with extra care because GSP history shows active fixes in that area

Needs Verification

  • exact commit-by-commit introduction point for every new XML tag
  • whether any runtime-only compatibility behavior accepts out-of-schema legacy tags
  • whether all XML tag descriptions in xml_tag_descriptions.php fully match the runtime parser semantics