Commit graph

3164 commits

Author SHA1 Message Date
Zack Middleton
7c601da651 Fix not adding random bot when all bot info are in use on team
If there are two bot infos in scripts/bots.txt then each team can
only add two random bots via bot_minplayers or addbot random.

Pick random bot info from least used bot infos instead of only ones
that are used by zero players. That way a random bot can always be
added to the game.

This rarely affected Quake 3 since there is 32 bot infos. It could
easily affect new games though.
2017-06-29 19:41:16 -05:00
Zack Middleton
d0d1fe1b7c Fix bot_minplayers passing delay as team to addbot in non-team gametypes 2017-06-29 19:41:16 -05:00
Zack Middleton
51649695a5 Fix random bot not looking for bots by funname
Quake 3's Anarki bot has a 'funname' with colors in it.
This commit fixes Anarki not being detected as in use.
2017-06-29 19:41:16 -05:00
Zack Middleton
23a331c9f8 Make 'addbot random' command select a random bot info
It reuses the random bot selection code for bot_minplayers cvar.
2017-06-29 19:41:16 -05:00
Zack Middleton
007e250e11 Split G_AddRandomBot into multiple functions 2017-06-29 17:52:06 -05:00
Zack Middleton
ccfc9011e2 travis-ci: Upgrade to docker build system 2017-06-24 20:51:07 -05:00
Zack Middleton
2e5c4bd96a travis-ci: Don't run coverity_scan on master branch
Once the weekly limit for Coverity scan is reached all builds exit
success without compiling.
2017-06-24 20:48:11 -05:00
Zack Middleton
03336dd0bf Allow spectators to use noclip cheat 2017-06-24 20:27:24 -05:00
Zack Middleton
7b9ccd1463 Have spectator always be in first person
Flying around in third person with no body is weird.
2017-06-24 20:25:39 -05:00
Zack Middleton
c2ca5e7856 Check for unlimited time power up using INT_MAX
It is possible for a power up to exceed 999 seconds without it being
unlimited time.
2017-06-24 20:25:39 -05:00
Zack Middleton
520b100449 Make cg_teamChatsOnly only affect team gametypes
Also made it so that 'tell voice chats' are always allowed for
consistancy with 'tell chat'.

Reported by Tobias Kuehnhammer.
2017-06-24 20:25:39 -05:00
Zack Middleton
f19efb77c8 Fix Team Arena team base models not dropping to floor
Team Arena's Overload gametype has red and blue team Obelisk base
objects. It uses separate entities for visual and damage. Only the
damageable entity was dropped to floor. Leaving model floating off
the ground.

Team Arena's Harvester base has the same problem. Model entity
floats in air but trigger entity drops to floor.

Drop all Team Arena team base models to floor. Fixes CTF, 1Flag,
Overload, and Harvester base models.
2017-06-24 20:15:02 -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
SmileTheory
e03cdf444c OpenGL2: Remove SF_VAO_MESH. 2017-06-16 16:52:53 -07:00
Zachary J. Slater
fd3b58b967 Merge pull request #293 from rcgordon/autoupdater-rsa-signature 2017-06-10 21:00:51 -10:00
Zack Middleton
e9436abff0 Only allow connectionless print/echo from server/rcon address
Reported by Ensiform.
2017-06-10 19:15:26 -05:00
Zack Middleton
dfce71929a Add con_autochat and con_autoclear cvars 2017-06-08 15:46:19 -05:00
Zack Middleton
c12b81a273 Fix strncpy usage in botlib
All usage of strncpy in botlib should now either set string
terminator or use Q_strncpyz.
2017-06-07 21:48:01 -05:00
Tobias Kuehnhammer
8956ab41dd Fix notarget cheat
Bots no longer target players in 'no target mode'.
2017-06-07 21:27:33 -05:00
Zack Middleton
c99281a0da Make bots stop attacking player after disconnect
Bots did not notice player disconnected, so they kept attacking
the last known position.

