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

last player on red goes spectator when match end #28

Closed
huseyinsoyluu opened this issue Apr 9, 2022 · 2 comments
Closed

last player on red goes spectator when match end #28

huseyinsoyluu opened this issue Apr 9, 2022 · 2 comments

Comments

@huseyinsoyluu
Copy link

You can watch between 0:47 and 1:30

Summary

  1. Before match end, room has 9 people; specs has 2 afk (which is gambler and Procyon) (maxTeamSize is 3, so there is no problem)

  2. Red Team: wangdu, ihtiyar, z1z0u and Blue Team: loweskjea, KITIGAWA, NNAZYY

  3. After match end, red team goes spectator(wangdu, ihtiyar, z1z0u), bcs blue team wins the match (0:51 on recording)

  4. loweskjea, KITIGAWA, NNAZYY are going to red bcs they are lastWinner. (0:52 on recording)

  5. There is a bug occurs. The latest player for winnerTeam going to spec for no reason, (in this case NNAZYY). (0:53 on recording)

  6. I checked immediately afk players and NNAZYY doesn't afk (0:59, there is chat log 😴 AFK Oyuncular: gambler., which is listing AFK, there is just gambler)

  7. Second bug: Red team captain(1:15 on recording, loweskjea) choose NNAZYY (there is no chat log, weird)

  8. Red team captain (loweskjea, 1:25 on recording) kicked for not selecting player in time period (actually he selected or paired randomly )

https://thehax.pl/forum/powtorki.php?nagranie=680fa95e6ce632077ff5156b493af235 is recording link and
I hope you can understand the issue, this really weird for me :D

@huseyinsoyluu huseyinsoyluu changed the title Latest player on red goes spectator when match end last player on red goes spectator when match end Apr 9, 2022
@Wazarr94
Copy link
Owner

Wazarr94 commented Apr 9, 2022

It is linked with these lines in the balanceTeams function:

if (streak == 0 && gameState == State.STOP) {
    if (Math.abs(teamRed.length - teamBlue.length) == 2) {
        var teamIn = teamRed.length > teamBlue.length ? teamRed : teamBlue;
        room.setPlayerTeam(teamIn[teamIn.length - 1].id, Team.SPECTATORS)
    }
}

This is supposed to rebalance teams if both captains are choosing (streak == 0 is only supposed to happen if there was a draw). But in your case it wasn't a draw, so what happened ?
I have seemingly forgotten to update the streak correctly, so this is a very important bug you spotted, and I will fix this in the same update as the issue before, in the afternoon.
Thanks for noticing as always

@Wazarr94
Copy link
Owner

Wazarr94 commented Apr 9, 2022

For the other problem, I'm not sure at the moment, but fixing the first bug might be a good first step

@Wazarr94 Wazarr94 closed this as completed Apr 9, 2022
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

No branches or pull requests

2 participants