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

Randomly moving half a team to coach positions #716

Closed
kubo6472 opened this issue Nov 20, 2021 · 8 comments · Fixed by #754
Closed

Randomly moving half a team to coach positions #716

kubo6472 opened this issue Nov 20, 2021 · 8 comments · Fixed by #754

Comments

@kubo6472
Copy link

Expected behavior

Only the person who types in !coach (in this case nobody did) will get moved to the coaching position for that team and this place is limited for 1 player per team.

Actual behavior

Three of the team players without typing anything got moved to the coaching position until the match was ended and created again.

Steps to reproduce

The output file produced by get5_debuginfo

get5_version
"get5_version" = "0.7.2" notify singleplayer replicated - Current get5 version
sm version
SourceMod Version Information:
SourceMod Version: 1.10.0.6513
SourcePawn Engine: 1.10.0.6513, jit-x86 (build 1.10.0.6513)
SourcePawn API: v1 = 5, v2 = 12
Compiled on: Sep 22 2021 01:46:49
Built from: https://github.com/alliedmodders/sourcemod/commit/698cc8e
Build ID: 6513:698cc8e
http://www.sourcemod.net/
  • Steps to reproduce (please be specific):
  1. Create a match (BO2 in this case, may be related to g_BO2Match not resetted after match. BO2 stuck until server reboot. #708)
  2. Players join and some of them are in spectator positions for the teams they are in (coaches)
  3. Console is spammed with ([BUG] "You can only change coaching position during warmup." #700) since they are all trying to switch to their team
  4. I tell them to stop
  5. Force end the match
  6. Create it from the scratch
@TandelK
Copy link
Contributor

TandelK commented Nov 21, 2021

@kubo6472 How many players are set in per team and how many extra players are joining ? By default it will work like Max Players per team is set to 5 and 2 other players of that team join in, they will be auto moved to Coach position. By default CSGO Game has added limitation to Competitive Mode on Server that it will only allow max 5 players per team, so the best way for joining sequence will be first the coach join the server and than he directly types !coach sending him first to coach slot and keeping last 5 slot empty for players.

Share your config file that was executed on the server , you can remove player id with player1 , player2 if you want.
Use pastebin and share it here.

Also for all this bugs please make sure to replicate them with Video so it can be easily to find exact issue and Preference of the bug .

@kubo6472
Copy link
Author

{"matchid":"85","match_title":"Map {MAPNUMBER} of {MAXMAPS}","side_type":"standard","veto_first":"team1","skip_veto":false,"min_players_to_ready":4,"players_per_team":5,"team1":{"name":"Hobovci","tag":"HBV","flag":"SK","players":{"76561198053544786":"Mar9Sal","76561198052369078":"Denis Zachranca 13","76561198231420988":"Nebojácny Jack Hju 23","76561198154519096":"Hobko","76561198056559942":"Miniama","76561198092343285":"Žigov Blafák"}},"team2":{"name":"Esport TUKE NXT","tag":"eTuke N","flag":"SK","players":{"76561199003407221":"❤Gezi❤","76561198151769382":"PE4CE","76561197962110336":"marjen","76561198866394969":"phe0nqx","76561199021130778":"Raklic"}},"cvars":{"get5_web_api_url":"https://cs.jakubdobos.eu/api","get5_check_auths":"1"},"spectators":{"players":[]},"maplist":["de_inferno","de_ancient","de_mirage","de_nuke","de_overpass","de_dust2","de_vertigo"],"min_spectators_to_ready":0,"num_maps":2}

Here, sorry, the first one was incorrect. This is the config file.

@kubo6472
Copy link
Author

How many players are set in per team

Five

how many extra players are joining

Extra? Zero. Only the five specified joined.

@nickdnk
Copy link
Collaborator

nickdnk commented Jan 5, 2022

How many players are set in per team

Five

how many extra players are joining

Extra? Zero. Only the five specified joined.

Coaches need to be the 6th player, don't they?

@kubo6472
Copy link
Author

kubo6472 commented Jan 5, 2022

Coaches need to be the 6th player, don't they?

1st question was how many were set, since you can't specify coaches, yet (#705). Then, I was mentioning the situation, where no coaches were suppossed to be on that match, yet two, or rather three players just ended up in coaches, when there were only 5 players per team on the server. Alse @nickdnk 's answer totally contradicts what @TandelK recommends. Anyway, as I mentioned, the best solution is to filter coach position with steamid, no matter how many valid steamids were specified, allow only the first five to play, kick out the rest, except the coach with his steamid.

@PhlexPlexico
Copy link
Collaborator

PhlexPlexico commented May 26, 2022

Coaches need to be the 6th player, don't they?

1st question was how many were set, since you can't specify coaches, yet (#705). Then, I was mentioning the situation, where no coaches were suppossed to be on that match, yet two, or rather three players just ended up in coaches, when there were only 5 players per team on the server. Alse @nickdnk 's answer totally contradicts what @TandelK recommends. Anyway, as I mentioned, the best solution is to filter coach position with steamid, no matter how many valid steamids were specified, allow only the first five to play, kick out the rest, except the coach with his steamid.

So I know this is almost 6 months old, but I am working on some of the coaching logic now. However, as it stands it looks like this is an interesting edge case with the logic in the current code.

if (csTeam != GetClientTeam(client)) {
// SwitchPlayerTeam(client, csTeam);
int count = CountPlayersOnCSTeam(csTeam);
if (count >= g_PlayersPerTeam) {
if (!g_CoachingEnabledCvar.BoolValue) {
KickClient(client, "%t", "TeamIsFullInfoMessage");
} else {
LogDebug("Forcing player %N to coach", client);
MoveClientToCoach(client);
Get5_Message(client, "%t", "MoveToCoachInfoMessage");
}
} else {
LogDebug("Forcing player %N onto %d", client, csTeam);
FakeClientCommand(client, "jointeam %d", csTeam);
}

It just checks to see if coaching is enabled and throws the user into the coach slot if possible (without the use of !coach, only if the team is full). Right now, there exists a bug where users cannot join coaching during freeze time (not sure if CS:GO swapped their coaching conditions, but the comment in the code suggests you should be able to during freezetime....), which may cause some UB if multiple people are trying to coach/swap teams during a timeout as well, since if they are trying to select a new team it may hit that conditional if coaching is enabled. I think a fix for this may be included in #754 where we can simply check if the coaching values are set or not, and just kick the player if they are trying to join the game when the coach slot is occupied.

ETA: With the changes for coaches coming in, I believe this should be resolved since we'll be tracking who is a coach on a team now.

@PhlexPlexico PhlexPlexico linked a pull request Jun 23, 2022 that will close this issue
@kubo6472
Copy link
Author

kubo6472 commented Oct 11, 2022 via email

@nickdnk
Copy link
Collaborator

nickdnk commented Oct 11, 2022

This is already the behavior on 0.10.

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.

4 participants