Nakama-godot: party presence events not being delivered

I’m using the latest Nakama-godot version from the asset lib and working with the party subsystem of nakama.

I am able to create parties and join them no problem, however whenever a user joins a party, nobody in the party receives party events. I have the following signals connected on the realtime socket in godot:

  1. received_party_presence
  2. received_party

I see in the Nakama logs that the party join is being processed and the party is correctly being set to open.

I’m at a loss here as there is very little ability to debug any of this. Any guidance is appreciated!

My test environment is Windows 11 for the Godot build and Nakama v3.20 is running in a container via wsl2.0 (docker-compose)

Hey @jonbonazza the nakama-godot repository is open source so you do have the ability to debug it. This repository is community-maintained at the moment, but we do have a tests for parties and presences here:

Do you see any differences in how the code is setup for these tests and your own code?

Thanks for the reply. After some digging I think I found what’s going on, though I’m not certain how to solve it.

So when Im testing, I start two to three instances of my game. One server and one-to-many clients. It seems that when I start the first instance (in my case the server) I can connect to the socket and everything fine. However when I then try to connect the websocket from another instance (such as a client), the connection fails with the following log:
=== Nakama : WARNING === Connection error: 22

and the following response from the connect_socket call.

NakamaException(StatusCode={-1}, Message='{}', GrpcStatusCode={-1}

I’m not sure what connection error 22 is.
I had a search through both the Nakama and nakama-common code base and didn’t see any reference to this error code. Then checked the nakama-godot codebase. Same. No reference, but digging through the code, I realized that it was just returning the error directly from Godot’s WebSocketPeer, so looking at that code, I realized that error code 22 is actually a Godot error and cooresponds to ERR_ALREADY_IN_USE.

I suspect it’s reusing a client port. I’m not even sure whether this is something that you all have control over or a fundamental flaw in Godot’s WebSocketPeer. Gonna bring this up with the Godot team.

Depending on what they say, I might have to open an issue with the nakama-godot repo, and potentially try to fix it myself as this is a critical error that completely blocks development of the party subsystem of my game.

As embarrassing as it is to admit, the stuff above was a bit of a ree herring and i ended up find the issue in my code. Crisis averted!