Skip to content

Mirror #191: two new create-time error codes and the unchecked callback class #7

Description

@rowan-claude

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions