Example #1
0
        public static IEnumerator VerifyEndpoint()
        {
            Debug.Log("Testing RemoteAssetBundleUtils.CheckEndpoint");
            Task <bool> task = RemoteAssetBundleUtils.CheckEndpoint(TestConstants.TEST_SERVER_ENDPOINT_CHECK);

            while (!task.IsCompleted)
            {
                yield return(null);
            }
            bool status = task.Result;

            Assert.IsTrue(status);

            // Now check JWT authentication
            Task <bool> t = RemoteAssetBundleUtils.CheckJWT(TestConstants.TEST_SERVER_ENDPOINT_CHECK, TestConstants.JWT_TOKEN_NAME);

            while (!t.IsCompleted)
            {
                yield return(null);
            }
            bool jwtStatus = t.Result;

            Assert.IsTrue(jwtStatus);
            Debug.Log("Passed");
        }
    public async void OnCheckJWT(string serverEndpoint, Object jwt)
    {
        bool status;

        if (!string.IsNullOrEmpty(serverEndpoint) && jwt)
        {
            status = await RemoteAssetBundleUtils.CheckJWT(serverEndpoint, jwt.name);
        }
        else
        {
            status = false;
        }
        if (status)
        {
            GUIConfigureTab.AddMessage(string.Format("Successfully Connected to Server with JWT {0}!", jwt.name), MessageStatus.Success);
        }
        else
        {
            GUIConfigureTab.AddMessage(string.Format("Unable to Connect to Server with JWT {0}!", jwt.name), MessageStatus.Error);
        }
    }