splewis / get5

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

Refactor loading match configs + tests #946

Closed nickdnk closed 1 year ago

nickdnk commented 2 years ago

Similarly to teams, this allows the maplist to load using the fromfile logic.

Closes https://github.com/splewis/get5/issues/604.

nickdnk commented 1 year ago

So, this does a few other things:

  1. I added a lot of unit tests for loading match configurations and checking for various errors.
  2. I use the SMCParser to validate KeyValue files before importing them, as KeyValues.ImportFromFile returns true even if the file is invalid (which makse no sense, but it's the game engine doing this, not SM).
  3. You can now use fromfile for both map_list, spectators and team1/team2, all supporting both the KeyValue format and JSON.
  4. The error feedback when loading match configurations with errors in them should be much better at pointing at the exact error.
  5. The bug with the captain not being at index 0 when loading JSON teams has been fixed.
  6. Logic that handles mp_team_xx variables has been cleaned up and the documentation has been updated. This means you can now actually set matchtext for a team in a BoX and not have it overwritten by their team map series score.
  7. ConVars can now be up to 512 characters instead of 128. Note that the source may be a limiting factor, as you can load ConVars with a longer value from a plugin's .cfg file than you can from the console input.
  8. When using clinch_series: false, you can now have up to the full maplist of points in the GOTV map score indicator, i.e. bo5 without clinch grants you 5 point slots intead of 3, which would be the max with clinch.
  9. All Get5 state variables are now reset when a series ends. This should reduce the risk of game-state related bugs.
  10. Fixes a bug that would sometimes cause players to be put on the wrong team if restoring a backup from the first round of the second half to any round in the first half.