heroiclabs / nakama-unity

Unity client for Nakama server.
https://heroiclabs.com/docs/unity-client-guide
Other
411 stars 75 forks source link

Socket Disconnetcts when trying to create party #119

Closed champilas closed 3 years ago

champilas commented 3 years ago

Hello Guys. As i always say, thank you for your excellent work with Nakama. Recently you solved a big problem with Unity WebGl and that helped me a lot. Now im facing another issue, when i try to create a party the socket disconnects automatically, i dont know why. This is my test code, is taken from original Nakama Example:

using System.Collections; using System.Collections.Generic; using UnityEngine; using Nakama; using System;

public class Test : MonoBehaviour { private const string SessionTokenKey = "nksession"; private const string UdidKey = "udid";

  private IClient _client;
  private ISocket _socket;
  private ISocket _socket2;

  public string serverText;
  public string serverPortText;

  public async void Awake()
  {
      try
      {
          const string scheme = "http";
          string host = serverText;
          int port = Int32.Parse(serverPortText);
          const string serverKey = "defaultkey";

          _client = new Client(scheme, host, port, serverKey, UnityWebRequestAdapter.Instance);
          _socket = _client.NewSocket();
          _socket.Closed += () => Debug.Log("Socket closed.");
          _socket.Connected += () => Debug.Log("Socket connected.");
          _socket.ReceivedError += e => Debug.Log("Socket error: " + e.Message);
          _socket.ReceivedParty += e => print(e.Leader);
          _socket.ReceivedPartyData += e => print(e.Data);
          _socket.ReceivedPartyClose += e => print(e.ToString());

          // Cant use SystemInfo.deviceUniqueIdentifier with WebGL builds.
          var udid = PlayerPrefs.GetString(UdidKey, Guid.NewGuid().ToString());
          Debug.Log("Unique Device ID: " + udid);

          ISession session;
          var sessionToken = PlayerPrefs.GetString(SessionTokenKey);
          if (string.IsNullOrEmpty(sessionToken) || (session = Session.Restore(sessionToken)).IsExpired)
          {
              session = await _client.AuthenticateDeviceAsync(udid);
              PlayerPrefs.SetString(UdidKey, udid);
              PlayerPrefs.SetString(SessionTokenKey, session.AuthToken);
          }

          Debug.Log("Session Token: " + session.AuthToken);
          await _socket.ConnectAsync(session, true);
          await _socket2.ConnectAsync(session, true);
          Debug.Log("Connected ");
          UnityMainThreadDispatcher.Instance().Enqueue(JoinParty());
          //var party = await _socket.CreatePartyAsync(open: true, maxSize: 10);
          //Debug.Log("New Party: " + party.ToString());
          var match = await _socket.CreateMatchAsync();
          Debug.Log("Created match: " + match.Id);

          //await _socket.CloseAsync();
      }
      catch (Exception e)
      {
          Debug.LogError(e.ToString());
      }
  }
  private void OnApplicationQuit()
  {
      _socket?.CloseAsync();
  }
  public IEnumerator JoinParty()
  {
      var party = _socket.CreatePartyAsync(true, maxSize: 10);
      Debug.Log(party.Id);;
      yield return null;
  }

}

I tried first using directly the await "var party = await _socket.CreatePartyAsync(open: true, maxSize: 10);" but unity was showing a main threading problem. I searched on forums and found that we can use this asset:

https://github.com/PimDeWitte/UnityMainThreadDispatcher

So i moved the command into a IEnumerator. And is dosconnecting too. This is a screenshot of de debug console:

image

At the end i will use it into a webgl project, but is not even running on Unity Editor. Please Help me!

Im using the new vwesion of Nakama V3.1.1, Unity 2020.2.2 (tried with 2021.1.15 with same result) and Using nakama with Digital Ocean.

lugehorsam commented 3 years ago

Hey @champilas. First off, there is no need to use UnityMainThreadDispatcher or IEnumerator. What you are reading on the forum is outdated information.

Second, why are you opening multiple sockets with the same session? Could you rewrite your example with only one socket and without the main thread dispatcher and IEnumerator?

champilas commented 3 years ago

Sure, doing it right now! Will post it soon.

