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
            );
    }
 // Token: 0x06006304 RID: 25348 RVA: 0x00233910 File Offset: 0x00231D10
 public override void OnEnable()
 {
     this.defaultRect = this.panel.transform.parent.GetComponent <RectTransform>().rect;
     this.pickers.Clear();
     ApiAvatar.FetchList(new Action <List <ApiAvatar> >(this.AvatarsAvailable), delegate(string s)
     {
     }, ApiAvatar.Owner.Public, null, 10, 0, ApiAvatar.SortHeading.None, ApiAvatar.SortOrder.Descending, true);
     ApiAvatar.FetchList(new Action <List <ApiAvatar> >(this.AvatarsAvailable), delegate(string s)
     {
     }, ApiAvatar.Owner.Mine, null, 10, 0, ApiAvatar.SortHeading.None, ApiAvatar.SortOrder.Descending, true);
 }
Example #3
0
 // Token: 0x06006159 RID: 24921 RVA: 0x00225D5C File Offset: 0x0022415C
 protected override void FetchAndRenderElements(int page)
 {
     this.timeUntilUpdate = 60f;
     if (this.category == UiAvatarList.Category.Public)
     {
         ApiAvatar.FetchList(new Action <List <ApiAvatar> >(this.AvatarsAvailable), new Action <string>(this.AvatarError), ApiAvatar.Owner.Public, null, this.numElementsPerPage, page * this.numElementsPerPage, this.heading, this.order, true);
     }
     else if (this.category == UiAvatarList.Category.Mine)
     {
         ApiAvatar.FetchList(new Action <List <ApiAvatar> >(this.AvatarsAvailable), new Action <string>(this.AvatarError), ApiAvatar.Owner.Mine, null, this.numElementsPerPage, page * this.numElementsPerPage, this.heading, this.order, true);
     }
     else if (this.category == UiAvatarList.Category.Internal && Player.Instance.isInternal)
     {
         ApiAvatar.FetchList(new Action <List <ApiAvatar> >(this.AvatarsAvailable), new Action <string>(this.AvatarError), ApiAvatar.Owner.Developer, null, this.numElementsPerPage, page * this.numElementsPerPage, this.heading, this.order, true);
     }
 }
 static void FetchAvatars(int offset = 0)
 {
     ApiAvatar.FetchList(
         delegate(IEnumerable <ApiAvatar> obj)
     {
         Debug.LogFormat("<color=yellow>Fetching Avatar Bucket {0}</color>", offset);
         if (obj.FirstOrDefault() != null)
         {
             fetchingAvatars = EditorCoroutine.Start(() =>
             {
                 var l     = obj.ToList();
                 int count = l.Count;
                 SetupAvatarData(l);
                 FetchAvatars(offset + count);
             });
         }
         else
         {
             fetchingAvatars = null;
             foreach (ApiAvatar a in uploadedAvatars)
             {
                 DownloadImage(a.id, a.thumbnailImageUrl);
             }
         }
     },
         delegate(string obj)
     {
         Debug.LogError("Error fetching your uploaded avatars:\n" + obj);
         fetchingAvatars = null;
     },
         ApiAvatar.Owner.Mine,
         ApiAvatar.ReleaseStatus.All,
         null,
         PageLimit,
         offset,
         ApiAvatar.SortHeading.None,
         ApiAvatar.SortOrder.Descending,
         null,
         null,
         true,
         false,
         null,
         false
         );
 }
    void FetchWorldData()
    {
        if (!RemoteConfig.IsInitialized())
        {
            RemoteConfig.Init();
        }

        if (!APIUser.IsLoggedInWithCredentials && APIUser.IsCached)
        {
            APIUser.CachedLogin(null, null, false);
        }

        if (RemoteConfig.IsInitialized() && APIUser.IsLoggedInWithCredentials)
        {
            ApiWorld.FetchList(
                delegate(List <ApiWorld> obj) {
                SetupWorldData(obj);
            },
                delegate(string obj) {
                Debug.LogError("Error fetching your uploaded worlds");
            },
                ApiWorld.SortHeading.Updated,
                ApiWorld.SortOwnership.Mine,
                ApiWorld.SortOrder.Descending,
                0,
                100,
                "",
                null,
                "",
                ApiWorld.ReleaseStatus.All
                );

            ApiAvatar.FetchList(
                delegate(List <ApiAvatar> obj) {
                SetupAvatarData(obj);
            },
                delegate(string obj) {
                Debug.LogError("Error fetching your uploaded avatars");
            },
                ApiAvatar.Owner.Mine,
                null,
                100
                );
        }
    }
Example #6
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);
    }