Exemple #1
0
        public static void UpdateStatus()
        {
            if (!PhotonNetwork.inRoom)
            {
                if (PhotonNetwork.insideLobby)
                {
                    presence.details   = "Lobby";
                    presence.state     = PhotonNetwork.GetLobbyName();
                    presence.partySize = 0;
                    presence.partyMax  = 0;
                }
                else if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE)
                {
                    presence.details        = "Singleplayer";
                    presence.largeImageKey  = GetImage();
                    presence.largeImageText = $"{FengGameManagerMKII.level}/{IN_GAME_MAIN_CAMERA.GetDifficulty()}/{IN_GAME_MAIN_CAMERA.GetDayLight()}";
                    presence.state          = $"{FengGameManagerMKII.single_kills}/{FengGameManagerMKII.single_maxDamage}/{FengGameManagerMKII.single_totalDamage}";
                    presence.partySize      = 0;
                    presence.partyMax       = 0;
                }
                else
                {
                    presence.details        = "Main Menu";
                    presence.state          = $"Version {UIMainReferences.Version}";
                    presence.largeImageKey  = "logo_large";
                    presence.largeImageText = "Art by https://vk.com/bishoptyan";
                    presence.partySize      = 0;
                    presence.partyMax       = 0;
                }
            }
            else
            {
                presence.details        = "Multiplayer";
                presence.state          = PhotonNetwork.GetRoomName().Length > 14 ? PhotonNetwork.GetRoomName().Remove(12) + "..." : PhotonNetwork.GetRoomName();
                presence.largeImageKey  = GetImage();
                presence.largeImageText = $"{FengGameManagerMKII.level}/{IN_GAME_MAIN_CAMERA.GetDifficulty()}/{IN_GAME_MAIN_CAMERA.GetDayLight()}";
                presence.partySize      = PhotonNetwork.room.playerCount;
                presence.partyMax       = PhotonNetwork.room.maxPlayers;
            }

            DiscordAPI.UpdatePresence(presence);
        }
Exemple #2
0
 public static void Update()
 {
     DiscordAPI.RunCallbacks();
 }