Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with Q2PRO: Network/protocol changes #369

Merged
merged 58 commits into from
Jan 23, 2024

Conversation

res2k
Copy link
Contributor

@res2k res2k commented Jan 21, 2024

Upstream changes related to the network protocol.

This will break sound from player's own entity when playing a MVD
without dummy MVD observer spawned and chasing a player.
Set minimum Q2PRO protocol version to 1015, which was added more than 13
years ago in r335.
Also implement for old netchan.
From a description of deflate() it seems like one should always allocate
buffer big enough for the worst case compression using deflateBound() in
order for deflate(Z_FINISH) to succeed in one call.

While it doesn't seem to be the case in practice, and deflate(Z_FINISH)
will succeed as long as there is enough space for compressed data,
restructure code to always perform compression into statically allocated
buffer that's big enough to hold deflateBound(MAX_MSGLEN) bytes.
The server will never send such packet, but this happens in some
(possibly edited) demos.
Previously, maximum download size was limited by MAX_LOADFILE which was
4 MiB originally, later bumped to 16 MiB and finally 64 MiB. This is too
much for UDP downloads, which are kept in memory until client stops
downloading. Make maximum download size configurable and change it to be
just 8 MiB by default.
No point sending if it matches from->origin, same with new entities.
Pack angles using ANGLE2SHORT() unconditionally. Simply downscaling
packed value to a byte works.
Previously changing e.g. ‘net_ip’ to bad value would crash the server.
Just print a warning and give server operator a chance to correct it.
Always fully disconnect and reconnect when user types ‘reconnect’ at
console.
Don't print ‘can't reconnect to loopback’ if local server is running.
Client will auto reconnect anyway.
This was undocumented and obscure feature. Just use ‘cl_protocol’.
Pass non-zero value only when using R1Q2 protocol.
Only allow extrabits on few specific commands and only when protocol
version allows it. Prevents possible covert information exchange.
Default limit of 100 is just too low. Misconfigured clients using rate
100 can take minutes to enter a server, raise minimum rate to 1500 to
prevent this.
@apanteleev apanteleev merged commit 32d0fe4 into NVIDIA:master Jan 23, 2024
2 checks passed
@res2k res2k deleted the q2pro-sync-network branch January 25, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants