feat!: rename the plugin to Auto Tournament CS2 (2.0.0) - #32
Merged
Merged
Conversation
MatchZy becomes Auto Tournament CS2, outright, with no aliases: matchzy_* console variables and commands are at_*, the plugin is AutoTournamentCS2.dll in plugins/AutoTournamentCS2/, config lives in cfg/AutoTournamentCS2/, the chat tag is [Auto Tournament], the SQLite file is auto_tournament_cs2.db, tables are at_*, and the plugin authenticates with X-Auto-Tournament-Token. The C# namespace and types are renamed too. MatchZy remains only in the credit line and the upstream licence notice. On first start, LegacyCarryOver moves cfg/MatchZy/, renames matchzy.db and the matchzy_* tables (one RENAME TABLE on MySQL), and re-keys saved settings, never overwriting or deleting and logging every step. The release asset is AutoTournamentCS2-<version>.zip with addons/ and cfg/ at its root and without database.json. Version 2.0.0. BREAKING CHANGE: old matchzy_* names are not read; platform 3.0 and csm must use the at_* names, the new header and the new asset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…0.0) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Renames the plugin from MatchZy to Auto Tournament CS2, outright, as 2.0.0, following
brand/RENAME-3.0.md. No aliases and no fallback: oldmatchzy_*lines in a config file are not read. Existing installs are carried over once, on the first start of 2.0.0.Not released. The version is set to 2.0.0 in
src/AutoTournamentCS2.cs(whererelease.shreads it). Release order per the rename doc: this plugin release, then csm, then platform 3.0.What changed
matchzy_*at_*(full list below)matchzy match load <url>at match load <url>plugins/MatchZy/MatchZy.dllplugins/AutoTournamentCS2/AutoTournamentCS2.dllcfg/MatchZy/cfg/AutoTournamentCS2/[MatchZy][Auto Tournament]matchzy.dbauto_tournament_cs2.dbmatchzy_stats_matches,matchzy_stats_maps,matchzy_stats_players,matchzy_server_config,matchzy_event_queueat_*X-MatchZy-TokenX-Auto-Tournament-TokenMatchZy-<version>.zipAutoTournamentCS2-<version>.zipMatchZy,MatchZy*Event, ...AutoTournamentCS2,AutoTournamentCS2*Event, ...tests/MatchZy.Teststests/AutoTournamentCS2.TestsModuleNameMatchZyAuto Tournament CS2Not in the name table (derived the same way; please add them to it)
MatchZy-FileName,MatchZy-MatchId,MatchZy-MapNumber,MatchZy-RoundNumber→Auto-Tournament-FileName,Auto-Tournament-MatchId,Auto-Tournament-MapNumber,Auto-Tournament-RoundNumber. TheGet5-*copies are still sent. Platform 2.x readsGet5-*as a fallback, so demo uploads keep working. Platform 3.0 has to read theauto-tournament-*names (api/src/integrations/cs2/routes/demos.ts) or keep relying onGet5-*.[MATCHZY_UPDATE_AVAILABLE]and[MATCHZY_UPDATE_SHUTDOWN]→[AT_UPDATE_AVAILABLE]and[AT_UPDATE_SHUTDOWN]. csm greps for the old marker (src/internal/csm/monitor.go).+matchzy_config_scope→+at_config_scope. csm passes this (matchzy_scope.go,launch_cmd.go), andcsm doctorlooks for the stringmatchzy_config_scopeinsideMatchZy.dll.css_matchzy_version→css_at_version, and the chat command.matchzyversion→.atversion..versionandcss_versionare unchanged.csgo/MatchZyDataBackup/→csgo/AutoTournamentCS2DataBackup/,csgo/MatchZy_Stats/→csgo/AutoTournamentCS2_Stats/,csgo/MatchZyPlayerNames/→csgo/AutoTournamentCS2PlayerNames/, the default demo foldercsgo/MatchZy/→csgo/AutoTournamentCS2/, round backupsmatchzy_<match>_<map>_round<n>.json→at_<match>_<map>_round<n>.json,matchzy_breadcrumbs.log→at_breadcrumbs.log. These are not carried over (see below).matchzy.*→at.*in everylang/*.jsonfile. They are internal. Translated text that said "MatchZy" now says "Auto Tournament CS2".MATCHZY_BOOTSTRAP_TOKENin a redaction test →AT_BOOTSTRAP_TOKEN.at_show_credits_on_match_start) used to say "MatchZy Plugin by WD-". It now prints the credit line: "Auto Tournament CS2 is forked from MatchZy by shobhit-pathak."Every renamed console variable and command
121
matchzy_*names, plus the root commandmatchzy→at,css_matchzy_version→css_at_versionand the chat command.matchzyversion→.atversion: 124 in total. (platform) marks the 54 names the platform sets or reads over RCON today (found by greppingapi/srcin auto-tournament). The platform has to switch those to theat_*names.Full list (121)
matchzy_addplayer→at_addplayer(platform)matchzy_admin_chat_prefix→at_admin_chat_prefix(platform)matchzy_admins_refresh_seconds→at_admins_refresh_secondsmatchzy_admins_url→at_admins_urlmatchzy_allow_force_ready→at_allow_force_ready(platform)matchzy_autoready_check_delay→at_autoready_check_delaymatchzy_autoready_enabled→at_autoready_enabled(platform)matchzy_autoready_ready_delay→at_autoready_ready_delaymatchzy_autoready_simulation_allow_start_without_humans→at_autoready_simulation_allow_start_without_humansmatchzy_autoready_simulation_bot_spawn_delay→at_autoready_simulation_bot_spawn_delaymatchzy_autoready_simulation_enabled→at_autoready_simulation_enabledmatchzy_autoready_simulation_knife_start_command_delay→at_autoready_simulation_knife_start_command_delaymatchzy_autoready_simulation_knife_start_max_steps→at_autoready_simulation_knife_start_max_stepsmatchzy_autoready_simulation_knife_start_mode→at_autoready_simulation_knife_start_modematchzy_autoready_simulation_knife_step_start_index→at_autoready_simulation_knife_step_start_indexmatchzy_autoready_simulation_knife_use_safe_mode→at_autoready_simulation_knife_use_safe_modematchzy_autoready_simulation_skip_async_events→at_autoready_simulation_skip_async_eventsmatchzy_autoready_start_delay→at_autoready_start_delaymatchzy_autostart_mode→at_autostart_mode(platform)matchzy_bootstrap_token→at_bootstrap_token(platform)matchzy_bootstrap_url→at_bootstrap_url(platform)matchzy_both_teams_unpause_required→at_both_teams_unpause_required(platform)matchzy_center_html_notifications→at_center_html_notificationsmatchzy_chat_messages_timer_delay→at_chat_messages_timer_delaymatchzy_chat_prefix→at_chat_prefix(platform)matchzy_check_for_updates→at_check_for_updatesmatchzy_clear_event_queue→at_clear_event_queue(platform)matchzy_clear_queued_match→at_clear_queued_match(platform)matchzy_config_scope→at_config_scopematchzy_crash_debug_breadcrumbs→at_crash_debug_breadcrumbsmatchzy_debug_chat→at_debug_chat(platform)matchzy_debug_chat_get→at_debug_chat_getmatchzy_debug_console→at_debug_consolematchzy_demo_name_format→at_demo_name_format(platform)matchzy_demo_path→at_demo_path(platform)matchzy_demo_recording_enabled→at_demo_recording_enabled(platform)matchzy_demo_upload_header_key→at_demo_upload_header_key(platform)matchzy_demo_upload_header_value→at_demo_upload_header_value(platform)matchzy_demo_upload_url→at_demo_upload_url(platform)matchzy_enable_damage_report→at_enable_damage_reportmatchzy_enable_tech_pause→at_enable_tech_pausematchzy_event_cleanup_interval→at_event_cleanup_intervalmatchzy_event_retry_interval→at_event_retry_intervalmatchzy_events_enabled→at_events_enabledmatchzy_everyone_is_admin→at_everyone_is_adminmatchzy_ffw_check_interval→at_ffw_check_intervalmatchzy_ffw_enabled→at_ffw_enabled(platform)matchzy_ffw_time→at_ffw_time(platform)matchzy_get_match_stats→at_get_match_statsmatchzy_get_pending_events→at_get_pending_eventsmatchzy_gg_enabled→at_gg_enabled(platform)matchzy_gg_min_score_diff→at_gg_min_score_diff(platform)matchzy_gg_threshold→at_gg_threshold(platform)matchzy_heartbeat_url→at_heartbeat_urlmatchzy_hostname_format→at_hostname_format(platform)matchzy_kick_when_no_match_loaded→at_kick_when_no_match_loaded(platform)matchzy_knife_enabled_default→at_knife_enabled_default(platform)matchzy_listbackups→at_listbackupsmatchzy_loadbackup→at_loadbackupmatchzy_loadbackup_url→at_loadbackup_urlmatchzy_loadmatch→at_loadmatchmatchzy_loadmatch_url→at_loadmatch_url(platform)matchzy_match_report→at_match_report(platform)matchzy_match_start_message→at_match_start_messagematchzy_match_token→at_match_tokenmatchzy_max_pauses_per_team→at_max_pauses_per_team(platform)matchzy_max_saved_last_grenades→at_max_saved_last_grenadesmatchzy_max_tech_pauses_allowed→at_max_tech_pauses_allowedmatchzy_minimum_ready_required→at_minimum_ready_required(platform)matchzy_notification_duration_global→at_notification_duration_globalmatchzy_notification_duration_player→at_notification_duration_playermatchzy_pause_after_restore→at_pause_after_restore(platform)matchzy_pause_duration→at_pause_duration(platform)matchzy_playout_enabled_default→at_playout_enabled_default(platform)matchzy_reload_config→at_reload_configmatchzy_remote_backup_header_key→at_remote_backup_header_keymatchzy_remote_backup_header_value→at_remote_backup_header_valuematchzy_remote_backup_url→at_remote_backup_urlmatchzy_remote_log_header_key→at_remote_log_header_key(platform)matchzy_remote_log_header_value→at_remote_log_header_value(platform)matchzy_remote_log_url→at_remote_log_url(platform)matchzy_removeplayer→at_removeplayermatchzy_report_endpoint→at_report_endpoint(platform)matchzy_report_server_id→at_report_server_id(platform)matchzy_report_token→at_report_token(platform)matchzy_reset_cvars_on_series_end→at_reset_cvars_on_series_end(platform)matchzy_safeautoupdater_action→at_safeautoupdater_actionmatchzy_safeautoupdater_enabled→at_safeautoupdater_enabledmatchzy_safeautoupdater_offline_backoff_seconds→at_safeautoupdater_offline_backoff_secondsmatchzy_save_nades_as_global_enabled→at_save_nades_as_global_enabledmatchzy_series_end_kick_delay_demo_no_upload→at_series_end_kick_delay_demo_no_upload(platform)matchzy_series_end_kick_delay_demo_upload→at_series_end_kick_delay_demo_upload(platform)matchzy_series_end_kick_delay_no_demo→at_series_end_kick_delay_no_demo(platform)matchzy_server_id→at_server_id(platform)matchzy_show_credits_on_match_start→at_show_credits_on_match_startmatchzy_side_selection_enabled→at_side_selection_enabled(platform)matchzy_side_selection_reminder_interval→at_side_selection_reminder_intervalmatchzy_side_selection_time→at_side_selection_time(platform)matchzy_smoke_color_enabled→at_smoke_color_enabledmatchzy_stop_command_available→at_stop_command_available(platform)matchzy_stop_command_no_damage→at_stop_command_no_damage(platform)matchzy_tech_pause_duration→at_tech_pause_durationmatchzy_tech_pause_flag→at_tech_pause_flagmatchzy_tournament_go_live_status→at_tournament_go_live_statusmatchzy_tournament_match→at_tournament_match(platform)matchzy_tournament_next_match→at_tournament_next_match(platform)matchzy_tournament_status→at_tournament_status(platform)matchzy_tournament_updated→at_tournament_updated(platform)matchzy_use_pause_command_for_tactical_pause→at_use_pause_command_for_tactical_pause(platform)matchzy_version→at_versionmatchzy_warmup_buy_anywhere→at_warmup_buy_anywherematchzy_warmup_enable→at_warmup_enablematchzy_warmup_ignore_win_conditions→at_warmup_ignore_win_conditionsmatchzy_warmup_infinite_ammo→at_warmup_infinite_ammomatchzy_warmup_maxmoney→at_warmup_maxmoneymatchzy_warmup_message_html→at_warmup_message_htmlmatchzy_warmup_respawn→at_warmup_respawnmatchzy_warmup_roundtime_minutes→at_warmup_roundtime_minutesmatchzy_warmup_startmoney→at_warmup_startmoneymatchzy_webhook_url→at_webhook_urlmatchzy_whitelist_enabled_default→at_whitelist_enabled_default(platform)The persisted settings in
at_server_configuse these same names as keys (at_server_id,at_bootstrap_url,at_bootstrap_token,at_remote_log_*,at_webhook_url,at_heartbeat_url,at_report_*,at_match_token,at_demo_upload_url,at_admins_*,at_chat_prefix,at_admin_chat_prefix,at_warmup_*).Where the plugin sends the auth header
Always
X-Auto-Tournament-Tokennow:src/BootstrapConfig.cs: the bootstrap fetch (at_bootstrap_urlwithat_bootstrap_token).src/MatHeartbeat.cs: the heartbeat POST.src/MatchReportCommand.cs: the match report upload.src/ReadyUpCompatCommands.cs:at_match_tokensetsat_remote_log_header_key "X-Auto-Tournament-Token", so events go out with it.The platform picks the header name for these by setting it over RCON, so the platform has to send
X-Auto-Tournament-Tokenin:at_remote_log_header_key(PublishEvents.cs)at_demo_upload_header_key(Utility.csUploadFileAsync)at_loadmatch_url/at_remote_backup_*: header name and value passed with the commandToday the platform sets
matchzy_remote_log_header_key "X-MatchZy-Token"andmatchzy_demo_upload_header_key "X-MatchZy-Token"(api/src/integrations/cs2/utils/matchzyRconCommands.ts,services/matchLoadingService.ts).First-start carry-over
New
src/LegacyCarryOver.cs, with no CounterStrikeSharp dependency, so it is unit tested. It runs on every start and does nothing once the old names are gone. It only moves or renames. It never overwrites a new-named file, table or setting, and never deletes anything. When both an old and a new name exist, both are left alone, a warning is logged, and the new one is used. Every step is logged with a[CarryOver]prefix, straight to the console (not gated byat_debug_console).Load(), beforeadmins.jsonordatabase.jsonis read:cfg/MatchZy/exists andcfg/AutoTournamentCS2/doesn't: the folder is moved. LogsMoved cfg/MatchZy/ to cfg/AutoTournamentCS2/ (N file(s))., then onemoved cfg/MatchZy/<file> -> cfg/AutoTournamentCS2/<file>line per file.Moved cfg/MatchZy/<file> -> cfg/AutoTournamentCS2/<file>). Files in both are left in both places, and oneWARNING: both cfg/MatchZy/ and cfg/AutoTournamentCS2/ have <files>. Using the files in cfg/AutoTournamentCS2/ ...lists them.Load():matchzy.dbis looked for in the new plugin folder (if an operator copied it) and then inplugins/MatchZy/, where every 1.x install kept it. It is renamed toplugins/AutoTournamentCS2/auto_tournament_cs2.dbtogether with any-wal/-shm/-journalsidecar. LogsRenamed SQLite database <old> -> <new>. Ifauto_tournament_cs2.dbalready exists: warning, nothing moved.CREATE TABLE IF NOT EXISTScould make empty new ones: eachmatchzy_<t>whoseat_<t>does not exist is renamed. On MySQL that is oneRENAME TABLE a TO b, c TO d, ...statement (atomic). On SQLite it is one transaction ofALTER TABLE ... RENAME TO. LogsRenamed table matchzy_<t> -> at_<t>for each. Foreign keys follow the rename on both. If the rename fails, it re-checks: when old tables are still waiting (for example, missing privileges), database init stops rather than create emptyat_*tables next to them. When another server on the same database already renamed them, it carries on.at_server_configkeyedmatchzy_<x>are re-keyed toat_<x>, per server scope, unless that server already has anat_<x>row. LogsRenamed saved setting matchzy_<x> -> at_<x> for server '<scope>'. Without this, the server id, bootstrap URL and token and remote log settings would be lost on upgrade.Deviation from the brief, on purpose. The brief says to move
cfg/MatchZy/only whencfg/AutoTournamentCS2/doesn't exist. But the release zip shipscfg/AutoTournamentCS2/, and csm and manual installs extract it before the first start. So that condition never fires in practice, and nothing would carry over. Hence the per-file move above, which keeps the never-overwrite and never-delete rules. For the same reason the zip no longer includesdatabase.json: the plugin already writes a default when it's missing, and a shipped SQLite default would otherwise win over an operator's MySQLdatabase.jsonand hide their match history.Not carried over (outputs, not settings): demo files, round backups,
MatchZy_StatsCSVs and the forced-names folder. They stay where they are.Also not renamed: on a migrated MySQL database the foreign key constraint
matchzy_stats_maps_matchidonat_stats_mapskeeps its name. MySQL can only rename a foreign key by dropping and re-adding it, which isn't worth the risk. New installs getat_stats_maps_matchid.For csm (release step 2)
AutoTournamentCS2*.zipasset fromAuto-Tournament/cs2-plugin, and install toplugins/AutoTournamentCS2/.plugins/MatchZy/MatchZy.dllso two copies never load, but don't deleteplugins/MatchZy/matchzy.dbbefore 2.0.0 has started once, because the plugin moves it from there. Alternatively, csm moves it toplugins/AutoTournamentCS2/auto_tournament_cs2.dbitself.+at_config_scope. Watch for[AT_UPDATE_AVAILABLE]. Write overrides tocfg/AutoTournamentCS2/database.json. PointdoctoratAutoTournamentCS2.dlland theat_config_scopestring.addons/andcfg/at its root (it used to wrap them in aMatchZy-<version>/folder). csm's extractor findsaddons/counterstrikesharpeither way.Release workflow
release.ymlstill runsrelease.sh, which now:AutoTournamentCS2-<version>.zipwithaddons/counterstrikesharp/plugins/AutoTournamentCS2/AutoTournamentCS2.dllandcfg/AutoTournamentCS2/at the rootdatabase.jsonunzipadded to the workflow's apt line)discord-webhook.shnow links toAuto-Tournament/cs2-pluginand uses the new name. I ran the packaging part ofrelease.shlocally in a .NET 8 container and checked the zip listing. Nothing was released.Verification
dotnetisn't installed on this machine, so I ran everything inmcr.microsoft.com/dotnet/sdk:8.0.dotnet build -c Release: 0 errors.dotnet test tests/AutoTournamentCS2.Tests: 283 passed, including 9 new carry-over tests. They run on real temp folders and a real SQLite database and cover: folder move, per-file merge without overwrite, SQLite file fromplugins/MatchZy/, no overwrite of an existing.db, table rename with data and foreign keys, both-tables-exist, settings re-keyed and readable, and no overwrite of a newer setting./proc/self/cmdlinefixtures inServerIdentityTestswere re-encoded with+at_config_scope.build.ymlruns restore, build and test on every pull request. Its test path is updated.Remaining
matchzyhits (case-insensitive) and why they stayREADME.md, Credits: the credit line "Auto Tournament CS2 is forked from MatchZy by shobhit-pathak."src/Utility.cs:2154: the same credit line, printed in game on match start (at_show_credits_on_match_start).LICENSE: the upstream copyright notice ("Shobhit Pathak"). It doesn't contain the word MatchZy, and it's unchanged.README.md, Upgrading from 1.x (7 lines): tells operators which old names to rename and what the first start does withcfg/MatchZy/,plugins/MatchZy/,matchzy.dband thematchzy_*tables and settings. The upgrade guide needs the same.src/LegacyCarryOver.cs: the old names (MatchZy,matchzy.db,matchzy_) as constants plus their doc comments. This is the code that finds them on disk and in the database.tests/AutoTournamentCS2.Tests/LegacyCarryOverTests.cs: builds a 1.x-shaped install and database to test the carry-over.🤖 Generated with Claude Code