From 293066cbfd0587c3ad5889903615cebc252d75b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 22 Nov 2025 22:40:38 +0000 Subject: [PATCH] Address code review feedback - Fix option text handling to check for None instead of falsy - Improve HTML cleaning with html.unescape and better tag removal - Fix multi-line string in die() function - Add html module import for proper HTML entity handling Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com> --- modules/billing/docs/tf2/index.php | 114 ++++++++++++++++++++++++++--- push_to_github.sh | 3 +- tools/generate_game_docs.py | 12 ++- 3 files changed, 113 insertions(+), 16 deletions(-) diff --git a/modules/billing/docs/tf2/index.php b/modules/billing/docs/tf2/index.php index 5c0e278e..b1bba812 100644 --- a/modules/billing/docs/tf2/index.php +++ b/modules/billing/docs/tf2/index.php @@ -223,18 +223,110 @@ setadminpassword [password]

⚙️ Startup Parameters

-

Basic Startup

-
./srcds_run -console -game tf -ip 0.0.0.0 -port 27015 +map cp_dustbowl +maxplayers 24 +exec server.cfg
-
+

Command Line Template

+

The server uses the following command line template:

+
-console %GAME_TYPE% %PID_FILE% %MAP% %IP% %PORT% %PLAYERS% -condebug
-

Common Parameters

- +

Available Startup Parameters

+

The following parameters can be configured when starting the server:

+ +
+ +
+

+ +sv_setsteamaccount + - Steam Account Login Token +

+

Manage your steam tokens here

+
+ +
+

+ -sv_pure + - Pure Server +

+

A pure server is one that forces all clients on the server to use content that matches what is on the server.

+

Options:

+ +
+ +
+

+ -dev + - Developer Messages. +

+

Show developer messages.

+
+ +
+

+ -debuglog custom_error.log + - Error Logging +

+

File Errors are Logged to.

+
+ +
+

+ -debug + - Debugging +

+

Turns on Debugging.

+
+ +
+

+ +motdfile custom_motd.txt + - Custom MOTD +

+

Custom MOTD file.

+
+ +
+

+ +mapcyclefile custom_mapcycle.txt + - Custom Mapcycle +

+

Custom Mapcycle file.

+
+ +
+

+ -nomaster + - Disable master server communication +

+

No description available

+
+ +
+

+ -insecure + - Disable Valve Anti-Cheat +

+

Will start the server without Valve Anti-Cheat technology.

+
+ +
+

+ -nohltv + - No SourceTV +

+

Disables SourceTV and closes its port.

+
+ +
+

+ -norestart + - No Restart +

+

Won't attempt to restart failed servers.

+
+

Creating a Start Script

diff --git a/push_to_github.sh b/push_to_github.sh index fc8e8bc0..de6e4fe7 100644 --- a/push_to_github.sh +++ b/push_to_github.sh @@ -72,8 +72,7 @@ if [[ -s "$TOKEN_FILE" ]]; then elif [[ -n "${GITHUB_TOKEN:-}" ]]; then TOKEN="$GITHUB_TOKEN" else - die "GitHub token not found. Set GITHUB_TOKEN env var or create $TOKEN_FILE with your token. - Get a token at: https://github.com/settings/tokens (requires 'repo' scope)" + die "GitHub token not found. Set GITHUB_TOKEN env var or create $TOKEN_FILE with your token. Get a token at: https://github.com/settings/tokens (requires 'repo' scope)" fi [[ ${#TOKEN} -ge 10 ]] || die "Token looks invalid (too short)" diff --git a/tools/generate_game_docs.py b/tools/generate_game_docs.py index 8f30242b..31d423d9 100755 --- a/tools/generate_game_docs.py +++ b/tools/generate_game_docs.py @@ -45,6 +45,7 @@ import json import yaml import re import argparse +import html from pathlib import Path from datetime import datetime import xml.etree.ElementTree as ET @@ -193,7 +194,7 @@ class GameDocGenerator: if param_type == 'select': for option in param.findall('option'): opt_value = option.get('value', '') - opt_text = option.text if option.text else opt_value + opt_text = option.text if option.text is not None else opt_value options.append({'value': opt_value, 'text': opt_text}) startup_params.append({ @@ -622,8 +623,13 @@ setadminpassword [password] default = param.get('default') options = param.get('options', []) - # Clean HTML from description - description_clean = re.sub(r'<[^>]+>', '', description) if description else "No description available" + # Clean HTML from description - unescape HTML entities and remove tags + if description: + description_clean = html.unescape(description) + # Remove HTML tags (simple but effective for our use case) + description_clean = re.sub(r'<[^<>]+>', '', description_clean) + else: + description_clean = "No description available" php_doc += f'''