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

[BUG] First round restore swap issues #699

Closed
TandelK opened this issue Sep 5, 2021 · 5 comments · Fixed by #753 or #754
Closed

[BUG] First round restore swap issues #699

TandelK opened this issue Sep 5, 2021 · 5 comments · Fixed by #753 or #754

Comments

@TandelK
Copy link
Contributor

TandelK commented Sep 5, 2021

Expected behavior

When using stop command on the very first Round for Technical reasons and restoring round00.cfg backup file it should just reset the round itself properly back to their teams.

Actual behavior

When Using backup00.cfg with the team which has swapped after knife for side selection, it resets the sides again to their old team.

Steps to reproduce

Plugin version: 0.7.3-dev
Sourcemod Version = 1.10.0.6509

Steps to reproduce

  1. Create Match with Knife for Side Selection
  2. Start Knife round and then swap the sides.
  3. In first round use the stop command and check the side of the team that swapped has been resetted.
@TandelK
Copy link
Contributor Author

TandelK commented Sep 6, 2021

@splewis Does the Round Restore actually use Official Valve Backup ? If so it is not getting updated after the teams have been swap. I checked the backup created by get5 which actually while creating first time does properly stores the Team Swaps but as soon as we load the backup of round00 it seems that it is getting swapped because it might be using Valve Official backup and it does not seems to have updated after Knife Round.

@arildboifot
Copy link
Contributor

Might be related to #652 ?

@PhlexPlexico
Copy link
Collaborator

PhlexPlexico commented May 14, 2022

Okay, so I think I'm going to use this issue to consolidate a few bugs in relation to the backup system if that's alright. And some possible solutions/patches that can be made here.

Side Restore Issues

@TandelK had sent me some backup files to help debug this situation in this ticket. I believe that every pre-round start, the backup system writes a backup file, as seen here -

get5/scripting/get5.sp

Lines 1150 to 1166 in 5afc25b

public Action Event_RoundPreStart(Event event, const char[] name, bool dontBroadcast) {
LogDebug("Event_RoundPreStart");
if (g_PendingSideSwap) {
g_PendingSideSwap = false;
SwapSides();
}
if (g_GameState == Get5State_GoingLive) {
ChangeState(Get5State_Live);
}
Stats_ResetRoundValues();
if (g_GameState >= Get5State_Warmup && !g_DoingBackupRestoreNow) {
WriteBackup();
}
}

However, when the knife round ends this function I believe technically runs in while we're still selecting sides, and the teams are still in their initial configuration that was sent to the match server. So, when a team calls !swap, the prelive value is still set to team1 being on team1_side and team2 being on team2_side. We can see that during the PerformSideSwap call, we don't call any updates to the backup structure. This can be seen in this call, that no calls to writing the backup is performed.

