lilium-voyager/code/q3_ui
Zack Middleton f7c3276fe8 Fix g_teamAutoJoin and g_teamForceBalance
There are various issues caused by not knowing the initial team for
the local client and bots when they connect. This is can be reproduced
by starting a team game from the main menu.

When g_teamAutoJoin is enabled, bots and local client join a random
team at connect and then execute their team command a few frames
later. This may result in the player being killed if they specify a
different team. In Team Arena's Harvester mode this causes harvester
skulls to be spawned at the beginning of the game.

When g_teamForceBalance is enabled, the local client and bots may not
be able to join their desired team. This may result in them being
spectators. If g_teamAutoJoin is also enabled they may be left on
the opposite (red/blue) team they were meant to join.

There is a hack for including bot's team in their player info string
(used by cgame for which team skin to use) before the bot joins
their desired team. Bots aren't guaranteed to join their desired team
(as may happen when both g_teamAutoJoin and g_teamForceBalance are
enabled) so clients may see them as being on the wrong team!

----

Add teampref userinfo option for team preference. If teampref is set
it will be used for attempting to join the team immediately at connect.

Bots now join team at connect using teampref userinfo. So remove
the hack for setting bot's team in player info string before the bot
joins the team.

To avoid the client sending teampref userinfo to all network servers,
the local client uses a g_localTeamPref cvar. The g_localTeamPref
cvar is cleared after it's used so it doesn't get used when starting
another server later. Another reason not to use a teampref userinfo
cvar is there isn't a reliable way to clear it in CGame/UI which are
likely loaded from baseq3 pk3.

Make it so g_teamAutoJoin doesn't affect clients who specify
teampref. If teampref is invalid, the client will join a random team
like g_teamAutoJoin.

Don't apply g_teamForceBalance to the local client or bots. Otherwise
they may be left as spectators when starting team game from menu.

The start server menus use team command and g_localTeamPref to set
the human player's team. This way it's compatible with vanilla Q3
game VMs and the new setting team at connect feature.
2017-06-22 21:56:20 -05:00
..
ui_addbots.c Make add bots menu use standard menu drawing 2015-09-16 01:43:28 -05:00
ui_atoms.c remove a bunch of superfluous formatting calls 2012-06-19 14:52:22 +00:00
ui_cdkey.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_cinematics.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_confirm.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_connect.c Bug 5094 - Code cleanup, patch by Zack Middleton and DevHC. Fixes unused-but-set gcc warnings 2011-07-29 12:27:00 +00:00
ui_controls2.c Fix always switching back to mgun in Q3 controls menu 2014-05-18 20:27:18 -05:00
ui_credits.c Add smiletheory to credits in q3_ui. 2012-10-26 04:16:25 +00:00
ui_demo2.c Bug 5094 - Code cleanup, patch by Zack Middleton and DevHC. Fixes unused-but-set gcc warnings 2011-07-29 12:27:00 +00:00
ui_display.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_gameinfo.c Fix iamamonkey printing 'levels' instead of 'awards' 2016-05-23 10:23:14 -05:00
ui_ingame.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_loadconfig.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_local.h renderer -> renderergl1, rend2 -> renderergl2 2013-02-15 23:46:37 +00:00
ui_login.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_main.c Fix g_teamAutoJoin and g_teamForceBalance 2017-06-22 21:56:20 -05:00
ui_menu.c In q3_ui if uis.demoversion is set, hide "Team Arena" and "Mods" in main menu. (They aren't shown in id's q3a demo and use to be drawn under demo message). 2012-12-01 23:17:14 +00:00
ui_mfield.c Fix overstrike/insert logic being reversed in q3_ui 2014-07-03 21:06:05 -05:00
ui_mods.c * Merge unified-sdl to trunk 2007-09-05 18:17:46 +00:00
ui_network.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_options.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_playermodel.c Bug 5035 - Automatically selecting player model in q3_ui does not work if skin is not specified, patch by Zack Middleton 2011-06-11 15:26:36 +00:00
ui_players.c Fix 'missing token' in parsers for animations.cfg 2017-06-07 19:06:41 -05:00
ui_playersettings.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_preferences.c Fix ui warnings 2014-09-01 11:05:46 +01:00
ui_qmenu.c Add mouse wheel support to UI list boxes 2017-06-03 14:03:09 -05:00
ui_rankings.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_rankstatus.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_removebots.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_saveconfig.c Add string length checking to function COM_StripExtension. This fixes the R_RemapShader buffer overflow exploit that can be found here: 2006-05-06 01:56:24 +00:00
ui_serverinfo.c Fix IPv6 favorites in q3_ui 2013-02-08 18:11:03 -06:00
ui_servers2.c Replace constant value with UIAS_GLOBAL1 2017-06-01 17:24:06 -05:00
ui_setup.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_signup.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_sound.c Added option for selecting sound system (SDL or OpenAL) and option for setting SDL sound quality to q3_ui sound menu. 2011-09-20 03:29:22 +00:00
ui_sparena.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_specifyleague.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_specifyserver.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_splevel.c Fix possible levelPicNames buffer overflow in q3_ui 2015-01-12 21:28:03 -06:00
ui_sppostgame.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_spreset.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_spskill.c * Added STATUS 2005-10-29 01:53:09 +00:00
ui_startserver.c Fix g_teamAutoJoin and g_teamForceBalance 2017-06-22 21:56:20 -05:00
ui_team.c Fix ui warnings 2014-09-01 11:05:46 +01:00
ui_teamorders.c fix team orders menu 2006-12-28 17:46:10 +00:00
ui_video.c Fix ui warnings 2014-09-01 11:05:46 +01:00