Strange thing with RPC call

Options
hey !
I created a situation the list of users who join is kept by the master client.
When a player wants to see the list of players then send RPC to the master client and the master client sends all the players back to everyone. (I check who asked for the list using a simple Boolean variable)
For some reason with the master client it works perfectly and with the other players I'm getting a strange error (No matter who presses)

thats my code:

public class RPCcalls : MonoBehaviourPun
{
public PhotonView pv;
public int myTeam = 0;
public int newPlayerTeam;
public PlayerListManager list;
private bool imSendTheRequest = false;
private playerListButton listButton;


private void Start()
{
initPlayerListButton();
pv = GetComponent<PhotonView>();
listButton = FindObjectOfType<playerListButton>();
list = listButton.list;
if (pv.IsMine)
{
pv.RPC("RPC_PlayerJoined", RpcTarget.MasterClient, PhotonNetwork.LocalPlayer.UserId, pv.ViewID, PlayFabController.PFC.playerLevel);
}
}


[PunRPC]
void RPC_PlayerJoined(string playerName , int newPlayerTeam , int viewID , int level)
{
PhotonManager.pm.addPlayer(playerName, newPlayerTeam, viewID, level);
Debug.Log("the player - " + playerName + " joined !");
}

[PunRPC]
void getListPlayers()
{
List<PlayerByMe> l = PhotonManager.pm.getPlayersList();
pv.RPC("resetList", RpcTarget.All); // init the list
for (int i = 0; i < l.Count; i++)
{
//send the players
pv.RPC("returnThePlayers", RpcTarget.All, new object[] { l.getNickname(), l.getLevel(), l.getTeam(), l.getScore(), l.getKills(), l.getDies() });
}
}

[PunRPC]
void resetList()
{
if (imSendTheRequest == false)
return;
list.resetList();
}

[PunRPC]
void returnThePlayers(string nickname, int level, int team, int score, int kills, int dies)
{
if (imSendTheRequest == false)
return;
list.updateList(new PlayerByMe(nickname, level, team, score, kills, dies));


}


private void startList()
{
list.gameObject.SetActive(true);
imSendTheRequest = true;
pv.RPC("getListPlayers", RpcTarget.MasterClient);

}



private void stopList()
{
list.gameObject.SetActive(false);
imSendTheRequest = false;
}

private void initPlayerListButton()
{
EventTrigger trigger1 = listButton.gameObject.AddComponent<EventTrigger>();

EventTrigger.Entry entry1 = new EventTrigger.Entry();
entry1.eventID = EventTriggerType.PointerDown;
entry1.callback.AddListener((eventData) => { startList(); });

EventTrigger.Entry entry2 = new EventTrigger.Entry();
entry2.eventID = EventTriggerType.PointerUp;
entry2.callback.AddListener((eventData) => { stopList(); });

trigger1.triggers.Add(entry1);
trigger1.triggers.Add(entry2);
}
}

thats the error for those who are not master client:

https://ibb.co/GtyCXzb

It sends to one function the parameters of the other.

Anyone have an idea I 3 days on it without success please
thank you











Comments