Skip to content

fix: Handle error replies to noray connect command - #666

Open
armadavalor wants to merge 1 commit into
foxssake:mainfrom
armadavalor:fix/noray-connect-nat-error
Open

armadavalor wants to merge 1 commit into
foxssake:mainfrom
armadavalor:fix/noray-connect-nat-error

Conversation

@armadavalor

Copy link
Copy Markdown

When noray can't connect two peers, e.g. because the host OID is unknown, it replies with a connect command whose payload is an error message (connect AssertionError: Unknown host oid: ...) instead of an address. _handle_commands() indexed parts[1] of the split payload unconditionally, so Noray.connect_nat("invalid_game_id") crashed with an invalid index access.

The handler now checks that the payload is host:port, logs an error otherwise, and does not emit on_connect_nat.

Tested: read through the noray server source to confirm the reply format. Not run in Godot, no automated test added.

Closes #619

When noray can't connect two peers, e.g. because the host OID is unknown, it replies with a `connect` command whose payload is an error message instead of an address. The handler indexed the split result unconditionally, which crashed. Log the error and skip emitting `on_connect_nat` instead.

This branch has not been deployed

No deployments
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.

Invalid game id crashes game

1 participant