MatchZy icon indicating copy to clipboard operation
MatchZy copied to clipboard

Hosting a workshop map breaks wingman functionality

Open milkywayfarer opened this issue 6 months ago • 2 comments

This is just food for thought.

We host awp_lego from workshop on our servers for warmup sessions before the match. This map, afaik, does not have wingman capabilities.

We create a wingman match using G5 API. Everything runs smoothly, until we got our mappicks and are switching to a map to play first. After the knife round, server states:

[MatchZy] [StartLive] Starting Live! Executing Live CFG from MatchZy/live.cfg,

while having the matchConfig.Wingman set to true all the time. Thus we have the regular config with mp_maxrounds set to 24 and all that.

We then, instead of playing awp_lego, go straight to a map that has wingman capability. We used de_inferno. Again, create a match using G5, pick maps, switch maps - and everything is good.

I believe this happens because we tried to change the game mode while being on the map that is not capable of that mode (MapVeto.cs:349). We can go about this two ways:

  1. In MapVeto.cs:351, move SetCorrectGameMode() to the ChangeMap(string, Int32) method after the map change command (Utility.cs:948), so that server actually recognizes available gamemodes on the map that we are supposed to play on. Maybe time it out a bit or change it right after the warmup (I believe warmup does not care about the current gamemode?)
  2. In Utility.cs:1350, execute live config checking not the gameMode convar, but matchConfig.Wingman variable (since MatchZy supports only 2 gamemodes anyway)

Solution 2 might break the current gamemode (it might stay as it was on the previous map), so I'm rooting for solution 1.

Please review this @shobhit-pathak as we have a wingman tournament coming up and I want to issue a PR with your selected solution. Thanks!

milkywayfarer avatar Aug 18 '24 09:08 milkywayfarer