예제 #1
0
        public static void Update(object sender, ElapsedEventArgs args)
        {
            if (Configuration.GetConfig().UseRichPresence)
            {
                if (APIUser.CurrentUser == null)
                {
                    eventHandlers           = default(EventHandlers);
                    presence.details        = "A very cool public free cheat";
                    presence.state          = "Starting Game...";
                    presence.largeImageKey  = "MClient_logo";
                    presence.smallImageKey  = "small_MClient";
                    presence.partySize      = 0;
                    presence.partyMax       = 0;
                    presence.largeImageText = "MClient Client By Yaekith/404";
                    presence.smallImageText = GeneralUtils.Version;
                    UpdatePresence(ref presence);
                    return;
                }
                var room = RoomManagerBase.field_Internal_Static_ApiWorld_0;
                if (room != null)
                {
                    presence.partySize = 1;
                    presence.partyMax  = GeneralWrappers.GetPlayerManager().GetAllPlayers().Length;
                    switch (room.currentInstanceAccess)
                    {
                    default:
                        presence.state         = $"Transitioning to another Instance";
                        presence.partySize     = 0;
                        presence.partyMax      = 0;
                        presence.largeImageKey = "big_pog";
                        presence.smallImageKey = "MClient_logo";
                        break;

                    case VRC.Core.ApiWorldInstance.AccessType.Counter:
                        presence.state         = $"In a Counter Instance";
                        presence.smallImageKey = "MClient_logo";
                        presence.largeImageKey = "small_MClient";
                        break;

                    case VRC.Core.ApiWorldInstance.AccessType.InviteOnly:
                        presence.state         = "In an Invite Only Instance";
                        presence.largeImageKey = "even_more_pog";
                        presence.smallImageKey = "small_MClient";
                        break;

                    case VRC.Core.ApiWorldInstance.AccessType.InvitePlus:
                        presence.state         = "In an Invite+ Instance";
                        presence.largeImageKey = "even_more_pog";
                        presence.smallImageKey = "small_MClient";
                        break;

                    case VRC.Core.ApiWorldInstance.AccessType.Public:
                        presence.state         = "In a Public Instance";
                        presence.largeImageKey = "MClient_logo";
                        presence.smallImageKey = "small_MClient";
                        break;

                    case VRC.Core.ApiWorldInstance.AccessType.FriendsOfGuests:
                        presence.state         = "In a Friends Of Guests Instance";
                        presence.largeImageKey = "MClient_logo";
                        presence.smallImageKey = "funeral_logo";
                        break;

                    case VRC.Core.ApiWorldInstance.AccessType.FriendsOnly:
                        presence.state         = "In a Friends Only Instance";
                        presence.largeImageKey = "MClient_logo";
                        presence.smallImageKey = "small_MClient";
                        break;
                    }
                }
                else
                {
                    presence.state         = $"Transitioning to another Instance";
                    presence.partySize     = 0;
                    presence.partyMax      = 0;
                    presence.largeImageKey = "MClient_logo";
                    presence.smallImageKey = "small_MClient";
                }
                presence.largeImageText = $"As {((APIUser.CurrentUser != null) ? APIUser.CurrentUser.displayName : "")} {(GeneralUtils.IsDevBranch ? "(Developer)" : "(User)")} [{(GeneralWrappers.IsInVr() ? "VR" : "Desktop")}]";
                presence.smallImageText = GeneralUtils.Version + " (By Yaekith/404)";
                presence.joinSecret     = "MTI4NzM0OjFpMmhuZToxMjMxMjM=";
                presence.spectateSecret = "MTIzNDV8MTIzNDV8MTMyNDU0";
                presence.partyId        = "ae488379-351d-4a4f-ad32-2b9b01c91657";
                presence.state         += $" ({RoomManager.field_Internal_Static_ApiWorld_0.name})";
                UpdatePresence(ref presence);
            }
        }