Conversation
- Add matchzy_backups table to SQLite and MySQL (Database.cs) - Write round backups to DB instead of JSON files (BackupManagement.cs) - Read backups from DB, with legacy filename fallback - Add restore voting: .restore starts a vote, .yes/.no, 75% threshold - Vote timeout 20s, shows 5 most recent backups on pass - Non-admin players can .restore when match is not live (after crash) - Admin-only .restore unchanged when match is live - ru/en localization for all vote messages
- New ConVar: matchzy_server_id (set per-server in server.cfg) - Added server_id column to matchzy_backups table (SQLite + MySQL) - All backup queries now filter by server_id when set - ShowBackupListForVote shows only this server's backups - Empty value = no filtering (backward compatible)
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.
What this does
1. Database-backed round backups
Round backups are now stored in the database (SQLite or MySQL) instead of JSON files on disk. The
matchzy_backupstable stores all backup metadata including the Valve backup payload.matchzy_backupsfor both SQLite and MySQL schemasSaveRoundBackup()writes directly to DBRestoreRoundBackup()reads from DB with legacy filename fallbackGetBackups()/GetBackupInfo()use DB queries2. Restore voting system
Non-admin players can now initiate a vote to restore a match from backup — useful when the server crashes and players reconnect.
.restorestarts a vote (available to all players when match is not live).yes/.noin chat.restore <id>.restoreunchanged when match is live3. Multi-server isolation via
matchzy_server_idNew ConVar
matchzy_server_id— set per-server inserver.cfg:server_idin the DBserver_idwhen setFiles changed
DatabaseStats.cs— new table, BackupRecord class, 5 CRUD methodsBackupManagement.cs— DB-backed backup/restore, voting system (StartRestoreVote, OnRestoreVoteYes/No, ShowBackupListForVote)MatchZy.cs—.yes/.nocommands,.restore→ voting flowConfigConvars.cs— newmatchzy_server_idFakeConVarlang/en.json+lang/ru.json— 13 localization strings for votingBackward compatibility
matchzy_server_id= no filtering (existing servers work)RestoreRoundBackupfalls back to old filename format if not found in DBAll changes tested for compilation compatibility with CounterStrikeSharp API.