Summarizes a "player" within a room, identified (in that room) by actorID.
Each player has a actorID, valid for that room. It's -1 until it's assigned by server.
Ejemplo n.º 1
0
    //
    // Add a weapon of type weaponName to the player
    // - if the player already has the weapon then just add ammo
    // - confirm it works correctly
    public void AddPickedUpWeapon(string weaponName, PhotonPlayer player)
    {
        if (weapons[weaponName]) {
          weapons[weaponName].AddAmmo(weapons[weaponName].DefaultAmmoAmount());
        } else {

          // spawn weapon for the player
          if (PhotonNetwork.player == player) {

        GameObject weaponObject = PhotonNetwork.Instantiate(weaponName, weaponPosition.transform.position, camera.transform.rotation, 0);
        Weapon weapon = weaponObject.GetComponent<Weapon>();

        // need all copies to be not pick upable
        weapon.GetComponent<PhotonView>().RPC("PickUp", PhotonTargets.All, null);

        // syncs weapon name to weapon so all players have a reference to each players weapons
        weapons[weaponName] = weapon;

        // this needs to be an rpc
        weapon.GetComponent<PhotonView>().RPC("SetParent", PhotonTargets.All, playerController.GetComponent<PhotonView>().viewID, true);

        playerController.GetComponent<PhotonView>().RPC("ChangeWeapon", PhotonTargets.All, weaponName, weapon.GetComponent<PhotonView>().viewID);
          }
        }
    }
Ejemplo n.º 2
0
 void recieveCurrentParty(PhotonPlayer[] _players, bool _open)
 {
     List<PhotonPlayer> _players2 = new List<PhotonPlayer>();
     foreach (PhotonPlayer _p in _players) { _players2.Add(_p); }
     Party _party = new Party(_players2, _open);
     GameObject.FindGameObjectWithTag("MenuController").GetComponentInChildren<SocialScreen>().recieveCurrentParty(_party);
 }
Ejemplo n.º 3
0
 public void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
 {
     if (PhotonNetwork.isMasterClient)
     {
         this.SendPickedUpItems(newPlayer);
     }
 }
    public override void OnPhotonPlayerDisconnected(PhotonPlayer otherPlayer)
    {
        base.OnPhotonPlayerDisconnected(otherPlayer);

        if (PhotonNetwork.isMasterClient)
            MatchMakerSendPlayerToClassSelect();
    }
Ejemplo n.º 5
0
    public void RPCBoss3TakeDamage(float damage, PhotonPlayer owningPlayer)
    {
        // Flash the thug white
        characterTextureFlasher.Flash(0.04f);

        // Deduct the hitpoint count
        hitPoints -= damage;

        // Handling for the owner (the master client)
        if (PhotonNetwork.isMasterClient)
        {
            // If the character is doomed, then begin its VISUAL death sequence. Other players
            // will discover this with the next serialization; and you, as the master client,
            // will eventually destroy the character entirely.
            if (hitPoints - damage < MinHitpointsBeforeFrag)
            {
                GameDirector gameDirector = (GameDirector)Object.FindObjectOfType(typeof(GameDirector));
                // Do stuff for the owning player
                if (null != owningPlayer)
                {
                    // Increase their score
                    int currentScore = (int)owningPlayer.customProperties["Player.ActiveSession.Score"];
                    gameDirector.photonView.RPC("RPCSetScore", owningPlayer, currentScore + pointValue);
                }

                // Tell everybody that this character is dying
                photonView.RPC("RPCBoss3BeginDying", PhotonTargets.All);

                // Tell everybody that the boss has been defeated. Do it buffered in case someone
                // jumps in during the victory sequence.
                gameDirector.photonView.RPC("RPCBossDefeated", PhotonTargets.AllBuffered);
            }
        }
    }
 /// <remarks>
 /// In theory, the client which created the room might crash/close before it sets the start time.
 /// Just to make extremely sure this never happens, a new masterClient will check if it has to
 /// start a new round.
 /// </remarks>
 public void OnMasterClientSwitched(PhotonPlayer newMasterClient)
 {
     if (!PhotonNetwork.room.customProperties.ContainsKey (StartTimeKey)) {
         Debug.Log ("The new master starts a new round, cause we didn't start yet.");
         this.StartRoundNow ();
     }
 }
