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

Remove dead/server-only network protocol code #1548

Merged
merged 8 commits into from
Jan 17, 2024

Conversation

dgelessus
Copy link
Contributor

This drops various bits of code under pnNetCli that are unused and very unlikely to ever be useful, namely:

  • The last remaining server-side network code. I assume that we'll never see the plServer sources that would need this code.
  • Unused network message field types that are difficult/impossible to use correctly. With the base network protocols being almost frozen, I assume there will never be any use for these extra types.

As usual, the commit messages for the non-obvious changes have more detailed reasoning.

The server side probably needs this so it can look up the right
protocol for each incoming connection, but the client always knows which
protocol it's using and so doesn't need a global registry.

This reduces the amount of bookkeeping needed in pnNetCli without
requiring much more work in plNetGameLib.
There's no difference between the "raw" and non-"raw" types. "ptr" is
the same as "data", but unused and not fully implemented.
NET_MSG_FIELD_QWORD and NET_MSG_FIELD_DOUBLE cannot be sent reliably,
because NetCliSend receives all message arguments as uintptr_t, which
for 32-bit builds isn't large enough to hold 64-bit values.

NET_MSG_FIELD_FLOAT is technically fine, but passing it the expected way
through a uintptr_t requires some very counterintuitive casting. All the
corresponding _ARRAY types are mostly fine as well, because
multi-element arrays are passed by pointer, which by definition always
fits into uintptr_t. I'm removing these field types as well though,
because they're potentially error-prone, aren't currently used anywhere,
and are unlikely to ever be used in the future (because the low-level
network protocol will never change and is very unlikely to be extended).
@Hoikas Hoikas merged commit df92223 into H-uru:master Jan 17, 2024
17 checks passed
@dgelessus dgelessus deleted the pnnetcli_dead_code branch January 17, 2024 21:32
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.

2 participants