getting data from masterClient

Options
I want to retrieve the PlayerList created at master client as it has all of the information of other clients adding to this list, how do I do this? I try doing [RPC] but I cannot get it to return something. Is there is a way to make RPC calls to return something to non master clients?


// on joined room, master client created a player list to store player info
private void OnJoinedRoom()
	{
		Debug.Log("We have joined a room.");
		bool bouusPoints =false;
		if (PhotonNetwork.isMasterClient) {
			photonView.RPC("CreatePlayerList", PhotonTargets.MasterClient);
			
			photonView.RPC ("AddtoPlayerList", PhotonTargets.MasterClient, bonusPoints, PhotonNetwork.playerName);
			
		}

		if (!PhotonNetwork.isMasterClient) {
		//Add to master player info list
                photonView.RPC ("AddtoPlayerList", PhotonTargets.MasterClient, bonusPoints, PhotonNetwork.playerName);

			// I want to retrieve the PlayerList created at master client as it as all of the information of other clients adding to this list at this point, how do I do this?
		}
	}
	
// a list created
	[RPC]
	void CreatePlayerList()
	{
		playerIDsReadyStatus = new List<PlayerListInfo> ();
		
	}

// a list created
	[RPC]
	void CreatePlayerList()
	{
		playerIDsReadyStatus = new List<PlayerListInfo> ();
		
	}

Comments

  • Please post to the appropriate forum, Unity Network Plugin / PUN.
  • vadim
    Options
    Each client connected to the room has identical list of players: PhotonNetwork.playerList
    Nothing special in master client's list.
    If you are trying to build parallel list of players then probably you do not need this. Any additional info for players can be added via players custom properties. They are sync'ed automatically between clients.