splewis / get5

CS:GO Sourcemod plugin for competitive matches/scrims
GNU General Public License v3.0
559 stars 176 forks source link

[Feature Request]: Allow comments in teams.json #1021

Closed ar1a closed 1 year ago

ar1a commented 1 year ago

Prereleases & Documentation

Get5 Version

0.14.4

The Feature

Would love to see comments allowed in JSON parsing, even though it's not strictly specced.

My use case is I am trialing a lot of players and need to change my teams.json constantly, not having to go and re-look up someone's steam id when they trial again a different night would be nice.

nickdnk commented 1 year ago

This is not going to happen unfortunately. If you want comments, you'll have to use the KeyValues file format instead, which allows this.

You can also potentially use the !get5 menu to start games on demand without having to create files.

Edit: And to clarify why:

  1. It's a violation of the JSON definition to have comments. It's simply not valid syntax. It would require JSON5.
  2. The dependency get5 uses, sm-json, does not (and likely will not) support JSON5.
nickdnk commented 1 year ago

Correction: The teams and map files do not support the KeyValues format. Match config only unfortunately.

You can leave the Steam IDs in the team though. It doesn't have to be exactly 5 players.

nickdnk commented 12 months ago

@ar1a Something else you could consider is just using get5_addplayer to add the trialing player to the team after loading the match configuration file. Then you don't have to change any files at all: https://splewis.github.io/get5/latest/commands/#get5_addplayer

ar1a commented 11 months ago

oh sweet! will that force them to switch teams (ct/t) too?

On Sun, 23 July 2023, 1:36 am Nicolai Cornelis, @.***> wrote:

@ar1a https://github.com/ar1a Something else you could consider is just using get5_addplayer to add the trialing player to the team after loading the match configuration file. Then you don't have to change any files at all: https://splewis.github.io/get5/latest/commands/#get5_addplayer

— Reply to this email directly, view it on GitHub https://github.com/splewis/get5/issues/1021#issuecomment-1646636247, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACALSJ4JI5D6HUWGZD233CDXRQFRZANCNFSM6AAAAAAXKNXE4U . You are receiving this because you were mentioned.Message ID: @.***>

nickdnk commented 11 months ago

They won’t be on the server when you issue the command, so it will put them on the right team when they join, just like if they had been in the team file to begin with. It’s the same thing.