Commit graph

81 commits

Author SHA1 Message Date
smallmodel
cc18246f22 Prevent SV_DropClient() from being called recursively if the client is dropped by a kick or timeout and has too many reliable commands 2024-10-11 21:03:44 +01:00
ineed bots
47c9641939 Fix bad client reliableAcknowledge DOS exploit
Having a reliableAcknowledge of 0x7FFFFFFF causes a massive
loop to be executed in SV_UpdateServerCommandsToClient due to the + 1 overflow.
2023-04-19 14:10:29 +01:00
Zack Middleton
3bf48877f3 Fix "Going to CS_ZOMBIE for [clientname]" developer message
Client name was cleared before printing the message resulting in
a blank name.
2018-04-03 21:37:59 -05:00
Zack Middleton
b61e2998f3 Fix exploit to reset player by sending wrong serverId
If client sends wrong serverId but is already active in the world
(CS_ACTIVE) don't resend initial gamestate for the map. This isn't a
valid situation. The player should be CS_CONNECTED or CS_PRIMED.

Resending gamestate to an active player will cause them to respawn
without dying or disconnecting. If the player had a CTF flag it gets
lost until the map is changed or restarted.

Reported by Ensiform at:

    https://bugzilla.icculus.org/show_bug.cgi?id=6324
2018-04-03 21:37:15 -05:00
Zack Middleton
adef4e6c9e Don't register fs_game cvar everywhere just to get the value 2018-01-21 06:02:08 -06:00
Thomas Köppe
ed1794fe17 Change shift expressions to unsigned types. Shifting signed values to
a result that is not representable has undefined behaviour.
2018-01-21 06:01:50 -06:00
Zack Middleton
c68e471430 Don't have clients use private slots when sv_privatePassword is unset 2016-12-05 12:40:00 -06:00
Zack Middleton
615b73288f Use Opus for VoIP
Server/client VoIP protocol is handled by adding new cvars
cl_voipProtocol and sv_voipProtocol, sv_voip and cl_voip
are used to auto set/clear them. All users need to touch
are cl/sv_voip as 0 or 1 just like before.

Old Speex VoIP packets in demos are skipped.
New VoIP packets are skipped in demos if sv_voipProtocol
doesn't match cl_voipProtocol.