Ejemplo n.º 7
0
    public void SpawnSpectre( Vector2 spawnCoordinates, Quaternion spawnRotation, PhotonPlayer owner )
    {
        if ( PhotonNetwork.isMasterClient )
        {
            //Check if coordinate is vacant
            GridSpace space = GridSystem.GetSpaceByCoordinate( spawnCoordinates );
            if ( space.GridTile != null && !space.GridTile.IsOccupied )
            {
                //Spawn new unit on the network
                GameObject newSpectre = PhotonNetwork.Instantiate( "Units/PlayerSpectre", new Vector3( spawnCoordinates.x, 0, spawnCoordinates.y ), spawnRotation, 0 );
                PlayerSpectre spectre = newSpectre.GetComponent<PlayerSpectre>( );

                spectre.SetOwner( owner );
                spectre.CurrentTile = space.GridTile;

                //Notify tile of this objects arrival
                space.GridTile.RegisterUnit( spectre );

                //Add this spectre to list
                if ( Spectres == null )
                    Spectres = new List<PlayerSpectre>( );

                Spectres.Add( newSpectre.GetComponent<PlayerSpectre>( ) );
            }
        }
        else
        {
            photonView.RPC( "SpawnSpectre", PhotonTargets.MasterClient, spawnCoordinates, spawnRotation, owner );
        }
    }
Ejemplo n.º 8
0
    // Use this for initialization
    void Awake()
    {
        if (ServerScript.player != null)
        {
            if (this == ServerScript.player.transform.FindChild("Main Camera").GetComponent<CameraScript>())
                photonPlayer = PhotonNetwork.player;
            else
                gameObject.SetActive(false);
        }
        else if (!PhotonNetwork.offlineMode && transform.parent.gameObject == ServerScript.player)
            gameObject.SetActive(false);

        //GameObject[] cameraArray = GameObject.FindGameObjectsWithTag("MainCamera");
        /*if (cameraArray.Length > 1) //does not work (second player camera gets disabled)
        {
            gameObject.SetActive(false);
        }*/
        /*if (playerMovement.player != null) //no idea why it doesn't work
        {
            if (disableOtherCameras && gameObject == playerMovement.player.transform.FindChild("Main Camera"))
            {
                GameObject[] cameraArray = GameObject.FindGameObjectsWithTag("MainCamera");
                foreach (GameObject c in cameraArray)
                {
                    if (c != gameObject)
                        c.SetActive(false);
                }
            }
        }*/
    }
Ejemplo n.º 9
0
 private void Die(PhotonPlayer killer)
 {
     if (playerController.transform.GetComponent<PhotonView>().isMine) {
       GameController.instance.PlayerDied(killer);
       PhotonNetwork.Destroy(playerController.gameObject);
     }
 }
Ejemplo n.º 10
0
 //public void OnPawnTakesDamage(CombatEventListener.PawnTakesDamageCallback callback, PhotonPlayer thePlayer, int damageTaken)
 public void OnPawnTakesDamage(PhotonPlayer thePlayer, int currentHealth, int maxHealth)
 {
     foreach (ICombatEventListener listener in IterateListeners<ICombatEventListener>())
     {
         listener.OnPawnTakesDamage(thePlayer, currentHealth, maxHealth);
     }
 }
Ejemplo n.º 11
0
	public void GetShot(float damage, PhotonPlayer enemyPlayer)
	{
			health -= damage;

			if (photonView.isMine) {
			
			particle = GameObject.Find("spPoint");
			AudioSource.PlayClipAtPoint(damagesound, particle.transform.position);
			mainscreen.health = health;
			}

			if (health <= 0 && photonView.isMine) {

				//if(SendNetworkMessage != null)
				//	SendNetworkMessage(PhotonNetwork.player.name + " was killed by " + enemyName);

				enemyPlayer.AddKill(1);
				PhotonNetwork.player.AddDeath(1);
				
				if(RespawnMe != null)
					RespawnMe(3f);
				
				GameObject.Find("screenset").SetActive(false);
				PhotonNetwork.Destroy (gameObject);
				
			}
	}
