Local Server Test Multiple Users

Hi,
So I have a local server with docker and I need to test that 2 users can correctly join an authoritative match.

The problem that I have is that in order to test, I play the game in Unity editor and also on a build.

But, because it’s from the same computer, I feel like nakama is treating the two as one and only client,

If I try to create a match from the build, it works and then if the editor tries to join that match I have the following error : WebSocketException : already join.

Also in the nakama console, when both “clients” are logged in, there is only 1 user appearing instead of two, leading me to think that nakama is indeed treating both as 1 client.

But how can I test a player vs player match otherwise ?

Here is how the client logs in :

    private string scheme = "http";
    private string host = "localhost";
    private int port = 7350;
    private string serverKey = "defaultkey";


 client = new Client(scheme, host, port, serverKey, UnityWebRequestAdapter.Instance);
        session = await client.AuthenticateDeviceAsync(SystemInfo.deviceUniqueIdentifier);
        socket = client.NewSocket(true);
        await socket.ConnectAsync(session, true);
        appManager.ShowOnlineMainMenu();
        clientConnecte = true;

Thanks.

Solved.
I created two temp login functions with a boolean, the second has a forced different custom client id following that function in the docs :

const string customId = "some-custom-id";
var session = await client.AuthenticateCustomAsync(customId);
Debug.LogFormat("New user: {0}, {1}", session.Created, session);

Now I correctly have two different clients and a working player vs player match.

1 Like