コード例 #1
0
    void FetchUploadedData()
    {
        if (!RemoteConfig.IsInitialized())
        {
            RemoteConfig.Init();
        }

        if (CheckLogin() == false)
        {
            return;
        }

        ApiModel.ClearReponseCache();

        ApiWorld.FetchList(
            delegate(List <ApiWorld> obj)
        {
            SetupWorldData(obj);
        },
            delegate(string obj)
        {
            Debug.LogError("Error fetching your uploaded worlds:\n" + obj);
            SetupWorldData(new List <ApiWorld>());
        },
            ApiWorld.SortHeading.Updated,
            ApiWorld.SortOwnership.Mine,
            ApiWorld.SortOrder.Descending,
            0,
            100,
            "",
            null,
            null,
            "",
            ApiWorld.ReleaseStatus.All,
            false
            );

        ApiAvatar.FetchList(
            delegate(List <ApiAvatar> obj)
        {
            SetupAvatarData(obj);
        },
            delegate(string obj)
        {
            Debug.LogError("Error fetching your uploaded avatars:\n" + obj);
            SetupAvatarData(new List <ApiAvatar>());
        },
            ApiAvatar.Owner.Mine,
            null,
            100,
            0,
            ApiAvatar.SortHeading.None,
            ApiAvatar.SortOrder.Descending,
            false
            );
    }
コード例 #2
0
    IEnumerator FetchUploadedData()
    {
        if (!RemoteConfig.IsInitialized())
        {
            RemoteConfig.Init();
        }

        if (!APIUser.IsLoggedInWithCredentials)
        {
            yield break;
        }

        ApiModel.ClearReponseCache();
        VRCCachedWWW.ClearOld();

        if (fetchingAvatars == null)
        {
            fetchingAvatars = EditorCoroutine.Start(() => FetchAvatars());
        }
        if (fetchingWorlds == null)
        {
            fetchingWorlds = EditorCoroutine.Start(() => FetchWorlds());
        }
    }
コード例 #3
0
    IEnumerator FetchUploadedData()
    {
        if (!RemoteConfig.IsInitialized())
        {
            RemoteConfig.Init();
        }

        if (CheckLogin() == false)
        {
            yield break;
        }

        ApiModel.ClearReponseCache();

        int  indexPosition     = 0;
        int  lastResponseCount = 0;
        bool requestActive     = false;

        do
        {
            requestActive = true;
            ApiWorld.FetchList(
                delegate(List <ApiWorld> obj)
            {
                lastResponseCount = obj.Count;
                indexPosition    += obj.Count;
                requestActive     = false;
                SetupWorldData(obj);
            },
                delegate(string obj)
            {
                lastResponseCount = 0;
                requestActive     = false;
                Debug.LogError("Error fetching your uploaded worlds:\n" + obj);
                SetupWorldData(new List <ApiWorld>());
            },
                ApiWorld.SortHeading.Updated,
                ApiWorld.SortOwnership.Mine,
                ApiWorld.SortOrder.Descending,
                indexPosition,
                PageLimit,
                "",
                null,
                null,
                "",
                ApiWorld.ReleaseStatus.All,
                false,
                true
                );
            yield return(new WaitUntil(() => !requestActive));
        } while (lastResponseCount > 0);

        indexPosition = 0;

        do
        {
            requestActive = true;
            ApiAvatar.FetchList(
                delegate(List <ApiAvatar> obj)
            {
                lastResponseCount = obj.Count;
                indexPosition    += obj.Count;
                requestActive     = false;
                SetupAvatarData(obj);
            },
                delegate(string obj)
            {
                lastResponseCount = 0;
                requestActive     = false;
                Debug.LogError("Error fetching your uploaded avatars:\n" + obj);
                SetupAvatarData(new List <ApiAvatar>());
            },
                ApiAvatar.Owner.Mine,
                ApiAvatar.ReleaseStatus.All,
                null,
                PageLimit,
                indexPosition,
                ApiAvatar.SortHeading.None,
                ApiAvatar.SortOrder.Descending,
                false,
                true
                );
            yield return(new WaitUntil(() => !requestActive));
        } while (lastResponseCount > 0);
    }