Skip to content

fix: 1.4.35 hotfix: demo file names and path (#35), upload log wording, database.json kept on update - #36

Merged
sivert-io merged 6 commits into
hotfix/1.4.xfrom
hotfix/1.4.35
Sep 24, 2026
Merged

sivert-io merged 6 commits into
hotfix/1.4.xfrom
hotfix/1.4.35

Conversation

@sivert-io

@sivert-io sivert-io commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Hotfix for the 1.4.x line, which the current platform (2.x and the 3.0 betas) talks to. Branched from v1.4.34, not dev (dev has the 2.0.0 rename). This doesn't change any name, header or convar, so it works with the current platform. Not released; the version is still 1.4.34 and release.sh patch makes it 1.4.35.

Changes

  1. Demo file names are safe (fixes [QUESTION] How does the demo work? #35). The name was matchzy_demo_name_format with only spaces replaced, so a workshop map (workshop/<id>/de_mirage) put slashes in it, and team names with / \ : ; " ' | ? * or symbols like the reporter's SadBoy ♥ broke tv_record (or ; split the command). New src/DemoFileName.cs (no CounterStrikeSharp dependency, unit tested) builds the file name:
    • keeps ASCII letters, digits, -, _, .; everything else becomes _; repeats of _/. collapse; _/. are trimmed from the ends (no hidden files, no ..); capped at 180 characters
    • {MAP} is the last segment of a workshop map name
    • never empty: falls back to {TIME}_{MATCH_ID}
    • only the file name; the matchzy_demo_path folder is left as configured
    • Non-ASCII letters are transliterated, not kept (Команда → Komanda, Café → Cafe; other scripts and symbols → _). The name is also sent in the MatchZy-FileName / Get5-FileName upload headers, and I checked in the .NET 8 SDK image: HttpClient refuses non-ASCII header values (Request headers must contain only ASCII characters). So a Cyrillic or ♥ demo name could never be uploaded, even if tv_record wrote it.
    • activeDemoFile, the demo events and the upload all use this name, and the upload's fallback search (DemoFileLocator) now looks for the same {MAP} token.
    • Names that were already safe come out the same as before (2026-09-24_20-57-56_9_de_mirage_Team_A_vs_Team_B).
  2. Demos are recorded where the plugin looks for them ([QUESTION] How does the demo work? #35). tv_record got a relative path, and a relative path lands in the first writable Game search path. Metamod puts csgo/addons/metamod first in gameinfo.gi, so demos were written to csgo/addons/metamod/MatchZy/ while the plugin logged, and later searched, csgo/MatchZy/. This probably also caused the platform's demo uploads failing with file_not_found on Metamod servers, which is every csm server.
    • tv_record now gets the absolute path <game>/csgo/<demo path><file>.dem. The reporter's manual tv_record /home/container/game/csgo/MatchZy/testdemo shows CS2 accepts that. The logged "Full path" is now the path actually used.
    • Windows: the path uses / separators (backslashes in the game directory are converted, and Windows accepts /), and it is quoted only when it contains a space, e.g. under Program Files. The usual Linux path is passed unquoted, exactly like the reporter's command. I couldn't try a Windows server.
    • The upload search (DemoFileLocator.CandidateDirectories) also looks in csgo/addons/metamod/<demo path> and csgo/addons/metamod, so demos recorded by older builds, or if an absolute path is ever refused, are still found.
    • A matchzy_demo_path without a trailing / no longer runs into the file name (MatchZy2026-…dem).
  3. Upload logs name the right file (from the [QUESTION] How does the demo work? #35 log). Round backup JSON files go through UploadFileAsync too. Without an upload URL (plugin used without the platform), every round logged three lines calling MatchZyDataBackup/matchzy_9_0_round00.json a "Demo file". Now it's one line per match and file kind, naming the kind and its convar (matchzy_demo_upload_url or matchzy_remote_backup_url). Round backup uploads log [BACKUP_UPLOAD] markers and no longer send demo_upload_* events or the "Demo upload succeeded" chat line. [DEMO_UPLOAD] markers for demos are unchanged; neither the platform nor csm parses them.
  4. Backport of fix(practice): add mp_roundtime_hostage to prac.cfg #29: mp_roundtime_hostage 60 in prac.cfg.
  5. Backport of fix: title GitHub releases as Auto Tournament CS2, not MatchZy #30: GitHub releases are titled "Auto Tournament CS2 v…". The asset stays MatchZy-<version>.zip.
  6. database.json is no longer in the release zip (the one fix in feat!: rename the plugin to Auto Tournament CS2 (2.0.0) #32 that doesn't depend on the rename). The shipped SQLite default overwrote an operator's MySQL database.json on every update, so their match history seemed to disappear. The plugin already writes the default when the file is missing. The zip layout (MatchZy-<version>/addons, /cfg) is unchanged.
  7. The release script works from this branch:
    • gh release create --target <release commit>. Without it, GitHub creates the tag on the default branch (dev, 2.x).
    • The changelog (release notes and Discord) starts at the newest tag reachable from HEAD, not the newest tag in the repo (v2.0.0).
    • It checks the zip (DLL and config.cfg there, no database.json) before committing or publishing anything. unzip is added to the workflow's apt line.
    • It refuses non-1.x versions, a detached HEAD, and a tag that already exists on origin.
    • The Discord post uses the Auto Tournament CS2 name and links to Auto-Tournament/cs2-plugin.
    • It keeps --latest, so 1.4.35 becomes "latest" and v2.0.0 stays a pre-release.

Not backported

Verification

  • mcr.microsoft.com/dotnet/sdk:8.0: dotnet build -c Release has 0 errors, and dotnet test tests/MatchZy.Tests passes 321 tests. 37 new DemoFileNameTests cases: workshop map, SadBoy ♥, / \ : ; " ' | ? * < >, emoji, Cyrillic, accents, CJK fallback, empty format, length cap, and the fallback search finding the sanitised name. 10 new DemoFileLocatorTests cases: absolute tv_record path (Linux, trailing slashes, empty and leading-slash demo paths, Windows backslashes), quoting only with spaces, the Metamod folders in the search list, and a demo recorded under addons/metamod/MatchZy/ being found.
  • I ran the packaging part of release.sh in the same image. MatchZy-1.4.35.zip has addons/counterstrikesharp/plugins/MatchZy/MatchZy.dll and cfg/MatchZy/* without database.json.

Releasing 1.4.35

Merge this into hotfix/1.4.x, then run the Release workflow on hotfix/1.4.x: gh workflow run release.yml -R Auto-Tournament/cs2-plugin --ref hotfix/1.4.x -f bump_type=patch. It commits "Release v1.4.35" to hotfix/1.4.x, pushes that branch only, tags that commit v1.4.35 and marks it latest. It doesn't touch dev.

🤖 Generated with Claude Code

andrewyazura and others added 6 commits September 24, 2026 19:59
The project (formerly MatchZy Enhanced) is now Auto Tournament CS2, but
release.sh still titled every GitHub release "MatchZy v<version>".
Change only the human-readable release title; asset file names, the
plugin's folder/DLL names, cvars, and commands are untouched so existing
installs keep working.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 32e3643)
The demo name was matchzy_demo_name_format with only spaces replaced.
A workshop map name (workshop/<id>/<map>) put slashes into it, and team
names with / \ : ; " ' | ? * or symbols like ♥ gave tv_record a path
that doesn't exist, or split the console command at ';'.

The file name (not the matchzy_demo_path folder) now keeps only ASCII
letters, digits, '-', '_' and '.', collapses repeats, uses the last
segment of a workshop map name for {MAP}, and falls back to
{TIME}_{MATCH_ID} when nothing usable is left. Cyrillic is
transliterated and accents dropped rather than kept: the name is also
sent in the MatchZy-FileName/Get5-FileName upload headers, and .NET's
HttpClient refuses non-ASCII header values, so such a demo could never
be uploaded. The upload fallback search uses the same map token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… once per match

Round backup JSON files go through UploadFileAsync too. Without an
upload URL (plugin used without the platform) every round logged three
lines calling the backup a "Demo file". Now one line per match and file
kind names the file kind and its convar. Backup uploads log
[BACKUP_UPLOAD] markers and no longer send demo_upload_* events or the
"Demo upload succeeded" chat line. [DEMO_UPLOAD] markers for demos are
unchanged (neither the platform nor csm parses them).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fix/1.4.x

- The zip shipped cfg/MatchZy/database.json with the SQLite default,
  which overwrote an operator's MySQL settings on every update. The
  plugin already writes the default when the file is missing.
- Check the zip (DLL and config.cfg present, no database.json) before
  anything is committed or published; unzip added to the workflow.
- gh release create --target <release commit>: without it GitHub tags
  the default branch (dev, 2.x).
- Changelog and Discord changelog start at the newest tag reachable from
  HEAD, not the newest tag in the repo (v2.0.0).
- Refuse non-1.x versions, detached HEAD, and tags that already exist on
  origin.
- Discord post uses the Auto Tournament CS2 name and links to
  Auto-Tournament/cs2-plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a relative path tv_record writes to the first writable Game search
path. Metamod adds csgo/addons/metamod first in gameinfo.gi, so demos
landed in csgo/addons/metamod/MatchZy/ while the plugin logged, and
looked for them in, csgo/MatchZy/. The upload then failed with
file_not_found.

tv_record now gets <game>/csgo/<demo path><file> with '/' separators,
quoted only when it contains a space (Windows under Program Files). The
logged full path is the one used. The upload search also looks in
csgo/addons/metamod/<demo path> and csgo/addons/metamod, so demos
recorded by older builds are still found. A demo path without a trailing
'/' no longer runs into the file name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sivert-io sivert-io changed the title fix: 1.4.35 hotfix: safe demo file names (#35), upload log wording, database.json kept on update fix: 1.4.35 hotfix: demo file names and path (#35), upload log wording, database.json kept on update Sep 24, 2026
@sivert-io
sivert-io merged commit 3f710b0 into hotfix/1.4.x Sep 24, 2026
1 check passed
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.

2 participants