Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g_BO2Match not resetted after match. BO2 stuck until server reboot. #708

Closed
kubo6472 opened this issue Oct 18, 2021 · 7 comments · Fixed by #726
Closed

g_BO2Match not resetted after match. BO2 stuck until server reboot. #708

kubo6472 opened this issue Oct 18, 2021 · 7 comments · Fixed by #726

Comments

@kubo6472
Copy link

Expected behavior

After a BO2 a different format can be immediately played on the server

Actual behavior

After a BO2 the g_BO2Match var is stuck to 1 and therefore any other format has bo2 format.

Steps to reproduce

@kubo6472
Copy link
Author

image
BO3 match, BO2 veto

@kubo6472
Copy link
Author

image
BO3 match after server reboot. BO3 veto

@PhlexPlexico
Copy link
Collaborator

So I think I may have figured out the issue with this. I was comparing the two variables g_SkipVeto and g_BO2Match. During a match load from JSON or KV, g_SkipVeto does a safe call and returns false if skip_veto is not present in the match config. However, g_BO2Match is a little bit different in that it uses other variables to check for truthiness, which can be seen here as an example:

g_SkipVeto = json_object_get_bool_safe(json, "skip_veto", CONFIG_SKIPVETO_DEFAULT);
// bo2_series and maps_to_win are deprecated. They are used if provided, but otherwise
// num_maps' default is the fallback.
bool bo2 = json_object_get_bool_safe(json, "bo2_series", false);
int mapsToWin = json_object_get_int_safe(json, "maps_to_win", 0);
int numMaps = json_object_get_int_safe(json, "num_maps", CONFIG_NUM_MAPSDEFAULT);
if (bo2 || numMaps == 2) {
g_BO2Match = true;
g_MapsToWin = 2;
} else {

The only problem with this is that once this g_BO2Match is set to true, there is no way (aside from a plugin reload or server reboot) that g_BO2Match will be set to false. @kubo6472 would you by chance have some time to test the plugin if I were to make a build that has a small patch for this to ensure it's working as intended before I create a PR for this?

Thanks!

@kubo6472
Copy link
Author

kubo6472 commented Dec 27, 2021 via email

@PhlexPlexico
Copy link
Collaborator

Here is the link to the artifact for the latest fix I made. If this works then I'll create a PR.

Thanks!

@kubo6472
Copy link
Author

kubo6472 commented Dec 28, 2021 via email

@kubo6472
Copy link
Author

kubo6472 commented Dec 28, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants