06-05-2019 03:14 AM
tryI added Debug.Log in Callback.HandleMessage(Message msg) in Oculus sdk and found the request id in Message was mismatched with the request id which was used to register the callback method by always 1 less. For example, if the request id for registry was 38, then the id in message for callback was 37.
{
Core.Initialize();
Debug.Log($"Oculus initialised {Oculus.Platform.Core.IsInitialized()}");
Request request = Entitlements.IsUserEntitledToApplication();
Debug.Log($"request id {request.RequestID}");
request.OnComplete((Message msg) =>
{
Debug.Log("Entitlement check finished");
if (msg.IsError)
{
// User is NOT entitled.
Debug.Log(msg.GetError().Message);
onFailed();
}
else
{
}
}
);
OVRPlugin.occlusionMesh = true;
}
catch (Exception ex)
{
Debug.Log("failed to init oculus", ex);
}
internal static void OnComplete<T>(Request<T> request, Message<T>.Callback callback)
{
requestIDsToCallbacks[request.RequestID] = new RequestCallback<T>(callback);
}
if (requestIDsToCallbacks.TryGetValue(msg.RequestID, out callbackHolder))Any idea what's wrong?
{
....
}