Skip to content

source-engine-discord/SourceEngine.Demo

Repository files navigation

SourceEngine.Demo

Outputs game statistics from CS:GO demos as JSON. The solution has three projects:

SourceEngine.Demo.Parser - A library used to parse CS:GO demos. It is based on DemoInfo.

SourceEngine.Demo.Stats - A library for gathering statistics from demos and outputting them as JSON. It is based on CSGODemoCSV and is available as a package on nuget.org.

SourceEngine.Demo.Stats.App - A .NET Core app which provides a command line interface for SourceEngine.Demo.Stats. Also known as IDemO.

Program output

Supported Gamemodes

  • Defuse
  • Hostage
  • Wingman Defuse
  • Wingman Hostage
  • Danger Zone

Running IDemO

Releases

Only builds/releases for Windows are currently automated.

Latest release:

Usage

  -config                            [path]                       Path to config file.
  -folders                           [paths (space seperated)]    Processes all demo files in each folder specified.
  -demos                             [paths (space seperated)]    Processess a list of single demo files at paths.
  -gamemodeoverride                  [string]                     Defines the gamemode for the match instead of having the parser attempt to figure it out. -> (defuse / hostage / wingmandefuse / wingmanhostage / dangerzone)
  -testtype                          [string]                     Defines the test type for the match. Otherwise it attempts to grab it from the filename in SE Discord's filename formatting. Only matters for defuse and hostage. -> (competitive / casual)
  -testdateoverride                  [string]                     Defines the test date of the match. Otherwise it attempts to grab it from the filename. -> (dd/mm/yyyy)
  -hostagerescuezonecountoverride    [int]                        Defines the number of hostage rescue zones in the map. Without this, the parser assumes hostage has 1 and danger zone has 2 -> (0-2)
  -recursive                                                      Switch for recursive demo search.
  -steaminfo                                                      Takes steam names from steam.
  -clear                                                          Clears the data folder.
  -nochickens                                                     Disables checks for number of chickens killed when parsing.
  -noplayerpositions                                              Disables checks for player positions when parsing.
  -samefilename                                                   Uses the demo's filename as the output filename.
  -samefolderstructure                                            Uses the demo's folder structure inside the root folder for the output json file.
  -lowoutputmode                                                  Does not print out the progress bar and round completed messages to console.

Example:

IDemO -folders "demos" -output "parsed" -recursive -nochickens -noplayerpositions -samefilename -samefolderstructure

Development

Requirements

Building

The SourceEngine.Demo.Stats.App project will build the executable. By default, a self-contained single executable is published targeting win-x64.

Visual Studio

Build as one normally would. To publish, right-click the SourceEngine.Demo.Stats.App project and click Publish. A new tab will open and it should have the win_x64_self_contained profile already selected. Take note of the target location shown (i.e. where the resulting exe will be) and then click the Publish button.

Command Line

To build and publish a release, run

dotnet publish -c Release

By default, this publishes for the win-x64 runtime. To build for another runtime, specify the RID with the -r option. For example:

dotnet publish -c Release -r linux-x64

Creating a Release

Update the version number in Directory.Build.props and commit the change. Then, create a tag with git. It is recommended to use annotated tags:

git tag -a v3.5.0 -m 'A brief description of the release'

Note that CI enforces SemVer 2.0.0 format compliance as well as the versions in the tag and the project being equal.

Finally, push the tag along with the commit for the version bump:

git push --follow-tags