Ejemplo n.º 1
0
        public IEnumerator GetInstanceCreator(ApiWorldInstance instance)
        {
            string creator = instance.ownerId;

            if (creator != null)
            {
                if (creator == APIUser.CurrentUser? .id)
                {
                    if (LocalPlayerEntry.emmNameSpoofEnabled)
                    {
                        textComponent.text = OriginalText.Replace("{instancecreator}", LocalPlayerEntry.emmSpoofedName);
                    }
                    else
                    {
                        textComponent.text = OriginalText.Replace("{instancecreator}", APIUser.CurrentUser.displayName);
                    }
                    yield break;
                }

                textComponent.text = OriginalText.Replace("{instancecreator}", "Loading...");

                yield return(new WaitForSeconds(4));

                APIUser.FetchUser(creator, new Action <APIUser>(OnIdReceived), null);
                yield break;
            }
            else
            {
                textComponent.text = OriginalText.Replace("{instancecreator}", "No Instance Creator");
            }
        }
Ejemplo n.º 2
0
 public override void OnInstanceChange(ApiWorld world, ApiWorldInstance instance)
 {
     if (APIUser.CurrentUser != null && world.authorId == APIUser.CurrentUser.id && LocalPlayerEntry.emmNameSpoofEnabled)
     {
         textComponent.text = OriginalText.Replace("{worldauthor}", LocalPlayerEntry.emmSpoofedName);
     }
     else
     {
         textComponent.text = OriginalText.Replace("{worldauthor}", world.authorName);
     }
 }
Ejemplo n.º 3
0
        protected override void ProcessText(object[] parameters = null)
        {
            string timeString = DateTime.Now.ToString(@"HH\:mm\:ss");

            if (lastTime == timeString)
            {
                return;
            }

            lastTime           = timeString;
            textComponent.text = OriginalText.Replace("{systemtime24hr}", timeString);
        }
Ejemplo n.º 4
0
        protected override void ProcessText(object[] parameters = null)
        {
            TimeSpan time       = TimeSpan.FromSeconds(RoomManager.prop_Single_0);
            string   timeString = time.ToString(@"hh\:mm\:ss");

            if (lastTime == timeString)
            {
                return;
            }

            lastTime           = timeString;
            textComponent.text = OriginalText.Replace("{roomtime}", timeString);
        }
Ejemplo n.º 5
0
 public void OnPlayerJoined(VRC.Player player)
 {
     // This will handle getting the master on instance join
     if (player.prop_VRCPlayerApi_0 != null && player.prop_VRCPlayerApi_0.isMaster)
     {
         if (APIUser.CurrentUser != null && player.prop_APIUser_0.id == APIUser.CurrentUser.id && LocalPlayerEntry.emmNameSpoofEnabled)
         {
             textComponent.text = OriginalText.Replace("{instancemaster}", LocalPlayerEntry.emmSpoofedName);
         }
         else
         {
             textComponent.text = OriginalText.Replace("{instancemaster}", player.prop_APIUser_0.displayName);
         }
     }
 }
Ejemplo n.º 6
0
        private IEnumerator GetOnMasterChanged(Player player)
        {
            while (player.field_Public_Player_0 == null)
            {
                yield return(null);
            }

            if (APIUser.CurrentUser != null && player.field_Public_Player_0.prop_APIUser_0.id == APIUser.CurrentUser.id && LocalPlayerEntry.emmNameSpoofEnabled)
            {
                textComponent.text = OriginalText.Replace("{instancemaster}", LocalPlayerEntry.emmSpoofedName);
            }
            else
            {
                textComponent.text = OriginalText.Replace("{instancemaster}", player.field_Public_Player_0.prop_APIUser_0.displayName);
            }
            yield break;
        }
Ejemplo n.º 7
0
        public override void Init(object[] parameters = null)
        {
            Il2CppArrayBase <MonoBehaviour> components = GameObject.Find("_Application/ApplicationSetup").GetComponents <MonoBehaviour>();

            foreach (MonoBehaviour component in components)
            {
                if (component.TryCast <Transform>() != null || component.TryCast <ApiCache>() != null)
                {
                    continue;
                }

                foreach (FieldInfo field in component.GetIl2CppType().GetFields())
                {
                    if (field.FieldType == UnhollowerRuntimeLib.Il2CppType.Of <int>())
                    {
                        textComponent.text = OriginalText.Replace("{gameversion}", field.GetValue(component).Unbox <int>().ToString());
                        return;
                    }
                }
            }
        }
Ejemplo n.º 8
0
 public void OnIdReceived(APIUser user)
 {
     textComponent.text = OriginalText.Replace("{instancecreator}", user.displayName);
 }
Ejemplo n.º 9
0
 public void OnEmmWorldCheckCompleted(bool areRiskyFuncsAllowed)
 {
     textComponent.text = OriginalText.Replace("{riskyfuncallowed}", areRiskyFuncsAllowed.ToString());
 }
Ejemplo n.º 10
0
 private void OnPlayerCountChanged(Player player)
 {
     textComponent.text = OriginalText.Replace("{playercount}", PlayerManager.field_Private_Static_PlayerManager_0.field_Private_List_1_Player_0.Count.ToString());
 }
Ejemplo n.º 11
0
 public override void OnInstanceChange(ApiWorld world, ApiWorldInstance instance)
 {
     textComponent.text = OriginalText.Replace("{worldname}", world.name);
 }