Ejemplo n.º 12
0
	    // Use this for initialization
	    void Start()
	    {
			this.chatView.SetActive (true);
	        Application.runInBackground = true;
	        scroll_view_heigth = ((RectTransform)this.scroll_view.transform).sizeDelta.y;

	        photon_enemy = PhotonNetwork.otherPlayers[0];
	        user_enemy = (User)photon_enemy.allProperties["User"];
	        string txt_chat = "Vous jouez contre : " + user_enemy.username;
	        InstanciateMessage(txt_chat, Chat.EVENT);

	        channel_name = PhotonNetwork.room.name;
	        int alea = rand.Next(1000);
	        UserName = User.Instance.username + alea.ToString();

	        chatClient = new ChatClient(this);
	        chatClient.Connect(APP_ID, APP_VERSION, new AuthValues(UserName));

	        inputField.onEndEdit.AddListener(val =>
	            {
	                if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
	                {
	                    SendMessageToOtherClient(inputField.text);
	                    inputField.text = "";
	                }
	            });
	    }
Ejemplo n.º 13
0
 protected void OnPickup(PhotonPlayer m_actor,int m_view)
 {
     PhotonView view = PhotonView.Find(m_view);
     if (view != null)
     {
         bl_CTFPlayerLogic logic = view.GetComponent<bl_CTFPlayerLogic>();
         if (CanBePickedUpBy(logic) == true)
         {
             OnPickup(logic);
             if (PhotonNetwork.player == m_actor)
             {
                 bool t_send = false;//Prevent call two or more events
                 if (!t_send)
                 {
                     t_send = true;
                     Team oponentTeam;
                     if ((string)PhotonNetwork.player.customProperties[PropiertiesKeys.TeamKey] == Team.Delta.ToString())
                         oponentTeam = Team.Recon;
                     else
                         oponentTeam = Team.Delta;
                     bl_EventHandler.KillEvent(PhotonNetwork.player.name, "", "Obtained at the " + oponentTeam.ToString() + " flag", (string)PhotonNetwork.player.customProperties[PropiertiesKeys.TeamKey], 777, 15);
                 }
             }
         }
     }
 }
Ejemplo n.º 14
0
    // Calculates damage taken based on distance between player and explosion
    private int CalculatePlayerDamage(PhotonPlayer p)
    {
        if ((string)p.customProperties[PropiertiesKeys.TeamKey] == myTeam)
            return 0;

        float distance = Vector3.Distance(base.transform.position, FindPhotonPlayer(p).transform.position);
        return Mathf.Clamp((int) (this.explosionDamage * ((this.explosionRadius - distance) / this.explosionRadius)), 0, (int) this.explosionDamage);
    }
Ejemplo n.º 15
0
 public override void OnMasterClientSwitched(PhotonPlayer newMasterClient)
 {
     base.OnMasterClientSwitched(newMasterClient);
     if (newMasterClient == PhotonNetwork.player)
     {
         view.RequestOwnership();
     }
 }
Ejemplo n.º 16
0
 void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
 {
     if (PhotonNetwork.isMasterClient)
     {
         //A player connected to me(the MasterClient), spawn a player for it:
         Spawnplayer(newPlayer);
     }
 }
Ejemplo n.º 17
0
    void OnPhotonPlayerConnected(PhotonPlayer other)
    {
        if (PhotonNetwork.playerList.Length > 1)
        {
            FadingManager.Instance.Fade(scene);
        }

    }
Ejemplo n.º 18
0
 public BombInfo(Vector3 aStartPos, Vector3 aStartDir, PhotonPlayer aPlayer, Vector3 aSpeed, int aID = 0)
 {
     m_startPosition = aStartPos;
     m_startDirection = aStartDir;
     m_shooter = aPlayer;
     m_startVelocity = aSpeed;
     m_bombID = aID;
 }
 public void SetOccupied(PhotonPlayer player)
 {
     this.Player = player;
     this.Name.text = player.name;
     this.UnoccupiedView.SetActive(false);
     this.OccupiedView.SetActive(true);
     this.Occupied = true;
 }
 public void SetUnoccupied()
 {
     this.Player = null;
     this.Name.text = "Unoccupied";
     this.OccupiedView.SetActive(false);
     this.UnoccupiedView.SetActive(true);
     this.Occupied = false;
 }
Ejemplo n.º 21
0
 public void OnMasterClientSwitched(PhotonPlayer newMasterPlayer)
 {
     if (PhotonNetwork.isMasterClient)
     {
         //disable the ui buttons for the master
         FindObjectOfType<UIManager>().DisableClientButtons();//just a temp ugly call as it's a test project
     }
 }