Checking if entity is valid in BotEntityVisible might fix other
similar issues too.
2017-06-07 21:11:52 -05:00
Zack Middleton
9aae0948ab Remove unused define MAX_COMMANDARGUMENTS from be_ea.c 2017-06-07 21:11:38 -05:00
Zack Middleton
74a59f17c7 Don't copy p->org to itself in cg_particles.c 2017-06-07 21:07:42 -05:00
Zack Middleton
8a6c9d1038 Remove unneeded 'angles' variables/clearing in ai_dmq3.c 2017-06-07 21:06:28 -05:00
Zack Middleton
730b917059 Fix comment in BotAIPredictObstacles 2017-06-07 20:53:35 -05:00
Zack Middleton
a738cb9592 Fix overdraw in CG_DrawRect
It was noticeable in the corners when alpha was less than 1.
2017-06-07 20:40:16 -05:00
Zack Middleton
1a8bf792e7 Range check client number for trap_BotUserCommand 2017-06-07 20:38:12 -05:00
Zack Middleton
5b9302a7ef Don't start game entity loops at index 1 2017-06-07 20:32:57 -05:00
Zack Middleton
71512bb1fd Show client's name in callvote clientkick vote display message
Make callvote always kick by client num so player can't rename to
avoid being kicked. Don't allow calling a vote to kick host or
non-existent players.
2017-06-07 20:24:10 -05:00
Zack Middleton
eeb28dc1d0 Fix score info being dropped by server
Server drops reliable command string if it's length is more than 1022.
2017-06-07 19:55:36 -05:00
Zack Middleton
91acf8a681 Don't build score info for bots, they don't parse it 2017-06-07 19:54:34 -05:00
Zack Middleton
b511b8f2f6 Fix Coverity warning that endVelocity is uninitialized 2017-06-07 19:51:32 -05:00
Zack Middleton
c96acec428 Fix (unused) check for map restart in CG_TransitionSnapshot 2017-06-07 19:42:32 -05:00
Zack Middleton
1456008d96 Fix comment for CG_SetInitialSnapshot 2017-06-07 19:41:46 -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
6e340f9a5b Don't use uninitialized ps from BotAI_GetClientState
If BotAI_GetPlayerState returns qfalse, ps is untouched and in
some cases means uninitialized. So don't use it if not valid.
2017-06-07 19:02:20 -05:00
Zack Middleton
74aa4268b2 Stop caching sv_maxclients in bot code 2017-06-07 19:00:28 -05:00
Zack Middleton
d1631d6ea3 Use const char pointers when possible in botlib's libvar code 2017-06-07 18:54:49 -05:00
Ryan C. Gordon
76e6b3c534 Removed unnecessary trailing backslash. 2017-06-04 16:43:50 -04:00
Ryan C. Gordon
b771192d52 Use "x86_64" and not "x86-64" like everything else in ioq3. 2017-06-04 02:46:49 -04:00
Ryan C. Gordon
749e17ab1d Add a log message if manifest is valid. 2017-06-04 02:23:49 -04:00
Ryan C. Gordon
a761684a23 Windows support for autoupdater manifest signatures. 2017-06-04 02:21:55 -04:00
Ryan C. Gordon
c9c5d8710a Added .gitignore for rsa_tools directory. 2017-06-04 01:49:33 -04:00
Ryan C. Gordon
06cc3a4e1b build-rsa-tools.sh now works on Linux. 2017-06-04 01:44:39 -04:00
Ryan C. Gordon
ced7437042 Updated autoupdater-readme.txt with manifest signing details. 2017-06-04 01:32:41 -04:00
Ryan C. Gordon
e04bfd4967 Autoupdater now checks RSA digital signature for manifest. 2017-06-04 01:32:10 -04:00
Ryan C. Gordon
f71260eb8c Replace sha256.c with libTomCrypt equivalent, since we'll be using it anyway. 2017-06-04 01:17:17 -04:00
Ryan C. Gordon
62f6f0c7e0 Wire up libTom stuff to build system. 2017-06-04 01:16:37 -04:00
Ryan C. Gordon
7542966e33 Verify libTom source archives aren't tampered with. 2017-06-04 01:15:38 -04:00
Ryan C. Gordon
ece37f1390 Initial add of rsa_tools.
This is just a simple RSA public key digital signature thing built on
libtomcrypt. The gist:

Some admin will generate a public/private key with rsa_make_keys, keeping the
private key secret. Using the private key and rsa_sign, the admin will sign
the autoupdater manifests, generating manifest.txt.sig.

The public key ships with the game (adding 270 bytes to the download), the
.sig is downloaded with the manifest by the autoupdater (256 bytes extra
download), then the autoupdater checks the manifest against the signature
with the public key. if the signature isn't valid (the manifest was tampered
with or corrupt), the autoupdater refuses to continue.

If the manifest is to be trusted, it lists sha256 checksums for every file to
download, so there's no need to sign every file; if they can't tamper with the
manifest, they can't tamper with any other file to be updated since the file's
listed sha256 won't match.

If the private key is compromised, we generate new keys and ship new
installers, so new installations will be able to update but existing ones
will need to do a new install to keep getting updates. Don't let the private
key get compromised. The private key doesn't go on a public server. Maybe it
doesn't even live on the admin's laptop hard drive.

If the download server is compromised and serving malware, the autoupdater
will reject it outright if they haven't compromised the private key, generated
a new manifest, and signed it with the private key.

libtomcrypt is sort of a big pile of source code, so instead of putting it
in revision control, we have a script to download it. Most things don't need
it. It lives on GitHub, so we _could_ do a git submodule, but most people
don't need it, so why waste their disk and bandwidth? That said, when compiled
you end up with a few hundred kilobytes of binary code to verify a signature
and no external dependencies, so it seems like a win.
2017-06-03 20:26:07 -04:00