Ejemplo n.º 1
0
 // Token: 0x06000009 RID: 9 RVA: 0x00002490 File Offset: 0x00000690
 public static void SetCurrentAvatar(ApiAvatar avatar)
 {
     AvatarUtils.setCurrentAvatarMethod.Invoke(PlayerUtils.GetCurrentUser(), new object[]
     {
         avatar
     });
 }
Ejemplo n.º 2
0
 // Token: 0x06000008 RID: 8 RVA: 0x00002465 File Offset: 0x00000665
 public static void LoadAvatars()
 {
     new Thread(delegate()
     {
         while (PlayerUtils.GetCurrentUser() == null)
         {
             Thread.Sleep(1000);
         }
         try
         {
             if (AvatarUtils.SavedAvatars.Count == 0 && File.Exists("VRChat_Data\\Managed\\VRLoader\\Modules\\Avatars.txt"))
             {
                 string[] array = File.ReadAllLines("VRChat_Data\\Managed\\VRLoader\\Modules\\Avatars.txt");
                 for (int i = 0; i < array.Length; i++)
                 {
                     string[] array2 = array[i].Split(new char[]
                     {
                         '|'
                     });
                     if (array2.Length >= 3)
                     {
                         ApiAvatar apiAvatar = new ApiAvatar();
                         apiAvatar.Init(array2[1], APIUser.CurrentUser, array2[0], "", array2[2], array2[0], "public", null, null);
                         AvatarUtils.SavedAvatars.Add(apiAvatar);
                     }
                 }
             }
             if (AvatarUtils.SavedAvatars.Count > 0)
             {
                 AvatarUtils.SavedAvatars = (from a in AvatarUtils.SavedAvatars
                                             group a by a.assetUrl into a
                                             select a.First <ApiAvatar>()).ToList <ApiAvatar>();
                 Console.WriteLine("Loaded {0} {1}!", AvatarUtils.SavedAvatars.Count, (AvatarUtils.SavedAvatars.Count > 1) ? "avatars" : "avatar");
             }
         }
         catch (Exception ex)
         {
             Console.WriteLine("Error loading avatars: {0}", ex.Message);
         }
     }).Start();
 }