Exemplo n.º 1
0
    private bool onPartyGameStartedV2(PartyGameServiceEvents.PartyGameStartedV2 evt)
    {
        PartyGamePlayerCollection partyGamePlayerCollection = Service.Get <JsonService>().Deserialize <PartyGamePlayerCollection>(evt.PlayerData);

        startSession(evt.SessionId, evt.GameTemplateId, partyGamePlayerCollection.Players);
        return(false);
    }
        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);
        }
Exemplo n.º 3
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();
            }
        }
 protected override void onLobbyItemUpdated(PartygameLobbyMmoItem item, PartyGamePlayerCollection players)
 {
     mmoItem = item;
     LobbyPlayersUpdatedAction.InvokeSafe(players);
 }
Exemplo n.º 5
0
 protected abstract void onLobbyItemUpdated(PartygameLobbyMmoItem item, PartyGamePlayerCollection players);