lugehorsam commented 3 years ago

@champilas thanks. Another thing to check is the server logs which should indicate when the server is closing the socket connection.

champilas commented 3 years ago

Here is the new code:

using System.Collections; using System.Collections.Generic; using UnityEngine; using Nakama; using System;

public class Test : MonoBehaviour { private const string SessionTokenKey = "nksession"; private const string UdidKey = "udid";

private IClient _client;
private ISocket _socket;
private ISocket _socket2;

public string serverText;
public string serverPortText;

public async void Awake()
{
    try
    {
        const string scheme = "http";
        string host = serverText;
        int port = Int32.Parse(serverPortText);
        const string serverKey = "defaultkey";

        _client = new Client(scheme, host, port, serverKey, UnityWebRequestAdapter.Instance);
        _socket = _client.NewSocket();
        _socket.Closed += () => Debug.Log("Socket closed.");
        _socket.Connected += () => Debug.Log("Socket connected.");
        _socket.ReceivedError += e => Debug.Log("Socket error: " + e.Message);
        _socket.ReceivedParty += e => print(e.Leader);
        _socket.ReceivedPartyData += e => print(e.Data);
        _socket.ReceivedPartyClose += e => print(e.ToString());

        // Cant use SystemInfo.deviceUniqueIdentifier with WebGL builds.
        var udid = PlayerPrefs.GetString(UdidKey, Guid.NewGuid().ToString());
        Debug.Log("Unique Device ID: " + udid);

        ISession session;
        var sessionToken = PlayerPrefs.GetString(SessionTokenKey);
        if (string.IsNullOrEmpty(sessionToken) || (session = Session.Restore(sessionToken)).IsExpired)
        {
            session = await _client.AuthenticateDeviceAsync(udid);
            PlayerPrefs.SetString(UdidKey, udid);
            PlayerPrefs.SetString(SessionTokenKey, session.AuthToken);
        }

        Debug.Log("Session Token: " + session.AuthToken);
        await _socket.ConnectAsync(session, true);
        Debug.Log("Connected ");
        var match = await _socket.CreateMatchAsync();
        Debug.Log("Created match: " + match.Id);
        var party = await _socket.CreatePartyAsync(open: true, maxSize: 10);
        Debug.Log(party.Id);

        //await _socket.CloseAsync();
    }
    catch (Exception e)
    {
        Debug.LogError(e.ToString());
    }
}

private void OnApplicationQuit()
{
    _socket?.CloseAsync();
}

//public IEnumerator JoinParty()
//{
//    var party = _socket.CreatePartyAsync(true, maxSize: 10);
//    Debug.Log(party.Id);
//    yield return null;
//}

}

And here is the result:

image

This is the detalid info of the issue:

System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00026] in <9577ac7a62ef43179789031239ba8798>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <9577ac7a62ef43179789031239ba8798>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <9577ac7a62ef43179789031239ba8798>:0 at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 at Nakama.Socket+d81.MoveNext () [0x000b4] in <49b7371e48324024846f859565456a70>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9577ac7a62ef43179789031239ba8798>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0001a] in <9577ac7a62ef43179789031239ba8798>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <9577ac7a62ef43179789031239ba8798>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <9577ac7a62ef43179789031239ba8798>:0 at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 at Test+d7.MoveNext () [0x00378] in C:\Users\nverg\Documents\Repos\Smartli\Assets\Scripts\Test.cs:55 UnityEngine.Debug:LogError (object) Test/d7:MoveNext () (at Assets/Scripts/Test.cs:62) System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException (System.Exception) Nakama.Socket/d81:MoveNext () System.Threading.Tasks.TaskCompletionSource1<Nakama.WebSocketMessageEnvelope>:TrySetCanceled () Nakama.Socket:<.ctor>b__73_1 () Nakama.WebSocketAdapter/<Connect>d__31:MoveNext () UnityEngine.UnitySynchronizationContext:ExecuteTasks ()

Can you help me please with server log? how do i get that?

lugehorsam commented 3 years ago

@champilas I'm not sure how Digital Ocean exposes application logs to devs but they have some way.

Otherwise you could run the server locally to get logs from your terminal.

champilas commented 3 years ago

