Commit Graph

90 Commits

Author SHA1 Message Date
Zack Middleton 58f257e868 Send empty snapshots to clients downloading using legacy protocol
Save bandwidth by excluding entity and player state changes from
snapshots sent to clients downloading using the legacy protocol. The
snapshots are mainly needed to update the reliableAcknowledge.

The idea is from Noah "Chomenor" Metzger's ioef-cmod project. Though I
implemented the dummy snapshot code closer to the real snapshot code.
2018-05-18 09:53:49 -05:00
Zack Middleton e1f0a69716 Merge branch 'master' into game/eliteforce
Conflicts:
	Makefile
	code/qcommon/msg.c
	make-macosx-app.sh
2018-05-18 04:40:21 -05: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 e45538b1c5 Merge branch 'master' into game/eliteforce
Conflicts:
	README.md
	code/server/sv_client.c
2018-03-03 19:27:28 -06: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 4837f4619e Merge branch 'master' into game/eliteforce
Conflicts:
	code/client/cl_main.c
	code/qcommon/common.c
	code/qcommon/files.c
	code/qcommon/msg.c
	code/qcommon/q_shared.h
	code/renderercommon/tr_common.h
	code/renderergl2/tr_extensions.c
	code/sdl/sdl_glimp.c
2017-09-17 23:16:55 -05: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 69f9c7d692 Merge branch 'master' into game/eliteforce
Conflicts:
	Makefile
	code/qcommon/q_shared.h
2016-06-17 02:22:52 -05: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 95928708f7 Make sending downloads using legacy protocol work with sv_dlRate 1000
Send snapshot with each download block so that client updates reliable
acknowledge, otherwise client can error when asking for next block via
nextdl reliable command.
2015-08-22 21:49:55 -05:00
Zack Middleton 50c78e6d52 Fix sending downloads to 1.2 clients / legacy protocol 2015-08-22 20:12:43 -05:00
Zack Middleton 7f5096c450 Fix protocol handshake with iostvoyHM 1.37 clients
iostvoyHM 1.37 asks for protocol 25 and falls back to legacy protocol 24
when rejected with a specific message.

When the protocol was changed to 26, the message the client checks for
whether it should use legacy protocol was changed causing it to no
longer be able to join. So let's restore the message.
2015-08-16 01:45:22 -05:00
Zack Middleton 7e663b7c86 Misc Elite Force code clean up 2014-10-29 10:52:23 -05:00
Zack Middleton b7cd6b6088 Elite Force white space clean up
Also fixed some code to match ioq3 (a few comments, a printf, ..).
2014-10-29 10:13:12 -05:00
Zack Middleton c6e5f060fe Port Elite Force iorev2231 patch to latest ioq3
Port Thilo Schulz's Elite Force Holomatch patch to latest ioq3.
Patch for ioq3 svn r2231.

No support for OpenGL2 renderer yet.
2014-10-29 07:15:12 -05: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