Notable difference between usage of speex and opus codecs,
when using Speex client would be sent 80ms at a time.
Using Opus, 60ms is sent at a time. This was changed because
the Opus codec supports encoding up to 60ms at a time.
(Simpler to send only one codec frame in a packet.)
2016-01-06 05:19:10 -06:00
Zack Middleton
718d0a0d11 Fix sending pk3 download error messages to clients
Disabled in e52a492f61.
2014-02-09 20:23:48 -06:00
Tim Angus
7b15415042 Rate limit getchallenge 2013-06-10 20:31:15 +01:00
Zack Middleton
b943d506bf Fix clients being able to reset their player state and respawn using donedl. 2012-12-15 08:08:46 +00:00
Zack Middleton
50475fc37b Fix server ignoring client move commands if voip data is included. 2012-12-13 23:54:58 +00:00
Zack Middleton
a4c61d874d add a missing '\n', remove some unwanted ones
From /dev/humancontroller.
2012-06-18 16:16:57 +00:00
Zack Middleton
d9b72dedc1 Require gamename if not supporting legacy protocol. 2011-09-07 19:38:19 +00:00
Thilo Schulz
ba385fa43c - Switch master server protocol to dpmaster for better game separation. Based partly on patch by Zack Middleton
- Get rid of ugly cvars sv_heartbeat and cl_gamename and replace with single com_gamename
- Remove sv_flatline. Flatlines are ignored by dpmaster and are considered to be insecure because flatlines can be udp-spoofed.
2011-07-29 13:46:50 +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
2349148cf1 - Apply parts of Ben Millwood's target bitfield patch (#3787)
- Fix Ryan's FIXME and have voip packet buffer on the server dynamically allocated via Z_Malloc and store pointers in a circular buffer
- Improve voip target parsing on top of Ben Millwood's patch
- Add new "spatial" target where speaker is spatialized in 3d space and can be heard by all clients in hearing range (s_alMaxDistance)
  (#4467)
- Decrease voip sound lengths from 240ms to 80ms per voip packet to mitigate udp packet loss and decrease latency
- Protocol version incremented to 71
2011-07-27 15:47:29 +00:00
Thilo Schulz
4c5e9963e3 Fix compile for USE_VOIP=0 2011-07-16 11:14:20 +00:00
Thilo Schulz
58a5d3d383 Have server send protocol version in challengeResponse so protocol negotiation works. (Where did this one get lost?) 2011-07-15 14:49:51 +00:00
Thilo Schulz
f6d6ed4b30 - Revert back to Z_Malloc from Hunk_FreeTempMemory introduced in r2077 as Hunk_FreeTempMemory must be freed in LIFO order (#5079)
- Introduce SV_ClientFree() to prevent memory leaks r2077 was supposed to fix
2011-07-15 14:44:06 +00:00
Thilo Schulz
d827447da8 - Forgot to mention: last rev (2077) bumped default protocol version to 70
- Fix queued packet rate control
2011-07-13 18:37:26 +00:00
Thilo Schulz
ac30d86db0 - Improve snapshot rate and data rate control
- Make server send packet fragments and queued packets when server is idle
- Voip protocol detection is tied to com_protocol making past-end-of-message reading unncessary
- Use Hunk_AllocateTempMemory() for buffering VOIP packets and fix buffering scheme that ryan hates so much
- Disable packet scrambling for new protocol as it is useless now
- Get rid of the old packet scrambling functions predating latest point release
- Use Hunk_AllocateTempMemory() for netchan packet queue to fix memory leak when client gets disconnected with packets in the queue
- Use Hunk_AllocateTempMemory() for download blocks to fix memory leak when client gets disconnected with download blocks in the queue
- Fix SV_RateMsec to account for udp/udp6 packet lengths
2011-07-13 17:11: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
e52a492f61 - Greatly improve UDP downloading speed for clients
- Add download rate control cvar sv_dlRate
- Don't send snapshots to downloading clients
2011-07-12 11:01:20 +00:00
Thilo Schulz
74e538ffcf - Add better protection against DoSing connecting users from connecting
- Have Com_sprintf return string length
- add STR_LEN macro for static strings
2011-07-07 16:07:58 +00:00
Thilo Schulz
b509d770a7 - Remove Q_strrchr(), replace with standard, portable strrchr()
- Add strrchr() to bg_lib.c, patch by DevHC
2011-05-15 14:08:03 +00:00
Thilo Schulz
c95bd0a684 Remove newlines from Com_Error message format strings, patch by DevHC 2011-05-12 14:02:48 +00:00
Thilo Schulz
a9696d3558 Refactoring patch by DevHC 2011-05-11 14:21:27 +00:00
Thilo Schulz
d34c6b7e0b Revert protocol 69 pending further discussion (#4962) 2011-04-27 20:17:45 +00:00
Thilo Schulz
a5580d8974 - Harden the client and server protocol against UDP spoofing attacks. This will defend ioquake3 against http://aluigi.altervista.org/papers/q3noclient.txt (#3041)
- Retains full compatibility to the old but unsecure protocol between clients and servers
- Harden the connection process against DoS attacks, possibly connected to UDP spoofing
2011-04-27 16:03:35 +00:00
Thilo Schulz
fef4d12d68 Refactoring patch by DevHC 2011-03-05 19:20:37 +00:00
Thilo Schulz
0387b8002e Add cvar "protocol" so user can change protocol version on command line, for standalone games. Most of the patch by Simon McVittie with a few minor modifications by myself 2011-03-05 19:10:23 +00:00
Thilo Schulz
ba19fe1152 Still not compiling when STANDALONE is set 2011-02-08 20:24:41 +00:00
Thilo Schulz
7efcc91265 fix compiling error when in standalone mode 2011-02-08 20:21:37 +00:00
Thilo Schulz
ecbe1ab9fd Thanks Simon McVittie for fixing the bug regression in https://bugzilla.icculus.org/show_bug.cgi?id=4629 2011-02-04 15:11:57 +00:00
Thilo Schulz
3148416c04 - Change runtime standalone detection:
* com_standalone now read-only
  * add new cvars com_basegame, com_homepath
  * standalone now automatically detected when com_basegame is set to something different than baseq3 and no id pak pk3s are found
  * This fixes https://bugzilla.icculus.org/show_bug.cgi?id=4699
- Replace a few hardcoded string literals with macros
- Add checks for Team Arena PK3s to FS_CheckPak0()
2011-02-04 12:04:56 +00:00
Thilo Schulz
de0e3cba34 Fix hanging client when map_restart executed on the server while client is still loading the map 2011-01-27 16:40:15 +00:00
Zachary Slater
df758ba6c2 Bugzilla #4629
commands sent to client when disconnecte
2010-10-25 06:43:55 +00:00
Thilo Schulz
186f30a74f Fix netcode inconsistency, thanks to /dev/humancontroller for the patch, see http://bugzilla.icculus.org/show_bug.cgi?id=4060 2009-10-12 17:17:15 +00:00
Thilo Schulz
9b7543a905 Fix circumventing sv_maxping restriction, thanks to Amanieu for reporting. http://bugzilla.icculus.org/show_bug.cgi?id=3423 2009-10-08 20:03:25 +00:00
Tim Angus
5c62c95c64 * Fix incorrect comment 2009-10-05 22:07:01 +00:00
Ryan C. Gordon
8d0f212521 When dropping bots, don't move to CS_ZOMBIE. Go straight to CS_FREE.
They aren't a real network connection, so you don't want to waste time before
 opening the slot for humans.

  Fixes Bugzilla #4243.
2009-09-15 01:11:09 +00:00
Thilo Schulz
18cc7c1ed3 Make servers echo challenge codes from client getchallenge commands 2009-06-01 05:28:47 +00:00
Thilo Schulz
e4d0c14f70 Revert changes of rand() to random() as random() was redefined in quake3. 2009-05-31 20:24:10 +00:00
Thilo Schulz
b40f1507ea - Introduce seeding of the random number generator at startup
- Replaced all engine-side occurances of rand() with random()
2009-05-31 19:48:28 +00:00
Thilo Schulz
50ca55702f - Introduce new NET_CompareBaseAdrMask for easy comparison of ip address ranges
- Overhaul of the new banning functions:
  * basic check for redundant bans/exceptions
  * introduction of sv_banFile to make it possible to configure the file where to read bans and exceptions from
  * bans can now be deleted by giving address ranges, too.
2009-05-24 16:58:08 +00:00
Ludwig Nussel
bbd9f02d08 mark functions static (#4010) 2009-05-08 09:48:45 +00:00
Ludwig Nussel
ae612721a3 fix STANDALONE challengeResponse (#4000) 2009-03-02 17:29:51 +00:00
Ludwig Nussel
f5aae78481 security fix: prevent command injection via callvote 2009-01-17 23:09:58 +00:00
Tim Angus
37d664d4b2 * Rename voip cvar to cl_voip
* s/#if USE_VOIP/#ifdef USE_VOIP/
* Add generalised runtime cvar range checking, currently on [sv|cl]_voip,
  dedicated and a bunch of r_ variables
2008-07-07 22:31:39 +00:00