Ok, let me check what can i do. Between, did you see seomething on previous message?

lugehorsam commented 3 years ago

@champilas do you get the same error if you remove the CreateMatch call?

champilas commented 3 years ago

Hi i used the local server and this is the Debug when i clicked on play:

` nakama_1 | {"level":"info","ts":"2021-08-19T17:49:45.202Z","caller":"server/session_ws.go:82","msg":"New WebSocket session connected","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"d6d77651-0115-11ec-a8ef-7106fdcb5b46","format":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T17:49:45.202Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T17:49:45.280Z","caller":"server/pipeline.go:66","msg":"Received *rtapi.Envelope_MatchCreate message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"d6d77651-0115-11ec-a8ef-7106fdcb5b46","cid":"0","message":{"MatchCreate":{}}}

nakama_1 | {"level":"debug","ts":"2021-08-19T17:49:45.280Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T17:49:45.280Z","caller":"server/session_ws.go:393","msg":"Sending *rtapi.Envelope_Match message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"d6d77651-0115-11ec-a8ef-7106fdcb5b46","envelope":"cid:\"0\" match:{match_id:\"de612eb4-7f0b-4cd5-b3d8-1a7e40286c79.\" size:1 self:{user_id:\"608037d4-ff04-41ec-a982-10efe16aacaf\" session_id:\"d6d77651-0115-11ec-a8ef-7106fdcb5b46\" username:\"fqBVVINKAq\"}}"}

nakama_1 | {"level":"debug","ts":"2021-08-19T17:49:45.755Z","caller":"server/pipeline.go:66","msg":"Received *rtapi.Envelope_PartyCreate message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"d6d77651-0115-11ec-a8ef-7106fdcb5b46","cid":"1","message":{"PartyCreate":{"open":true,"max_size":10}}}

nakama_1 | {"level":"debug","ts":"2021-08-19T17:49:45.755Z","caller":"server/session_ws.go:393","msg":"Sending message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"d6d77651-0115-11ec-a8ef-7106fdcb5b46","envelope":"cid:\"1\""}

nakama_1 | {"level":"debug","ts":"2021-08-19T17:49:45.755Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

`

But Unity Console was different this time:

image

If i remove the CreateMatch i receive the same error.

lugehorsam commented 3 years ago

@champilas what line is causing the null ref?

champilas commented 3 years ago

This is the complete error:

System.NullReferenceException: Object reference not set to an instance of an object at Test+d7.MoveNext () [0x003c6] in C:\Users\nverg\Documents\Repos\Smartli\Assets\Scripts\Test.cs:56 UnityEngine.Debug:LogError (object) Test/d7:MoveNext () (at Assets/Scripts/Test.cs:62) System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult (Nakama.IParty) Nakama.Socket/d__81:MoveNext () UnityEngine.UnitySynchronizationContext:ExecuteTasks ()

lugehorsam commented 3 years ago

@champilas right but, what object is null? What are you doing on line 56?

champilas commented 3 years ago

Look, i cleaned the code, now we have this:

using System.Collections; using System.Collections.Generic; using UnityEngine; using Nakama; using System;

