Commit Graph

105 Commits

Author SHA1 Message Date
Zack Middleton 9f239d647b Make 'globalservers 0' fetch all masters
This commit fixes the vanilla Q3 UI VMs not displaying a server list
when id Software's master server is down.

Originally master 0 for the globalservers command was Internet and
master 1 was MPlayer (defunct). In 2008 ioquake3 changed it so that
master 0 to 4 were five separate master servers with no affect on
original Quake3/Team Arena UI VMs; they continued to get the server
list from master.quake3arena.com.

id Software's master server (master.quake3arena.com) goes down
occasionally. Using ioq3's UI VM additional master servers can be
accessed but players using the original UI VMs are unable to get a
server list.

In order to fix the original UI VMs in Quake3/Team Arena's pk3s this
commit makes 'globalservers 0' fetch all master servers. So players
get a combined list of id Software's and ioquake3's master list. Or
just ioquake3's list if id Software's master is down.

Getting lists from individual master servers using globalservers has
changed from 0 through 4 to 1 through 5 to accommodate using 0 for
other purposes. This commit modifies ioq3's UI code to support the new
values for globalservers command.

A side affect of these changes is that UI VMs based on ioq3 since 2008
will have Internet1 fetch all master servers and Internet2 request
sv_master1 instead of sv_master2 and so on. It may be worth noting that
getting server list from masters 3-5 could not be done using ioq3's UI
before 2011.
2017-07-20 15:39:51 -05:00
Zack Middleton cbd9e432b5 Fix nonresponsive favorites in q3_ui having no hostname
ArenaServers_InsertFavorites() fails to do anything because favorites
are added to the server list even if nonresponsive.

Set nonresponsive favorite server hostname to address.
2017-07-01 14:26:36 -05:00
Zack Middleton 8c3d1fcf59 Allow changing q3_ui server source during refresh
This makes it easier to scroll through the list, especially since
"Local" source now refreshes until a local server is found.
2017-07-01 14:17:45 -05:00
Zack Middleton 0ba359c29e Make UI continue searching for local servers until found
When refreshing local servers, Team Arean UI never changed the status
message when it timed out. This gave a false impression it was still
looking for servers.

Let's continue looking for local servers in q3_ui and Team Arena UI
until one is found.
2017-07-01 14:17:22 -05:00
Zack Middleton d9c2e91919 Fix q3_ui cursor going off screen in widescreen 2017-07-01 11:27:22 -05:00
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
Zack Middleton 1048073e26 Unify checks for missing COM_Parse() token 2017-06-07 19:16:05 -05:00
Zack Middleton d58234a6c7 Fix 'missing token' in parsers for animations.cfg 2017-06-07 19:06:41 -05:00
Zack Middleton db1198f6ea Add mouse wheel support to UI list boxes
Allows scrolling server browser list and some other lists.
2017-06-03 14:03:09 -05:00
Zack Middleton 2bbe178bc8 Replace constant value with UIAS_GLOBAL1 2017-06-01 17:24:06 -05:00
Zack Middleton f6f2710f94 Make server browser default to Internet
The default use to be local. In q3_ui you have to press spacebar or
wait for scan to time out before you can switch to Internet.
2017-06-01 16:58:21 -05:00
Zack Middleton 7811b2acb2 Fix iamamonkey printing 'levels' instead of 'awards' 2016-05-23 10:23:14 -05:00
Zack Middleton 3001cacf89 Make add bots menu use standard menu drawing
Made add bots menu draw banner and background like remove bots menu.
2015-09-16 01:43:28 -05:00
Zack Middleton af8acbd7a9 Make barrel/flash model name buffer safe 2015-01-12 22:35:20 -06:00
Zack Middleton af617bc0e6 Fix possible levelPicNames buffer overflow in q3_ui 2015-01-12 21:28:03 -06:00
Zack Middleton daa604ae9b Fix parsing bots in arena info with trailing spaces
q3_ui would shown bot at index of number of bots in list.
game would send empty name to addbot command and command would think skill
(i.e., 2.000000) was the bot name.
2015-01-12 21:28:03 -06:00
Tim Angus b55809b925 Fix ui warnings 2014-09-01 11:05:46 +01:00
Zack Middleton d9309ac6db Fix overstrike/insert logic being reversed in q3_ui 2014-07-03 21:06:05 -05:00
Zack Middleton a3c2f77236 Fix Gauntlet barrel axis in UI
UI's PositionRotatedEntityOnTag is different than CGame's and
UI has switched pitch/roll for Gauntlet/BFG axis to get it to
look like /close to/ how it looks in CGame.

