fix: 1.4.35 hotfix: demo file names and path (#35), upload log wording, database.json kept on update - #36
Merged
Conversation
(cherry picked from commit 9e0a75f)
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>
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, notdev(devhas 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 andrelease.sh patchmakes it 1.4.35.Changes
matchzy_demo_name_formatwith only spaces replaced, so a workshop map (workshop/<id>/de_mirage) put slashes in it, and team names with/ \ : ; " ' | ? *or symbols like the reporter'sSadBoy ♥broketv_record(or;split the command). Newsrc/DemoFileName.cs(no CounterStrikeSharp dependency, unit tested) builds the file name:-,_,.; 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{TIME}_{MATCH_ID}matchzy_demo_pathfolder is left as configuredКоманда→Komanda,Café→Cafe; other scripts and symbols →_). The name is also sent in theMatchZy-FileName/Get5-FileNameupload headers, and I checked in the .NET 8 SDK image:HttpClientrefuses non-ASCII header values (Request headers must contain only ASCII characters). So a Cyrillic or♥demo name could never be uploaded, even iftv_recordwrote 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.2026-09-24_20-57-56_9_de_mirage_Team_A_vs_Team_B).tv_recordgot a relative path, and a relative path lands in the first writable Game search path. Metamod putscsgo/addons/metamodfirst ingameinfo.gi, so demos were written tocsgo/addons/metamod/MatchZy/while the plugin logged, and later searched,csgo/MatchZy/. This probably also caused the platform's demo uploads failing withfile_not_foundon Metamod servers, which is every csm server.tv_recordnow gets the absolute path<game>/csgo/<demo path><file>.dem. The reporter's manualtv_record /home/container/game/csgo/MatchZy/testdemoshows CS2 accepts that. The logged "Full path" is now the path actually used./separators (backslashes in the game directory are converted, and Windows accepts/), and it is quoted only when it contains a space, e.g. underProgram Files. The usual Linux path is passed unquoted, exactly like the reporter's command. I couldn't try a Windows server.DemoFileLocator.CandidateDirectories) also looks incsgo/addons/metamod/<demo path>andcsgo/addons/metamod, so demos recorded by older builds, or if an absolute path is ever refused, are still found.matchzy_demo_pathwithout a trailing/no longer runs into the file name (MatchZy2026-…dem).UploadFileAsynctoo. Without an upload URL (plugin used without the platform), every round logged three lines callingMatchZyDataBackup/matchzy_9_0_round00.jsona "Demo file". Now it's one line per match and file kind, naming the kind and its convar (matchzy_demo_upload_urlormatchzy_remote_backup_url). Round backup uploads log[BACKUP_UPLOAD]markers and no longer senddemo_upload_*events or the "Demo upload succeeded" chat line.[DEMO_UPLOAD]markers for demos are unchanged; neither the platform nor csm parses them.mp_roundtime_hostage 60inprac.cfg.MatchZy-<version>.zip.database.jsonis 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 MySQLdatabase.jsonon 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.gh release create --target <release commit>. Without it, GitHub creates the tag on the default branch (dev, 2.x).v2.0.0).config.cfgthere, nodatabase.json) before committing or publishing anything.unzipis added to the workflow's apt line.Auto-Tournament/cs2-plugin.--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 Releasehas 0 errors, anddotnet test tests/MatchZy.Testspasses 321 tests. 37 newDemoFileNameTestscases: workshop map,SadBoy ♥,/ \ : ; " ' | ? * < >, emoji, Cyrillic, accents, CJK fallback, empty format, length cap, and the fallback search finding the sanitised name. 10 newDemoFileLocatorTestscases: absolutetv_recordpath (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 underaddons/metamod/MatchZy/being found.release.shin the same image.MatchZy-1.4.35.ziphasaddons/counterstrikesharp/plugins/MatchZy/MatchZy.dllandcfg/MatchZy/*withoutdatabase.json.Releasing 1.4.35
Merge this into
hotfix/1.4.x, then run the Release workflow onhotfix/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" tohotfix/1.4.x, pushes that branch only, tags that commitv1.4.35and marks it latest. It doesn't touchdev.🤖 Generated with Claude Code