SocketWeaver/lobby

Sometimes, Register fails with message Object reference not set to an instance of an object

yong2khoo88 opened this issue · 0 comments

image

As titled, sometimes the Register function just fails with the message, which, is outside the callback.
Here's my code

 public void RegisterPlayer()
    {
        Debug.Log("Registering...");
        NetworkClient.Lobby.Register(CurrentPlayerName, (successful, reply, error) => {
            if (successful)
            {
                Debug.Log($"Lobby registered roomId: {reply.roomId}, started: {reply.started}");
            }
            else
            {
                Debug.Log("Lobby failed to register " + reply);
            }
        });
    }

I expect it at least appears after "Lobby failed to register".. but it seems to totally throw the exception.