Ejemplo n.º 22
0
 public override void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
 {
     base.OnPhotonPlayerConnected(newPlayer);
     InitPlayer();
     SpawnPlayerUnits();
     PhotonNetwork.room.open = false;
     PhotonNetwork.room.visible = false;
 }
Ejemplo n.º 23
0
    /**
       * How to handle player deaths, each subclass can set their own rules for
       * player deaths
       */
    public virtual void PlayerDied(PlayerManager playerManager, PhotonPlayer killer)
    {
        ScoreBoard.instance.GetComponent<PhotonView>().RPC("AddKillToScoreBoard", PhotonTargets.All, killer);

        MenuCamera.instance.gameObject.SetActive(true);

        playerManager.SetNextSpawnTime();
    }
Ejemplo n.º 24
0
    public void TakeDamage(int damage, PhotonPlayer killer)
    {
        health -= damage;

        if (health <= 0) {
          Die(killer);
        }
    }
 public void SetPlayer(int inLevel, string inName, int inPlayerID, PhotonPlayer inPhotonPlayer)
 {
     playerLevel = inLevel;
     playerID = inPlayerID;
     playerName = inName;
     nameLabel.text = playerName;
     netPlayer = inPhotonPlayer;
 }
Ejemplo n.º 26
0
 void SetPlayer(PhotonPlayer player)
 {
     owner = player;
     if (player == PhotonNetwork.player)
     {
         //Hey thats us! We can control this player: enable this script (this enables Update());
         enabled = true;
     }
 }
Ejemplo n.º 27
0
    /// <summary>
    /// Creates a player's centipede.
    /// </summary>
    /// <param name="Position"></param>
    /// <param name="Rotation"></param>
    /// <param name="Owner"></param>
    private void CreatePlayer(Vector3 Position, Quaternion Rotation, PhotonPlayer Owner)
    {
        if (PhotonNetwork.isMasterClient)
        {
            var Player = PhotonNetwork.InstantiateSceneObject(SpawnedGameObject.name, Position, Rotation, 0, null);

            Player.GetComponent<CentipedeNetworkObject>().Initialize(new CentipedeNetworkObjectData(null, Owner));
        }
    }
Ejemplo n.º 28
0
 void OnMasterClientSwitched(PhotonPlayer player)
 {
     Debug.LogWarning("OnMasterClientSwitched: " + player);
     if (PhotonNetwork.connected)
     {
         photonView.RPC("SendChatMessage", PhotonNetwork.masterClient, "Hi master! From:" + PhotonNetwork.player);
         photonView.RPC("SendChatMessage", PhotonTargets.All, "WE GOT A NEW MASTER: " + player + "==" + PhotonNetwork.masterClient + " From:" + PhotonNetwork.player);
     }
 }
Ejemplo n.º 29
0
		// Use this for initialization
		protected override void Start()
		{
			this.playerController = typeof(GameScene.Multi.PlayerController);
			this.ball_prefab = Resources.Load("Prefabs/Resources/Ball") as GameObject;
			this.other_player = PhotonNetwork.otherPlayers[0];
			Team ennemy_t = (Team)other_player.allProperties["Team"];
			Game.Instance = new Game(ennemy_t);
			base.Start ();
		}
Ejemplo n.º 30
0
 //Called by photon whenever master leave the room
 private void OnMasterClientSwitched(PhotonPlayer newMasterClient)
 {
     print("Master change");
     PhotonNetwork.LeaveRoom();
     MainCanvasManager.instane.CurrentRoomCanvas.transform.SetAsFirstSibling();
 }
Ejemplo n.º 31
0
 //Called by photon when a player join the room
 private void OnPhotonPlayerConnected(PhotonPlayer photonPlayer)
 {
     PlayerJoinedRoom(photonPlayer);
 }
Ejemplo n.º 32
0
 //Called by photon whenever you disconnect from the room
 private void OnPhotonPlayerDisconnected(PhotonPlayer photonPlayer)
 {
     PlayerLeftRoom(photonPlayer);
 }
Ejemplo n.º 33
0
 void SendChat(PhotonPlayer target)
 {
     chatInput = "[PM] " + chatInput;
     photonView.RPC("SendChatMessage", target, chatInput);
     chatInput = "";
 }
Ejemplo n.º 34
0
 public void OnPhotonPlayerDisconnected(PhotonPlayer player)
 {
     DebugManagerBehaviour.DebugUI.NetworkStatus("Connected. Players in room: " + PhotonNetwork.playerList.Length);
 }
