Skip to content

v1.4.10

Latest

Choose a tag to compare

@rowan-claude rowan-claude released this 10 Nov 16:04
d6bc96d

netcode 1.4.10 is a bug-fix release. Nothing on the wire changed, and 1.4.9 and 1.4.10 peers connect to each other in both directions. Some receive rules are stricter, and STANDARD.md now states them.

A server refuses a connect token whose expire timestamp minus max_connect_token_lifetime is at or before the second the server started; 1.4.9 refused only tokens before that second. Timestamps are whole seconds, so a token issued in the start second cannot be told from one issued earlier in that second. A server accepts full-lifetime tokens from the second after it starts. A backend in the same process as the server issues its tokens after that second, as client_server.c now does.

Reading packets: an encrypted packet with sequence 2^64-1 is ignored for every packet type, because replay protection reserves that value. The client ignores a keep-alive whose max clients is outside [1,256] or whose client index is not below max clients, and ignores a packet from any address other than its server's before reading it. The receive loops skip zero-length datagrams, and WSAEMSGSIZE on Windows, instead of stopping at them.

Client: a connected client that its server disconnects goes to disconnected; it no longer moves on to the next server address in the connect token. Connect token expiry is measured from netcode_client_connect, not restarted for each server address. Connect skips server addresses of a family the client has no socket for, and goes to invalid connect token if none is left. A loopback connect goes through the state change callback.

Server: a connect token history entry is consumed only by the connection its request started. A pending encryption mapping lasts no longer than its connect token. In the disconnect callback the slot already reads as disconnected and is no longer counted, while its client id, address and user data stay readable; a disconnect of the same client from inside the callback does nothing, and stopping the server from inside it is safe. Connect token bytes and the keys of expired mappings are cleared.

Windows: socket handles are stored as SOCKET. Packet tagging stays best effort: if the qWAVE calls fail, the failure is logged and the socket is kept, untagged.

Tests: the unit tests take no real time and bind no sockets. The real-socket tests are behind -DNETCODE_FUNCTIONAL_TESTS=ON and run in CI on Linux, macOS and Windows. Known-answer vectors pin the encrypted packet and token bytes.