MatchZy Documentation

repository·dev·Indexed 19 days ago

https://github.com/shobhit-pathak/matchzy

A comprehensive match management plugin for Counter-Strike 2 designed to automate workflows for PUGs, scrims, and practice sessions. It features automated match management with BO1/BO3/BO5 support, a robust practice mode for grenade lineups and spawning, automated demo recording and uploading, and statistical tracking via SQLite or MySQL. The documentation covers command references for players and admins, configuration of ConVars, admin permission setup via CSSharp or native systems, and server configuration files.

Tokens
8.8K
Snippets
19
Records
33
Agent score
66%

What's inside MatchZy

  1. Overview of MatchZy features for CS2 match management

    dev

    MatchZy is a plugin for Counter-Strike 2 (CS2) designed to manage practice sessions, pugs, scrims, and competitive matches. It provides a suite of commands for match control, automated demo recording, and statistical tracking.

    Key Capabilities:

    • Match Modes: Supports Pug mode, Practice mode, and competitive formats like BO1, BO3, and BO5 (including Veto support).
    • Match Control: Commands for readiness (!ready, !unready), match state (!pause, !unpause, !stop), and tactical adjustments (!tac).
    • Practice Mode Commands: Includes .bot, .spawn, .ctspawn, .tspawn, .nobots, .rethrow, .last, .timer, .clear, and .exitprac.
    • Automated Demo Management: Automatically starts and stops demo recording (requires tv_enable 1) and can automatically upload demos to a specified URL at the end of a map.
    • Statistics & Data: Stores match data in a local SQLite database (MySQL also supported) and generates detailed CSV files for player statistics.
    • Gameplay Features: Knife rounds with specific win logic (player count > HP advantage > random), coaching systems, damage reports after every round, and round restore support.
  2. Overview of MatchZy for CS2

    dev
    MatchZy is a plugin designed for Counter-Strike 2 (CS2) to facilitate the running and management of practice sessions, Pick-Up Games (PUGs), scrims, and competitive matches. It provides automated match management, practice tools, and statistical tracking through easy configuration.
  3. MatchZy Feature Highlights

    dev

    MatchZy includes several key features for server administrators and match organizers:

    • Match Management: Pug mode with simple commands, support for BO1/BO3/BO5 formats, Veto support, and Get5 Panel integration.
    • Practice Mode: A suite of commands including .bot, .spawn, .ctspawn, .tspawn, .nobots, .rethrow, .last, .timer, .clear, and .exitprac.
    • Automated Recording: Automatically starts and stops demo recording (requires tv_enable 1) and can automatically upload demos to a specified URL at the end of a map.
    • Gameplay Features: Knife rounds with specific win logic (player count > HP advantage > random), coaching system, and round-based damage reports.
    • Administration: Player whitelisting, admin role creation, and access control for admin commands.
    • Statistics: Stores match data in a local SQLite database (MySQL is also supported) and generates detailed CSV files for player stats per match.
  4. Understand MatchZy plugin modes

    dev

    MatchZy operates in different modes depending on the desired gameplay experience. By default, the plugin starts in pug mode.

    • Pug mode: The default mode where teams are not locked.
    • Practice mode: Started by admins using the .prac command.
    • Scrim mode: Toggled by admins using the .playout command. This mode enables the playout of all rounds.
    • Match mode: A structured mode configured by providing a specific match json.
  5. Understand MatchZy database schema

    dev

    MatchZy uses three primary tables to store match and player statistics. Whether using SQLite or MySQL, the following tables are utilized:

    • matchzy_stats_matches: Stores general match data, including matchid, team names, and scores.
    • matchzy_stats_maps: Stores data for every map played within a match.
    • matchzy_stats_players: Stores individual player performance data for each match, such as matchid, kills, deaths, assists, and other key statistics.
  6. Use MatchZy match commands

    dev

    MatchZy provides a set of commands to manage match flow, player readiness, and tactical pauses. Most commands can be prefixed with either a dot (.) or an exclamation mark (!).

    Player Readiness

    • .ready or .r: Marks the player as ready.
    • .unready, .ur, or .notready: Marks the player as unready.
    • .forceready: Force-readies a player's entire team (only works with JSON or Get5 match setups).
    • .readyrequired <number> (Admin): Sets how many players must be ready to start the match. Setting this to 0 requires all connected players to ready up.

    Match Flow and Pausing

    • .pause or .tech: Pauses the match during freeze time. The type of pause (tactical vs. normal) depends on the matchzy_use_pause_command_for_tactical_pause setting.
    • .unpause: Requests an unpause. Both teams must type .unpause to resume.
    • .tac: Starts a tactical timeout.
    • .stop: Restores the backup of the current round. Both teams must type .stop to trigger the restoration.
    • .stay: For knife round winners to stay on the same side.
    • .switch or .swap: For knife round winners to switch sides.
    • .coach <side>: Starts coaching for a specific side (e.g., .coach t for Terrorists).
    • .uncoach: Leaves the coaching slot.
    !ready
    !unpause
    .coach t
  7. How to load a match configuration in MatchZy

    dev

    MatchZy uses JSON configuration files to host series, lock players to specific teams/sides, set maps, and configure game rules. You can load these configurations using two different commands:

    1. Local File: Use matchzy_loadmatch <filepath> to load a JSON file located relative to the csgo directory.
    2. Remote URL: Use matchzy_loadmatch_url <url> [header name] [header value] to fetch a JSON configuration via an HTTP(S) GET request. If you need to provide authentication or custom headers, include the header name and value as arguments.

    Note: All arguments for the URL command should be enclosed in quotation marks ("").

    If you wish to use MatchZy for practice, scrims, or pugs without a formal match setup, ensure the server variable matchzy_kick_when_no_match_loaded is set to false.

    # Load a local file from the csgo directory
    matchzy_loadmatch astralis_vs_navi_27.json
    
    # Load a remote JSON configuration via URL
    matchzy_loadmatch_url "https://<url>/astralis_vs_navi_27.json"
    
    # Load a remote URL with a custom header
    matchzy_loadmatch_url "https://<url>/match.json" "Authorization" "Bearer <token>"
  8. Install MatchZy on a CS2 Dedicated Server

    dev

    To install MatchZy, you must first ensure that Metamod and CounterStrikeSharp (CSSharp) are installed on your CS2 dedicated server.

    Prerequisites

    1. Install Metamod: Follow the Metamod installation guide.
    2. Install CounterStrikeSharp (CSSharp):
      • Download counterstrikesharp-with-runtime from the CounterStrikeSharp releases page.
      • Note: You can skip this step if you use the MatchZy CSSharp release.
      • Extract the addons folder to the csgo/ directory of your dedicated server. The csgo/addons directory should contain both the counterstrikesharp and metamod folders.
      • Windows Users: You must use the Windows build of counterstrikesharp available on the CSSharp releases page.
      • Verification: Type meta list in the server console. You should see CounterStrikeSharp plugin by Roflmuffin listed.

    MatchZy Installation

    1. Download the latest MatchZy release.
    2. Extract the files into the csgo/ directory of your dedicated server.
    3. Verification: Type css_plugins list in the server console. You should see MatchZy by WD- listed.
    # Verify Metamod/CSSharp installation
    meta list
    
    # Verify MatchZy installation
    css_plugins list
  9. Receive MatchZy events via HTTP

    dev

    MatchZy can send event logs to a remote web server as JSON over HTTP. This is useful for building external dashboards, logging services, or real-time integrations.

    To enable this, configure the following settings:

    • matchzy_remote_log_url: The destination URL where MatchZy will POST the JSON event data.
    • matchzy_remote_log_header_key: (Optional) A custom HTTP header used to authenticate your requests.

    Important Limitations:

    • No Retries: If a request fails, MatchZy will not attempt to retry it.
    • No Deduplication: Events are sent as they occur; there is no mechanism to prevent duplicate delivery if the network or server behaves unexpectedly.
    • Connection Stability: It is assumed that a stable connection exists between the game server and your endpoint.