Ejemplo n.º 35
0
 public string GetName(PhotonPlayer photonPlayer)
 {
     return(photonPlayer.NickName);
 }
Ejemplo n.º 36
0
 public void OnPhotonPlayerDisconnected(PhotonPlayer player)
 {
     Debug.Log("OnPlayerDisconneced: " + player);
 }
Ejemplo n.º 37
0
 void OnPhotonPlayerDisconnected(PhotonPlayer player)
 {
     Logger.Info($"[{player.Id}] ".WithColor("ffcc00") + GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Name]).Colored() + " disconnected.".WithColor("ff0000"));
 }
Ejemplo n.º 38
0
 public virtual void OnPhotonPlayerDisconnected(PhotonPlayer otherPlayer)
 {
 }
Ejemplo n.º 39
0
 public virtual void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
 {
 }
Ejemplo n.º 40
0
 void OnPhotonPlayerConnected(PhotonPlayer player)
 {
     if (PhotonNetwork.isMasterClient)
     {
     }
 }
Ejemplo n.º 41
0
        public void CheckAnarchyUser(ChatCommandContext ctx)
        {
            string chatMessage = "";

            if (ctx.Arguments.Length < 1)
            {
                chatMessage = Lang["errArg"];
                return;
            }

            int anarchyInt = 0;
            int abuseInt   = 0;

            if (ctx.Arguments[0] != "desc")
            {
                if (int.TryParse(ctx.Arguments[0], out int playerId) == false)
                {
                    chatMessage = Lang["errArg"];
                    return;
                }

                PhotonPlayer player = PhotonPlayer.Find(playerId);

                if (player.Properties.ContainsKey(PhotonPlayerProperty.anarchyFlags) == false && player.Properties.ContainsKey(PhotonPlayerProperty.anarchyAbuseFlags) == false)
                {
                    chatMessage = Lang["noAnarchyFeaturesFound"];
                    return;
                }
                anarchyInt = (int)player.Properties[PhotonPlayerProperty.anarchyFlags];
                abuseInt   = (int)player.Properties[PhotonPlayerProperty.anarchyAbuseFlags];

                if (anarchyInt == 0 && abuseInt == 0)
                {
                    chatMessage = Lang["noAnarchyFeaturesFound"];
                    return;
                }
            }
            else
            {
                if (ctx.Arguments[1] == "abuse")
                {
                    abuseInt = int.Parse(ctx.Arguments[2]);
                }
                else
                {
                    anarchyInt = int.Parse(ctx.Arguments[1]);
                }
            }

            if (anarchyInt > 0)
            {
                List <string> anarchyFeatures = new List <string>();
                if ((anarchyInt & (int)AnarchyFlags.DisableBodyLean) == (int)AnarchyFlags.DisableBodyLean)
                {
                    anarchyFeatures.Add(Lang["bodyLeanAbuse"]);
                }
                if ((anarchyInt & (int)AnarchyFlags.LegacyBurst) == (int)AnarchyFlags.LegacyBurst)
                {
                    anarchyFeatures.Add(Lang["legacyBurstAbuse"]);
                }
                if ((anarchyInt & (int)AnarchyFlags.NewTPSCamera) == (int)AnarchyFlags.NewTPSCamera)
                {
                    anarchyFeatures.Add(Lang["newTpsAbuse"]);
                }
                if ((anarchyInt & (int)AnarchyFlags.DisableBurstCooldown) == (int)AnarchyFlags.DisableBurstCooldown)
                {
                    anarchyFeatures.Add(Lang["disableBurstCD"]);
                }
                chatMessage += Lang.Format("anarchyFeatures") + " " + string.Join(", ", anarchyFeatures.ToArray());
            }

            if (abuseInt > 0)
            {
                List <string> anarchyAbusiveFeatures = new List <string>();
                if ((abuseInt & (int)AbuseFlags.InfiniteGasInPvp) == (int)AbuseFlags.InfiniteGasInPvp)
                {
                    anarchyAbusiveFeatures.Add(Lang["infGasInPvp"]);
                }
                if (chatMessage.Length > 0)
                {
                    chatMessage += "\n";
                }
                chatMessage += Lang.Format("anarchyAbusiveFeatures") + " " + string.Join(", ", anarchyAbusiveFeatures.ToArray());
            }
            ctx.SendLocalMessage(chatMessage);
            return;
        }
