News:

Please do not feed the trolls.

Main Menu

TEAM BALANCE glitch

Started by ocd, August 08, 2018, 06:41:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ocd

hello, it appears team balance is being maliciously compliant. if you join the server and the teams are balanced at 2v2, you can't join blue or red, only spec.

thanks.
ocd

pizzahut

#1
Do you remember which map it was?

I guess the plugin is getting confused with ESN being in the green team, though I don't see why right now. It's probably this part of code:

// Allow team switch if switching from spectator to a regular team
// and the size of the new team is less than or equal the average.

if((oldteam == 0) && (1 <= newteam) && (newteam <= 4)
&& ((HumanCount[newteam] * g_teams) <= sum))
return PLUGIN_CONTINUE // Team switch allowed


oldteam==0 means you're switching from spec, newteam between 1 and 4 means switching into a regular team. This should be fine so far.

Next check is the critical one, the human count of the team you're switching to should have at most an average amount of human players. You could write it as

HumanCount[newteam]  <= sum / g_teams

Where sum = human count for all regular teams (not spectators) and g_teams is the amount of teams which have spawns (which typically is blue and red, so 2 teams). This should resolve to

2 * 2 <= 4

and thus allow team switch. I've provided Bishop with some debug code which may help, it's not really possible to test this locally.

ocd

openfire lowgrens, 2fort, and the one with the waterfalls around the base logos.

the servers were dead all morning because only 2 people per team were allowed to join red or blue, but you could spec all day. not sure if there was a bot glitch or not. guess we shall see tonight or tomorrow am... thanks

pizzahut

#3
Well at least atm it seems to work, don't think anything has been changed yet. Map is emit_r.


Bishop

If this problems happens again, please copy and paste debug information from your console here.  It will look similar to this:


[STB] Team switch denied
oldteam=0 newteam=2
HumanCount[1]=1 HumanCount[2]=2 HumanCount[3]=0 HumanCount[4]=0
HumanCount[2]*g_teams=4 g_teams=2 sum=3