Making UI use the same *PositionRotatedEntityOnTag and axis as
CGame fixes the Gauntlet blade being wobbly in controls menu.
2014-05-18 20:38:14 -05:00
Zack Middleton daa570c193 Fix always switching back to mgun in Q3 controls menu
Caused by 120e296a74.
2014-05-18 20:27:18 -05:00
Razish 61dd609aee Fix warning message in animation.cfg parsing functions
Signed-off-by: Zack Middleton <zturtleman@gmail.com>
2013-09-04 15:51:34 -05:00
/dev/humancontroller 120e296a74 fix some OOB enumerator usages
(should be no-op with usual compiler workings)
2013-05-30 15:48:49 -05:00
Tim Angus f6fb9eb602 renderer -> renderergl1, rend2 -> renderergl2 2013-02-15 23:46:37 +00:00
Zack Middleton 75598f1a2b Fix IPv6 favorites in q3_ui
This does however allow favorites to contain hostnames which was explicitly not allowed before.
2013-02-08 18:11:03 -06:00
Zack Middleton 4ba14425ed Add togglemenu to q3_ui controls menu 2013-01-16 23:04:50 -06:00
Zack Middleton 311acbe263 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
Zack Middleton 64ed856dfd Add smiletheory to credits in q3_ui. 2012-10-26 04:16:25 +00:00
Zack Middleton cf30922932 Fix resetting single player level selection in q3_ui when there is no training level, such as in demoq3. 2012-09-30 06:21:08 +00:00
Zack Middleton a32dc4dca4 Fix arrow buttons in q3_ui join server menu to be selectable by mouse. 2012-09-30 03:59:10 +00:00
Zack Middleton 656a0145bc Added myself to ioq3 credits in q3_ui. 2012-09-30 03:10:10 +00:00
Zack Middleton 11811e8138 Fix UI player model FOV when using non-640x480 resolution. 2012-09-30 02:56:50 +00:00
Zack Middleton 2cb7f25093 Cache servers for each master server in q3_ui, otherwise servers from last updated master for shown for all Internet# sources. 2012-09-17 04:16:30 +00:00
Zack Middleton 2db73231eb remove a bunch of superfluous formatting calls
From /dev/humancontroller.
2012-06-19 14:52:22 +00:00
Zack Middleton a375f898f5 REFACTOR [anough to enough] 2012-06-18 16:39:58 +00:00
Zack Middleton 3f79d04536 Center ioq3 credits vertically. 2011-09-20 03:39:23 +00:00
Zack Middleton 2943488927 Added option for selecting sound system (SDL or OpenAL) and option for setting SDL sound quality to q3_ui sound menu.
Sound settings must now be applied before they take affect (needed for sound system and SDL sound quality changes).
2011-09-20 03:29:22 +00:00
Thilo Schulz af4607c026 Bug 5178 - Sound quality menu option has no effect 2011-09-19 22:38:51 +00:00
Zack Middleton 1469df546e Reverted r2145 per Timbo's suggestion. 2011-08-11 20:57:39 +00:00
Zack Middleton 1609d1c42b - Added r_mode -2 for using display resolution.
- Changed q3_ui's very high video settings use display resolution.
2011-08-11 05:14:42 +00:00
Zack Middleton 8e689739f4 Removed "Color Depth" from q3_ui system settings, it didn't control anything. 2011-08-11 03:57:23 +00:00
Zack Middleton f220db0e08 Fixed viewing sv_master[3-5] in q3_ui server browser (don't give engine fake sources). 2011-08-05 08:10:54 +00:00
Thilo Schulz eb9fe030c4 Batch of bug fixes for gamecode. Patch compiled and log message written by Tobias Kuehnhammer (#5144)
################################################################################
This Patch fixes:
################################################################################

- The "fraglimit warning" was not played at all, if on the blue team.
- The "where" console command was broken.
- Obelisk explosion wasn't drawn if no Rocketlauncher was loaded.
- Impact marks sometimes didn't draw at all.
- IMPORTANT BUGFIX: No killing for cheaters with Lightning gun and Gauntlet.
- If two doors are close to each other a spectator couldn't fly through them.
- More robust, efficient and logical respawning routine.
  NOTE: The game.qvm will get notable smaller and will use LESS MEMORY!
- Drowning sounds are fixed. Now they are played as intended. (as the id
comment
  in the source code shows).
- Some AI bugs (OVERFLOW!) in the bot movement code.
- Several "Team Arena" Overload and Harvester bugs.
- Stops bots from attacking a team mate (player) who only changed teams.
- Some voice chats and CTF commands fixed.
- "Team_ReturnFlag" was called twice, which did wired things sometimes. 
  NOTE: (G_RunItem checks CONTENTS_NODROP already!)
- A bugfix for Gauntlet animation.
- Incorrect CTF scoring.
- A bunch of corrected comments and print lines ("\n").
- Some regularity of expression and some small trivial bugs.

################################################################################
Details:
################################################################################

********************************************************************************
BUG: in gamemode GT_TEAM the fraglimit warning will not be played if joining
the
     blue team!
--------------------------------------------------------------------------------
Solution: In "CG_CheckLocalSounds": if cgs.scores2 > highScore, highScore
should
          be cgs.scores2.
********************************************************************************
BUG: the "where" console command doesn't work as expected (it's always 0 0 0) 
     but not in id Quake 3 Arena. It seems that now Ioquake3 is affected!
--------------------------------------------------------------------------------
Solution: In Function "Cmd_Where_f" ent->s.origin should be 
          ent->r.currentOrigin.
********************************************************************************
BUG: in gamemode GT_OBELISK obelisk explosion won't be drawn if there is no 
     Rocketlauncher loaded. (The "maps without Rocketlauncher" bug)
--------------------------------------------------------------------------------
Solution: in "cg_main.c": cgs.media.rocketExplosionShader should be registered 
          if gamemode is GT_OBELISK.
********************************************************************************
BUG: Impact marks sometimes doesn't draw at all. Not easy to reproduce if you 
     don't play (io)Quake3 every day and know the places where it happens! ;) 
     But anyway...
     Test: start q3dm12 go to "Long Jump Canyon" (where the small platform 
     teleporter for the BFG is) place yourself at the point where the railgun 
     spawns, look in the direction where the red suspended armor is. Now shoot
     at the sloped wall on the out/leftside of the door you see. (the sloped 
     wall should be nearly in the center of your screen now). If you choose the 
     correct brush face and shoot up and down at this brush face, the impact 
     marks sometimes aren't visible.

     There are hundreds of custom maps where this can happen!
--------------------------------------------------------------------------------
Solution: I replaced the function "SnapVectorTowards" with the one from 
         "Wolfenstein - Enemy Territory (GPL Source Code)"
********************************************************************************
BUG: Normally "NOCLIP" cheaters are logically not allowed to fire a gun.
     Unfortunatly the Gauntlet (and Lightning gun) was forgotten and not 
     restricted to that. All weapons except those two were handled correct. 
--------------------------------------------------------------------------------
Solution: Make Gauntlet and Lightning gun not firing for someone who cheats 
          with "NOCLIP" (like all other weapons).
********************************************************************************
NOTE: A few bugfixes are not mine and are reported here: 
      http://www.quake3world.com/forum/viewtopic.php?f=16&t=9179.

      Thanks to Quake3world, for all those years and the good guys there!
********************************************************************************
BUG: During making a mod I found a very strange bug, which mainly occurs if
     someone tries to implement a lot of singleplayer monsters which should
walk
     slowly (like the "Crash" bot). So if someone wants to make slow down bots
     or monsters when they are walking towards a goal and alter the function
     "BotMoveInGoalArea" then the bots/monsters do stupid things. Otherwise and
     this is the default (also buggy) behavior they start running although they
     shouldn't (as seen with the "Crash" bot and will not be fixed here).
--------------------------------------------------------------------------------
Solution: Fix overflow in bot user command. BUGFIX from "Hunt" mod by J. 
          Hoffman.
********************************************************************************
BUG: in function "BotMoveToGoal" the special elevator case doesn't make sense.
--------------------------------------------------------------------------------
Solution: in "be_ai_move.c": ((result->flags & MOVERESULT_ONTOPOF_FUNCBOB) ||
                              (result->flags & MOVERESULT_ONTOPOF_FUNCBOB)) 
                   should be ((result->flags & MOVERESULT_ONTOPOF_ELEVATOR) ||
                              (result->flags & MOVERESULT_ONTOPOF_FUNCBOB)).
********************************************************************************
BUG: in function "BotWantsToRetreat" and "BotWantsToChase" this is wrong:
     "(bs->enemy != redobelisk.entitynum || bs->enemy !=
blueobelisk.entitynum)"
--------------------------------------------------------------------------------
Solution: "... redobelisk.entitynum) && (bs->enemy != blueobelisk.." is
correct.
********************************************************************************
BUG: in gamemode GT_OBELISK there are too many node switches for bots 
     (test: mpq3tourney6 with many bots). If that happens, game becomes 
     unplayable. I don't know if this is the best solution but here it is:
