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

Player disconnect prior to ready up causes a series end #549

Closed
jeaye opened this issue Jun 26, 2020 · 8 comments · Fixed by #831
Closed

Player disconnect prior to ready up causes a series end #549

jeaye opened this issue Jun 26, 2020 · 8 comments · Fixed by #831
Labels

Comments

@jeaye
Copy link

jeaye commented Jun 26, 2020

If making a feature request, you should delete all the pre-filled text here.
If reporting a bug, fill in the following sections:

Expected behavior

Hello! Thanks for the amazing plugin. I just hit an issue the other day where, in a 2v2, I had 3 players connect (2 on team A and 1 on team B), but then one of them crashed before any of them could ready up. get5 instantly ended the series, booted everyone, and then whenever they tried to join again they would see "No match setup".

Actual behavior

Having a player disconnect prior to readying up, and prior to the ready up wait time expiring, shouldn't end the series. There's a good chance that player will connect again and ready up before his team is considered forfeit.

Steps to reproduce

Please note that "latest" is NOT a version! See https://github.com/splewis/get5/wiki/Debugging-help#finding-get5-version if you need help finding these. Adding the output file produced by get5_debuginfo is extremely helpful.

  • Plugin version: (0.7.2-dev+492) by splewis
  • Sourcemod version: 1.10.0.6462
  • Steps to reproduce (please be specific):

The exact repro steps for my case, which was a 2v2, is to:

  • Connect both players on team A (no need to ready up)
  • Connect one player on team B and then disconnect that player
  • Observe the series ends

This can be summarized with a quick log snippet (Laz3rFaz3r and NotFrench1000Island are on teamA and shintarou99 and someone else are on team B):

L 06/25/2020 - 01:10:32: "Laz3rFaz3r<3><STEAM_1:0:194711125><>" STEAM USERID validated
L 06/25/2020 - 01:10:36: "NotFrench1000Island<4><STEAM_1:0:49702299><>" connected, address ""
Client "NotFrench1000Island" connected (98.4.135.101:27005).
L 06/25/2020 - 01:10:36: "NotFrench1000Island<4><STEAM_1:0:49702299><>" STEAM USERID validated
L 06/25/2020 - 01:10:38: "shintarou99<5><STEAM_1:0:109861155><>" connected, address ""
Client "shintarou99" connected (24.57.227.242:27005).
L 06/25/2020 - 01:10:38: "shintarou99<5><STEAM_1:0:109861155><>" STEAM USERID validated
L 06/25/2020 - 01:10:39: "shintarou99<5><STEAM_1:0:109861155><>" disconnected (reason "Disconnect")
L 06/25/2020 - 01:10:39: get5_event: {
    "matchid": "example_match",
    "params": {
        "client": "none",
        "map_number": 0,
        "map_name": "de_dust2"
    },
    "event": "player_disconnect"
}
L 06/25/2020 - 01:10:39: get5_event: {
    "matchid": "example_match",
    "params": {
        "team": "none",
        "team2_series_score": 0,
        "team1_series_score": 0
    },
    "event": "series_end"
}
Dropped shintarou99 from server: Disconnect

The full log for this is attached.
5ef3f9388aa70817388d65d6.log

@slawteruk
Copy link

This is the first time I've seen this issue in over 1000+ matches being played. I'm not sure if CSGO or Sourcemod has the ability to register a game crash but if it did it would be useful for us to have this exposed some how in the logs.

@TandelK
Copy link
Contributor

TandelK commented Jun 27, 2020

This thing should not happen as per the below code that is used in get5.

get5/scripting/get5.sp

Lines 598 to 604 in 300b1ab

// TODO: consider adding a forfeit if a full team disconnects.
if (g_EndMatchOnEmptyServerCvar.BoolValue && g_GameState >= Get5State_Warmup &&
g_GameState < Get5State_PostGame && GetRealClientCount() == 0 && !g_MapChangePending) {
g_TeamSeriesScores[MatchTeam_Team1] = 0;
g_TeamSeriesScores[MatchTeam_Team2] = 0;
EndSeries();
}

Currently you can use get5_end_match_on_empty_server to 0 and disable it.

@thboss
Copy link

thboss commented Aug 7, 2020

if (g_EndMatchOnEmptyServerCvar.BoolValue && g_GameState >= Get5State_Warmup &&

set g_GameState > Get5State_Warmup

@PhlexPlexico
Copy link
Collaborator

Okay so I was looking at the log provided here, and I think I may have found out why it's doing this, but I'll need to test to confirm.

Am I safe to make the assumption that this player had "connected" but not had fully loaded into the game? I.e. they were both in the map loading screen and one person disconnected with a keybind? Because I think that may be a case when you connect. I'll double check and see if I can verify.

if (g_EndMatchOnEmptyServerCvar.BoolValue && g_GameState >= Get5State_Warmup &&

set g_GameState > Get5State_Warmup

We definitely do not wish to do this, as if both teams get into warmup and leave, we want to forfeit the match.

@PhlexPlexico
Copy link
Collaborator

Looks like I'm able to reproduce this. You must have get5_end_match_on_empty_server set to 1. Both players connect, and if one drops on the loading screen while there are no clients in game, this causes the series to end as a forfeit for both teams. I think we need to adjust GetRealClientCount() to make sure we're checking clients who are connected but not in game maybe?

@nickdnk
Copy link
Collaborator

nickdnk commented Aug 12, 2022

@PhlexPlexico What about just doing this:

  1. On player disconnect, if there are no players left on the server, start a 1-minute timer that ends the series.
  2. When someone connects, delete the timer if it is running.

@PhlexPlexico
Copy link
Collaborator

I think there was a to-do mentioned about auto forfeiting as well. I like the idea of a timer, because then it would definitely avoid this bug as well! Avoids the headaches of finding all the edge cases of adjusting GetRealClientCount().

@nickdnk
Copy link
Collaborator

nickdnk commented Aug 15, 2022

Yes, we just add GetRealClientCount to the timer's callback as well and do nothing if there are players on the server. This is an easy fix with timers. I'll do it.

@nickdnk nickdnk linked a pull request Aug 15, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants