get5 icon indicating copy to clipboard operation
get5 copied to clipboard

Player disconnect prior to ready up causes a series end

Open jeaye opened this issue 4 years ago • 5 comments

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

jeaye avatar Jun 26 '20 18:06 jeaye

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.

slawteruk avatar Jun 27 '20 11:06 slawteruk

This thing should not happen as per the below code that is used in get5. https://github.com/splewis/get5/blob/300b1abe96ebda805dd501ef2d78fe935489efb1/scripting/get5.sp#L598-L604

Currently you can use get5_end_match_on_empty_server to 0 and disable it.

TandelK avatar Jun 27 '20 12:06 TandelK

https://github.com/splewis/get5/blob/300b1abe96ebda805dd501ef2d78fe935489efb1/scripting/get5.sp#L599 set g_GameState > Get5State_Warmup

thboss avatar Aug 07 '20 10:08 thboss

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.

https://github.com/splewis/get5/blob/300b1abe96ebda805dd501ef2d78fe935489efb1/scripting/get5.sp#L599

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 avatar Jul 29 '22 13:07 PhlexPlexico

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?

PhlexPlexico avatar Jul 29 '22 13:07 PhlexPlexico

@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.

nickdnk avatar Aug 12 '22 02:08 nickdnk

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().

PhlexPlexico avatar Aug 12 '22 03:08 PhlexPlexico

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 avatar Aug 15 '22 12:08 nickdnk