The C reference landed a robustness batch in mas-bandwidth/netcode#191 (from netcode#190). Two pieces of it are mirrored surface in this port and should land here too. No wire format change in either.
1. Two new create-time error codes, mirrored by value
netcode.h gained:
NETCODE_CLIENT_CREATE_ERROR_MISSING_OVERRIDE_CALLBACK 7
NETCODE_SERVER_CREATE_ERROR_MISSING_OVERRIDE_CALLBACK 8
The enums here mirror those values position for position — Client.cs:41-56 and Server.cs:21-36 — so the two new codes must land in the same positions, appended after the existing last member of each, not renumbered around.
2. The unchecked callback class
The same null-callback class exists in this port:
Client.cs:496
Client.cs:729
Server.cs:881
In C the fix is a create-time refusal: if override_send_and_receive is set and either override callback is null, create fails with the new code rather than dereferencing the pointer on the first update; and the loopback entry points refuse a loopback client or slot when the loopback send callback is unset, in every build. The same refusal should happen here, at the same points, so a misconfigured caller gets a failed create instead of a null dereference.
Citing netcode#191 for the reasoning and the red/green on each.
The C reference landed a robustness batch in mas-bandwidth/netcode#191 (from netcode#190). Two pieces of it are mirrored surface in this port and should land here too. No wire format change in either.
1. Two new create-time error codes, mirrored by value
netcode.hgained:NETCODE_CLIENT_CREATE_ERROR_MISSING_OVERRIDE_CALLBACK 7NETCODE_SERVER_CREATE_ERROR_MISSING_OVERRIDE_CALLBACK 8The enums here mirror those values position for position —
Client.cs:41-56andServer.cs:21-36— so the two new codes must land in the same positions, appended after the existing last member of each, not renumbered around.2. The unchecked callback class
The same null-callback class exists in this port:
Client.cs:496Client.cs:729Server.cs:881In C the fix is a create-time refusal: if
override_send_and_receiveis set and either override callback is null, create fails with the new code rather than dereferencing the pointer on the first update; and the loopback entry points refuse a loopback client or slot when the loopback send callback is unset, in every build. The same refusal should happen here, at the same points, so a misconfigured caller gets a failed create instead of a null dereference.Citing netcode#191 for the reasoning and the red/green on each.