public class Test : MonoBehaviour { private const string SessionTokenKey = "nksession"; private const string UdidKey = "udid";

private IClient _client;
private ISocket _socket;
private ISocket _socket2;

public string serverText;
public string serverPortText;

public async void Awake()
{
    try
    {
        const string scheme = "http";
        string host = serverText;
        int port = Int32.Parse(serverPortText);
        const string serverKey = "defaultkey";

        _client = new Client(scheme, host, port, serverKey, UnityWebRequestAdapter.Instance);
        _socket = _client.NewSocket();
        _socket.Closed += () => Debug.Log("Socket closed.");
        _socket.Connected += () => Debug.Log("Socket connected.");
        _socket.ReceivedError += e => Debug.Log("Socket error: " + e.Message);
        _socket.ReceivedParty += e => print(e.Leader);
        _socket.ReceivedPartyData += e => print(e.Data);
        _socket.ReceivedPartyClose += e => print(e.ToString());

        // Cant use SystemInfo.deviceUniqueIdentifier with WebGL builds.
        var udid = PlayerPrefs.GetString(UdidKey, Guid.NewGuid().ToString());
        Debug.Log("Unique Device ID: " + udid);

        ISession session;
        var sessionToken = PlayerPrefs.GetString(SessionTokenKey);
        if (string.IsNullOrEmpty(sessionToken) || (session = Session.Restore(sessionToken)).IsExpired)
        {
            session = await _client.AuthenticateDeviceAsync(udid);
            PlayerPrefs.SetString(UdidKey, udid);
            PlayerPrefs.SetString(SessionTokenKey, session.AuthToken);
        }

        Debug.Log("Session Token: " + session.AuthToken);
        await _socket.ConnectAsync(session, true);
        Debug.Log("Connected ");
        var match = await _socket.CreateMatchAsync();
        Debug.Log("Created match: " + match.Id);
        var party = await _socket.CreatePartyAsync(open: true, maxSize: 10);
        Debug.Log(party);

        //await _socket.CloseAsync();
    }
    catch (Exception e)
    {
        Debug.LogError(e.ToString());
    }
}

private void OnApplicationQuit()
{
    _socket?.CloseAsync();
}

}

Now i have this in Unity Console:

image

Notice that when i try to print party, it prints "Null"

This is the Server Log:

nakama_1 | {"level":"info","ts":"2021-08-19T19:30:38.618Z","caller":"server/session_ws.go:82","msg":"New WebSocket session connected","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46","format":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:30:38.619Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:30:38.686Z","caller":"server/pipeline.go:66","msg":"Received *rtapi.Envelope_MatchCreate message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46","cid":"0","message":{"MatchCreate":{}}}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:30:38.686Z","caller":"server/session_ws.go:393","msg":"Sending *rtapi.Envelope_Match message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46","envelope":"cid:\"0\" match:{match_id:\"f3ef2031-f7cd-4856-a1a1-776474fc073e.\" size:1 self:{user_id:\"608037d4-ff04-41ec-a982-10efe16aacaf\" session_id:\"eef57412-0123-11ec-a8ef-7106fdcb5b46\" username:\"fqBVVINKAq\"}}"}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:30:38.686Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:30:39.192Z","caller":"server/pipeline.go:66","msg":"Received *rtapi.Envelope_PartyCreate message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46","cid":"1","message":{"PartyCreate":{"open":true,"max_size":10}}}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:30:39.192Z","caller":"server/session_ws.go:393","msg":"Sending message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46","envelope":"cid:\"1\""}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:30:39.192Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:30:56.239Z","caller":"server/session_ws.go:201","msg":"Error reading message from client","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46","error":"websocket: close 1006 (abnormal closure): unexpected EOF"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:30:56.239Z","caller":"server/session_ws.go:436","msg":"Cleaning up closed client connection","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:30:56.239Z","caller":"server/session_ws.go:444","msg":"Cleaned up closed connection matchmaker","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:30:56.239Z","caller":"server/session_ws.go:448","msg":"Cleaned up closed connection tracker","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:30:56.239Z","caller":"server/session_ws.go:452","msg":"Cleaned up closed connection status registry","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:30:56.239Z","caller":"server/session_ws.go:456","msg":"Cleaned up closed connection session registry","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:30:56.239Z","caller":"server/session_ws.go:473","msg":"Closed client connection","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"eef57412-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:30:56.239Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":0,"leaves":3}

