shobhit-pathak / MatchZy

MatchZy is a plugin for CS2 (Counter Strike 2) for running and managing practice/pugs/scrims/matches with easy configuration and Get5 (G5API/G5V) support as well!
https://shobhit-pathak.github.io/MatchZy/
MIT License
268 stars 78 forks source link

Regression: switching maps after veto makes matchStarted=true #217

Closed milkywayfarer closed 3 months ago

milkywayfarer commented 3 months ago

Caught on 0.8.3 yesterday. This was not the case on update 0.8.1, so I consider it a regression.

Upon completing the veto and changing the map, we go to a warmup where every player should ready up, but plugin decides that matchStarted==true and stops waiting for players to ready up, stops chat messaging and ignores .ready, making match unstartable. Pausing or stopping does not work and leaves the warmup state active.

Without the veto everything is ok.

Seems like it might be an auto-side-selection trouble, if selecting a side makes the player ready.

milkywayfarer commented 3 months ago

Log looks like this: [MatchZy] [!ready command] Sent by: 1 readyAvailable: True matchStarted: True

I believe these two variables should always be the opposite of each other :D

milkywayfarer commented 3 months ago

@shobhit-pathak Utility.cs:696 is the culprit. That line makes the match started up before the veto, veto handles ok, but on map change we do not make it false again. Two solutions - make matchStarted=true only on live or make matchStarted=false after the veto. Second one is dumb, though, because on veto the match is not really started.

shobhit-pathak commented 3 months ago

Hey @milkywayfarer,

Thanks for the observations and letting me know, helps a lot! I had added Utility.cs:696 (matchStarted = true) in the newer update because the flag was not getting initialised on knife round, but I think thats the wrong place to do it since it messes up with the veto. I'll put it in the knife round function and test it.

shobhit-pathak commented 3 months ago

Hey @milkywayfarer,

I've pushed an update which should fix it, can you try with the 0.8.4 version?

milkywayfarer commented 3 months ago

Hey thanks for the update, we will get that tested tomorrow on 2 servers

milkywayfarer commented 3 months ago

Hey @shobhit-pathak,

We tested the latest version (0.8.5) on 3 servers and everything went as expected, aside some instances where creating a wingman match does not make the gamemode wingman, but it's not related.

Thanks!