--------------------------------------------------------------------------------
Solution: In function "AINode_Battle_Fight" right after:
if (!BotEntityVisible(bs->entitynum, bs->eye, bs->viewangles, 360, bs->enemy))
{
   I added this: 
#ifdef MISSIONPACK
    if (bs->enemy == redobelisk.entitynum || bs->enemy == 
                                                        blueobelisk.entitynum)
{
    AIEnter_Battle_Chase(bs, "battle fight: obelisk out of sight");
    return qfalse;
    }
#endif
********************************************************************************
BUG: in gamemode >= GT_TEAM, after team change, bots will (sometimes) not stop
     shooting at you, although you are on their team now. It seems that the 
     configstrings are f***** up or not reliable in this case!
--------------------------------------------------------------------------------
Solution: In function "BotTeam" and "BotSameTeam" get the real team values.
********************************************************************************
BUG: Some of the bots voice commands are wrong. They are commanded to attack
the
     enemy base but they say "Okay, I will defend!"
--------------------------------------------------------------------------------
Solution: Corrected some voice commands in "BotCTFOrders_FlagNotAtBase" and
         "Bot1FCTFOrders_EnemyDroppedFlag"
********************************************************************************
BUG: Spectators couldn't fly through doors if they are very close to each
other.
     You can test it with some regular id maps (q3dm14, q3dm12) but there are
     also many custom maps where this can happen! This is annoying because in 
     the worst case you can't move at all and are caught inside a door.
--------------------------------------------------------------------------------
Solution: There is a solution in a mod called "Hunt" by J. Hoffman. 
          Bugfix is included in this patch!
********************************************************************************
BUG: During making a mod I found it very hard to implement some of my ideas
     (something like "Limbo" or "Meeting") because of the way the player spawn
     effect, intermission and spawning on victory pads is handled. I reworked
it
     a bit and simplified it so that the effect is handled when a client      
     respawns
     (as the name says) and not when a client begins. I think this will help 
     more
     mod makers everytime they want to make changes to spawning of players,
bots
     on victory pads or monsters... and want to avoid spectators with 
     Machineguns
     which can kill and score... :()

     NOTE: I also renamed the poorly named function "respawn" 
           to "ClientRespawn". If someone searches the code base for "respawn" 
           it was really hard to find the correct place for what was 
           meant. "respawn" is used so often, that you really get headache ... 
           now with "ClientRespawn" it's easier!

     IMPORTANT: The whole respawning, moving to intermission point and 
                everything related to that is now done in a more reliable way 
                without changing the default behavior. (How critical the whole 
                spwaning mess was did you see by yourself (ioquake3 rev. 2076). 
                With this patch it's safer. 
                Trust me, I spent hours of fixing silly problems...
-------------------------------------------------------------------------------- 
Solution: Simplified "ClientBegin" and moved the teleport event  
          to "ClientSpawn".
********************************************************************************
BUG: If a player is dying or hurted under water the hurt/dying sounds AND the
     drowning sounds are played together. This is silly. Moreover it's no good
     idea to let the server play client sounds! There was a solution in a mod 
     called "Q3A++" by Dan 'Neurobasher' Gomes which fixes the problem.
--------------------------------------------------------------------------------
Solution: Created a "CG_WaterLevel" function to play the appropriate sounds.
********************************************************************************

################################################################################
2011-08-01 11:39:33 +00:00
Thilo Schulz 2e94ec6b85 Bug 5134 - q3_ui incorrectly tells user to refresh servers while auto-refreshing, patch by Zack Middleton 2011-07-31 19:21:56 +00:00
Thilo Schulz 23f6fd1633 Bug 5094 - Code cleanup, patch by Zack Middleton and DevHC. Fixes unused-but-set gcc warnings 2011-07-29 12:27:00 +00:00
Thilo Schulz a844c94af1 - Add dual protocol support to team arena demo selector
- Fix demo selection in team arena menu on case sensitive file systems
- Some changes in the way how vanilla q3 demo file lists are compiled in the menu
2011-07-13 08:40:30 +00:00
Thilo Schulz e06c117e9e - Implement dual protocol support (#4962)
- Fix several UDP spoofing security issues
2011-07-12 11:59:48 +00:00
Thilo Schulz 7666c2f54c Add fixes to ui menu by Ensiform and DevHC (#5062) 2011-07-07 16:12:53 +00:00
Thilo Schulz 23ceb05c87 Correct fix to (#5051), patch by Roughael 2011-06-24 13:10:45 +00:00
Thilo Schulz d9ea902c31 Fix by Laurent Desnogues for my feeble attempt at a fix 2011-06-21 19:33:02 +00:00
Thilo Schulz 6a3142d2c1 Fix to (#5051) - strchr in GraphicsOptions_GetAspectRatios() might return NULL for some strange reason 2011-06-21 11:45:34 +00:00