nakama_1 | {"level":"info","ts":"2021-08-19T19:31:04.634Z","caller":"server/session_ws.go:82","msg":"New WebSocket session connected","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46","format":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:04.634Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:04.705Z","caller":"server/pipeline.go:66","msg":"Received *rtapi.Envelope_MatchCreate message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46","cid":"0","message":{"MatchCreate":{}}}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:04.706Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:04.706Z","caller":"server/session_ws.go:393","msg":"Sending *rtapi.Envelope_Match message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46","envelope":"cid:\"0\" match:{match_id:\"a085911d-fa92-4db4-a3f2-788a139cb1a5.\" size:1 self:{user_id:\"608037d4-ff04-41ec-a982-10efe16aacaf\" session_id:\"fe7722d6-0123-11ec-a8ef-7106fdcb5b46\" username:\"fqBVVINKAq\"}}"}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:05.129Z","caller":"server/pipeline.go:66","msg":"Received *rtapi.Envelope_PartyCreate message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46","cid":"1","message":{"PartyCreate":{"open":true,"max_size":10}}}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:05.129Z","caller":"server/session_ws.go:393","msg":"Sending message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46","envelope":"cid:\"1\""}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:05.130Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:20.253Z","caller":"server/session_ws.go:201","msg":"Error reading message from client","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46","error":"websocket: close 1006 (abnormal closure): unexpected EOF"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:31:20.253Z","caller":"server/session_ws.go:436","msg":"Cleaning up closed client connection","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:31:20.253Z","caller":"server/session_ws.go:444","msg":"Cleaned up closed connection matchmaker","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:31:20.253Z","caller":"server/session_ws.go:448","msg":"Cleaned up closed connection tracker","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:31:20.253Z","caller":"server/session_ws.go:452","msg":"Cleaned up closed connection status registry","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:31:20.253Z","caller":"server/session_ws.go:456","msg":"Cleaned up closed connection session registry","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"info","ts":"2021-08-19T19:31:20.253Z","caller":"server/session_ws.go:473","msg":"Closed client connection","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"fe7722d6-0123-11ec-a8ef-7106fdcb5b46"}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:20.253Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":0,"leaves":3}

nakama_1 | {"level":"info","ts":"2021-08-19T19:31:27.692Z","caller":"server/session_ws.go:82","msg":"New WebSocket session connected","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"0c3575d4-0124-11ec-a8ef-7106fdcb5b46","format":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:27.692Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:27.758Z","caller":"server/pipeline.go:66","msg":"Received *rtapi.Envelope_MatchCreate message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"0c3575d4-0124-11ec-a8ef-7106fdcb5b46","cid":"0","message":{"MatchCreate":{}}}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:27.759Z","caller":"server/session_ws.go:393","msg":"Sending *rtapi.Envelope_Match message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"0c3575d4-0124-11ec-a8ef-7106fdcb5b46","envelope":"cid:\"0\" match:{match_id:\"3058ba5f-5d51-4e80-b31d-4d09e1be0981.\" size:1 self:{user_id:\"608037d4-ff04-41ec-a982-10efe16aacaf\" session_id:\"0c3575d4-0124-11ec-a8ef-7106fdcb5b46\" username:\"fqBVVINKAq\"}}"}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:27.759Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:28.181Z","caller":"server/pipeline.go:66","msg":"Received *rtapi.Envelope_PartyCreate message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"0c3575d4-0124-11ec-a8ef-7106fdcb5b46","cid":"1","message":{"PartyCreate":{"open":true,"max_size":10}}}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:28.181Z","caller":"server/tracker.go:835","msg":"Processing presence event","joins":1,"leaves":0}

nakama_1 | {"level":"debug","ts":"2021-08-19T19:31:28.181Z","caller":"server/session_ws.go:393","msg":"Sending message","uid":"608037d4-ff04-41ec-a982-10efe16aacaf","sid":"0c3575d4-0124-11ec-a8ef-7106fdcb5b46","envelope":"cid:\"1\""}

lugehorsam commented 3 years ago

@champilas please update to Nakama v3.5.0 and if you still have an issue let's move this thread to the Nakama forums: https://forum.heroiclabs.com/

champilas commented 3 years ago

How do i get that version?

champilas commented 3 years ago

Now i figured out that you are talking about Nakama Server Version, not talking about Nakama Unity version. I tried but i dont know how to upload it. Please Help!

lugehorsam commented 3 years ago

If you’re looking for the most seamless hosting experience we recommend you use Heroic Cloud: https://heroiclabs.com/heroic-cloud/ Additionally we have a Digital Ocean guide here: https://heroiclabs.com/docs/nakama/guides/digital-oc

champilas commented 3 years ago

Thanks for you help! i realized that the problem is the automatic Droplet for Nakama in Digital Ocean. They install the 2.7 version so thats why i was having that issue. At the end i created a new basic droplet and follow all the instructions here:

https://heroiclabs.com/docs/nakama/getting-started/docker-quickstart/

I installed version 3.5.0 and everithing is good now.

Thanks for your time.