#Join code not found (Relay)

1 messages · Page 1 of 1 (latest)

ember ember
#

When trying to join a lobby, I get the "Relay Service Exception: Not Found: join code not found" error, but I'm not sure what the cause of this is.

Joining and loading into a gameplay session works on initial launch of Play Mode for both editors. Only when the host stops play mode and the second editor tries to host a lobby after being taken back to the main menu, do I get the error. My code fails within InitializeRelayClient method called from the OpenLobby method. I will add my code below.

Edit:
These are my Unity/Package versions
Unity 2022.3.47f1
Authentication v3.3.1
Lobby v1.2.2
Matchmaker v1.1.5
Multiplayer Tools v1.1.1
NGO v1.11.0
Relay 1.2.0
Remote Config v4.1.1
Unity Transport v1.5.0

limpid tulip
#

!code

glacial birchBOT
limpid tulip
ember ember
#

@limpid tulip I'm not using Sessions currently

#

I use NetworkManager.Singleton.SceneManager.LoadScene() to load all players into a gameplay scene

limpid tulip
#

Check for hidden spaces if you are entering the code manually

ember ember
#

Hey, I seem to have found the solution but its rather interesting

#

It seems that if I don't attempt to use the lobby code for a period of 10s, I can't join the lobby. However, if I start the lobby and quickly join (within around those 10s), I join the lobby fine!

#

There must be an expiry for lobby codes that I have missed

limpid tulip
ember ember
limpid tulip
ember ember
#

Indeed. According to that page "If you’re using Relay with NGO, the network manager (NetworkManager) keeps the connection alive automatically. However, it will only do so after you’ve successfully called StartClient or StartHost." which my code does. It's more bizarre I get the error only after I'm done with the first lobby.

limpid tulip
ember ember
#

It's already enabled

limpid tulip
#

Not sure what else would cause that unless the network is shutdown in code somewhere else

ember ember
#

I shutdown the network when a player is not longer in a lobby or gameplay session (disconnect/quit etc) but I always use StartClient or StartHost when joining/creating lobby's, which seems to be the correct way to go about it, right?

limpid tulip
#

Yea, that is fine. Are you using multiplayer play mode or making a build?

ember ember
#

Multiplayer play mode

#

I wonder if its something to do with NetworkManager being destroyed with the Shutdown method

limpid tulip
ember ember
#

Resolved it! Rookie error: I had Network Manager as part of my initial scene, which is re-loaded when returning from the gameplay scene. Ended up with an additional Network Manager for each scene load, which was the cause. Surprised this isn't noted as an error or warning anywhere from the engine itself however.

limpid tulip
#

Yea, It's not an error because technically multiple network managers are allow for things like unit tests. But I agree that it should probably give a warning at least