static void PerformSideSwap(bool swap) {

Since there is no round end when selecting either !stay or !swap, the backup structure still has the defaults from how the match was setup, which I believe causes this match restore issue. So I think there's two ways of possibly fixing this one issue. One is when we swap the teams, have it restart the game with sides swapped so that the prelive config updates to set the team1_side and team2_side in the backup structure properly, or just call a write to the backup structure in the above call when we perform a side swap. I think I like the latter better as it avoids having to do any janky round-end shenanigans on it.

If TandelK is okay with it, I will also upload those backups to this ticket so we can get additional observation on both the Valve backups, and the get5 backups, but I do believe we just need to do a simple write to the backup structure on swapping sides, before the state changes.

ETA: As mentioned in #753 there is a global map side check gMapSides that we just need to update once we finish a knife round on the current map. This should fix the above problem!

Coach Issues

This one was reported to me personally, and I may be requesting some more information and at least a reproducible example (GoTV, Video, or otherwise), but it appears there was an issue with restoring coaches, which I think may be in relation to #700. When a match restore was called, the coaches in the match was unable to join back into the coach slot. I will await some more information for this as well.

ETA: I've done some more testing on this, and I think sv_coaching_enabled only allows us to swap coaches during the warmup period. However, if we do a round restore, it's been reported (and confirmed by myself) that the coach is dumped onto the team. I believe the match backups should be checking the coach slot as well and keeping them in the backup, that way when the match is restored it will look at the backup structure and find the player has been coaching, then place them back using a player swap.

This will be fixed and further improved with #754 - since we are now tracking coaches we can ensure that a coach can successfully disconnect and reconnect in a match and immediately be placed on the coach slot for the proper team.

### Pause/Unpause Issue
This one was reported in the Discord, and we're still looking into a possible, reproducible way for this. I'm not sure if PR #749 has anything to do with this confirmed as this is not in relation to the PR, as the user had mentioned previously that it had happened a few times without the new feature. Essentially when the two teams agreed to stop and restore the match to the last round using .stop, they were unable to resume the game with .unpause and the only way the match could resume is if an admin used rcon to call sm_unpause. We're waiting for more information on this one as well, but I'll be actively looking into this one as well as I verify the tech pause changes are working as intended, as I was unable to reproduce it after testing a few times.

ETA: After continuous testing with two different servers, I'm unable to replicate this one at all. I'm going to need someone to send detailed logs, and if they've made any modifications to the plugin as well beyond what has been completed in PRs.

.stop After a .stop

This issue was reported in Discord. Whenever a match decides to call the .stop command, the previous backup is wiped out due to the restore/start match config zeroing out the last saved backup. I think we can just wrap that call in checking if its a backup restore or not and fix that as well.

ETA: This should be resolved by #754 as well!

I'll edit this comment as well with more information as I come across it, and if time permits but I hope this may help someone else who may want to take a look into resolving these issues :) if you think these issues should be spread out into three separate tickets (and link/close all other issues relating to it), just let me know!

@TandelK
Copy link
Contributor Author

TandelK commented May 16, 2022

@PhlexPlexico You can surely share the Files here and we can work on fixing this major issues.

@PhlexPlexico
Copy link
Collaborator

Backup.zip

Attached are the match backups that show this behaviour. After I can fix a potential issue with the .stop command I'll see if I can find a way to fix these issues as well.

Thanks!

PhlexPlexico added a commit to PhlexPlexico/get5 that referenced this issue May 22, 2022
This should fix Side Restore Issues in splewis#699.
This was linked to pull requests Jun 22, 2022
splewis pushed a commit that referenced this issue Jun 26, 2022
This should fix Side Restore Issues in #699.
PhlexPlexico added a commit to PhlexPlexico/get5 that referenced this issue Jun 26, 2022
* Update Dockerfile to debian 11 (splewis#760)

Update Dockerfile to debian 11

* Change gMapSides when knife round swaps. (splewis#753)

This should fix Side Restore Issues in splewis#699.

* Include basic mkdocs installation.

Update build to use one run instead of multiple.

TODO: Update build job to build and host files with GH Pages.

* Documentation conversion. Start with essentials.

Include build job for github pages.

Update example match json for new map pool.

* Update mkdocs and github action.

* Update published directory.

* Try once more.

* Change to a different build process.

* Another build change?

* Include space for commands for proper formatting.

* Remove redunant text in README and point to docs site.

* Swap URL.

* Branch update.

* Include colours from the utils class.

* Update generate_docs.yml

Attempt to fix directory issue

Co-authored-by: Alex <[email protected]>
PhlexPlexico added a commit to PhlexPlexico/get5 that referenced this issue Jul 2, 2022
* Update Dockerfile to debian 11 (splewis#760)

Update Dockerfile to debian 11

* Change gMapSides when knife round swaps. (splewis#753)

This should fix Side Restore Issues in splewis#699.

* Include basic mkdocs installation.

Update build to use one run instead of multiple.

TODO: Update build job to build and host files with GH Pages.

* Documentation conversion. Start with essentials.

Include build job for github pages.

Update example match json for new map pool.

* Update mkdocs and github action.

* Update published directory.

* Try once more.

* Change to a different build process.

* Another build change?

* Include space for commands for proper formatting.

* Remove redunant text in README and point to docs site.

* Swap URL.

* Branch update.

* Include colours from the utils class.

* Update generate_docs.yml

Attempt to fix directory issue

Co-authored-by: Alex <[email protected]>

Shift docs generation around.
PhlexPlexico added a commit to PhlexPlexico/get5 that referenced this issue Jul 8, 2022
* Update Dockerfile to debian 11 (splewis#760)

Update Dockerfile to debian 11

* Change gMapSides when knife round swaps. (splewis#753)

This should fix Side Restore Issues in splewis#699.

* Include basic mkdocs installation.

Update build to use one run instead of multiple.

TODO: Update build job to build and host files with GH Pages.

* Documentation conversion. Start with essentials.

Include build job for github pages.

Update example match json for new map pool.

* Update mkdocs and github action.

* Update published directory.

* Try once more.

* Change to a different build process.

* Another build change?

* Include space for commands for proper formatting.

* Remove redunant text in README and point to docs site.

* Swap URL.

* Branch update.

* Include colours from the utils class.

* Update generate_docs.yml

Attempt to fix directory issue

Co-authored-by: Alex <[email protected]>

Shift docs generation around.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants