Example #1
0
 protected override void startGame()
 {
     addEventListeners();
     localPlayer = getPartyGamePlayerById(Service.Get <CPDataEntityCollection>().LocalPlayerSessionId);
     PartyGameUtils.AddParticipationFilter(localPlayerParticipationController);
     PartyGameUtils.AddActionConfirmationFilter(partyGameDefinition, "DanceBattleExitPrompt");
     Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.DisableUIElement("ChatButtons", hideElement: true));
     PartyGameUtils.DisableCellPhoneButton(hide: true);
     changeControlState(ControlsState.Disabled);
 }
Example #2
0
        private PartyGamePlayer getPartyGamePlayerById(long playerSessionId)
        {
            PartyGamePlayer result = null;

            for (int i = 0; i < base.players.Count; i++)
            {
                if (base.players[i].UserSessionId == playerSessionId)
                {
                    result = base.players[i];
                    break;
                }
            }
            return(result);
        }
        private void onLobbyPlayersUpdated(PartyGamePlayerCollection players)
        {
            bool flag = false;

            redTeamLobbyCount  = 0;
            blueTeamLobbyCount = 0;
            for (int i = 0; i < players.Players.Count; i++)
            {
                PartyGamePlayer partyGamePlayer = players.Players[i];
                if (partyGamePlayer.UserSessionId == localPlayerSessionId)
                {
                    flag = true;
                    localPlayerTeamId = partyGamePlayer.TeamId;
                    if (!localPlayerIsInGame)
                    {
                        moveLocalPlayerToPosition(spawnedLobby.GetPlayerPosition(partyGamePlayer.TeamId, partyGamePlayer.RoleId));
                        CoroutineRunner.Start(createTopHud(), this, "createTopHud");
                        DanceBattleUtils.LogPlayerJoinDanceBI(players.Players.Count);
                    }
                }
                if (partyGamePlayer.TeamId == 1)
                {
                    redTeamLobbyCount++;
                }
                else
                {
                    blueTeamLobbyCount++;
                }
            }
            if (localPlayerIsInGame && !flag)
            {
                if (topHud != null)
                {
                    RemoveTopHud();
                }
                PartyGameUtils.EnableMainNavigation();
            }
            else if (!localPlayerIsInGame && flag)
            {
                PartyGameUtils.DisableMainNavigation();
            }
            numPlayersInLobby   = players.Players.Count;
            localPlayerIsInGame = flag;
            LobbyCamera.gameObject.SetActive(localPlayerIsInGame);
        }
Example #4
0
        private void onLobbyPlayersUpdated(PartyGamePlayerCollection players)
        {
            PartyGamePlayer partyGamePlayer = null;

            foreach (PartyGamePlayer player in players.Players)
            {
                if (player.UserSessionId == Service.Get <CPDataEntityCollection>().LocalPlayerSessionId)
                {
                    partyGamePlayer = player;
                    break;
                }
            }
            bool flag = partyGamePlayer != null;

            if (isLocalPlayerInLobby && !flag)
            {
                handleLocalPlayerLeftLobby();
            }
            if (!isLocalPlayerInLobby && flag)
            {
                handleLocalPlayerJoinedLobby();
            }
        }