Closed xiaoleMu closed 2 years ago
Here is our code. You can create a scene in unity and place this code on the object of the scene, and reproduce this issue according to the above reproduction steps.
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net.Sockets; using Nakama; using UnityEngine; using UnityEngine.UI;
public class MainManager : MonoBehaviour { private Client m_Client; private ISession m_SessionInfo; [SerializeField] private Button m_Button;
void LogError(string info)
{
Debug.LogError($"[MainManager] {info}");
}
async void Start()
{
m_Button.onClick.AddListener(() =>
{
RequestInfo();
});
m_Button.gameObject.SetActive(false);
LogError("start Init");
m_Client = new Client ("http", "54.180.17.191", 7350, "defaultkey", HttpRequestAdapter.WithGzip(), false);
m_SessionInfo = await m_Client.AuthenticateDeviceAsync(SystemInfo.deviceUniqueIdentifier);
LogError("end Init");
m_Button.gameObject.SetActive(true);
}
async void RequestInfo()
{
try {
LogError("start request");
var objectList = await m_Client.ListUsersStorageObjectsAsync (m_SessionInfo, "fashioncontest_outfit_data", "9e00d560-5cdf-4fcf-9a9c-1a9866813d9a", 1, null);
LogError("end request");
LogError($"objectList length = {objectList.Objects.Count()}");
} catch (ApiResponseException e) {
LogError(e.Message);
} catch (SocketException e) {
LogError(e.Message);
} catch (Exception e) {
LogError(e.Message);
}
}
}
A new release of the Unity client is available: https://github.com/heroiclabs/nakama-unity/releases/v3.3.0 Please test it and reopen this issue if the problem persists.
We upgraded Nakama (the Game SDK) from "version": "2.9.3" to "version": "3.1.1". The initializing Nakama client interface is changed:
Cause a problem:
When the data is requested in the network disconnected state, the failure of the request will not be fed back immediately, the timeout does not take effect either, and there is no response call back after timeout.
In the previous version : "2.9.3". There is no such problem.
Steps to reproduce -
the first request, we can get an error after time out: A task was canceled. the second request, there will be no response fed back.
Can you please check,thanks.