Ejemplo n.º 42
0
 public PhotonPlayer Get(int id)
 {
     return(PhotonPlayer.Find(id));
 }
Ejemplo n.º 43
0
    public void destroyMe()
    {
        bool flag = !this.disabled;

        if (flag)
        {
            this.disabled = true;
            GameObject gameObject = Pool.NetworkEnable("FX/boom4", base.transform.position, base.transform.rotation, 0);
            foreach (EnemyCheckCollider enemyCheckCollider in gameObject.GetComponentsInChildren <EnemyCheckCollider>())
            {
                enemyCheckCollider.dmg = 0;
            }
            bool flag2 = GameModes.CannonsKillHumans.Enabled;
            if (flag2)
            {
                foreach (HERO hero in FengGameManagerMKII.Heroes)
                {
                    bool flag3 = hero != null && Vector3.Distance(hero.transform.position, base.transform.position) <= 20f && !hero.BasePV.IsMine;
                    if (flag3)
                    {
                        GameObject   gameObject2 = hero.gameObject;
                        PhotonPlayer owner       = gameObject2.GetPhotonView().owner;

                        bool flag4 = GameModes.TeamMode.Enabled;
                        if (flag4)
                        {
                            int  num   = PhotonNetwork.player.RCteam;
                            int  num2  = owner.RCteam;;
                            bool flag5 = num == 0 || num != num2;
                            if (flag5)
                            {
                                gameObject2.GetComponent <HERO>().MarkDie();
                                gameObject2.GetComponent <HERO>().BasePV.RPC("netDie2", PhotonTargets.All, new object[]
                                {
                                    -1,
                                    PhotonNetwork.player.UIName + " "
                                });
                                FengGameManagerMKII.FGM.PlayerKillInfoUpdate(PhotonNetwork.player, 0);
                            }
                        }
                        else
                        {
                            gameObject2.GetComponent <HERO>().MarkDie();
                            gameObject2.GetComponent <HERO>().BasePV.RPC("netDie2", PhotonTargets.All, new object[]
                            {
                                -1,
                                PhotonNetwork.player.UIName + " "
                            });
                            FengGameManagerMKII.FGM.PlayerKillInfoUpdate(PhotonNetwork.player, 0);
                        }
                    }
                }
            }
            bool flag6 = this.myTitanTriggers != null;
            if (flag6)
            {
                for (int j = 0; j < this.myTitanTriggers.Count; j++)
                {
                    bool flag7 = this.myTitanTriggers[j] != null;
                    if (flag7)
                    {
                        this.myTitanTriggers[j].IsCollide = false;
                    }
                }
            }
            PhotonNetwork.Destroy(base.gameObject);
        }
    }
Ejemplo n.º 44
0
    /// <summary>
    /// Makes PhotonPlayer comparable
    /// </summary>
    public override bool Equals(object p)
    {
        PhotonPlayer pp = p as PhotonPlayer;

        return(pp != null && this.GetHashCode() == pp.GetHashCode());
    }
Ejemplo n.º 45
0
 //called by Photon whenever the master client is switched
 private void OnMasterClientSwitched(PhotonPlayer newMasterClient)
 {
     PhotonNetwork.LeaveRoom();
 }
Ejemplo n.º 46
-1
	void OnEnable () {
        if (CurrentParty == null)
        {
            CurrentParty = new Party(PhotonNetwork.player);
        }
        nonGmPlayers = new PhotonPlayer[9];
        GmPlayers = new PhotonPlayer[11];
        ConnectedPlayers = PhotonNetwork.playerList;
        int counter = 0;
        int gmcounter = 0;
        foreach (GameObject _object in PlayerButtons)
        {
            _object.SetActive(false);
        }
        foreach (GameObject _object in PartyButtons)
        {
            _object.SetActive(false);
        }
        foreach (PhotonPlayer _player in ConnectedPlayers)
        {
            if (_player.name != "" && _player.name != PhotonNetwork.player.name)
            {
                nonGmPlayers[counter] = _player;
                PlayerButtons[counter].SetActive(true);
                PlayerButtons[counter].GetComponentInChildren<Text>().text = _player.name;
                counter++;
            }
            else if (_player.name != PhotonNetwork.player.name && !_player.isMasterClient)
            {
                GmPlayers[gmcounter] = _player;
                gmcounter++;
            }
        }
        updateCurrentPartyUi();
	}