PhotonTargets.AllBuffered doesn't work properly for master client

Hello everyone,

I’m making team deathmatch game,when someone is died,died guy calls a rpc method which adds score to against team via PhotonTargets.AllBuffered at my game manager script.

I’m having this issue:

Normal clients killing each other and team scores is 2-2, but when master client kills someone it must be 3-2, it’s works only for who playing at that time.But if someone joins later the game,they still see the score is 2-2.

This is player health script

// This method calls when player takes damage
[PunRPC]
    public void TestDmg(int damage,string shootername)
    {
        health -= damage;

        if (health <= 0)
        {
            if (photonView.isMine)
            {                         
                if (GetComponent<TeamBase>().myTeam == TeamBase.Team.team1)
                {
                    gameManager.photonView.RPC("AddScoreToTeam2", PhotonTargets.AllBuffered,10);
                }
                else if (GetComponent<TeamBase>().myTeam == TeamBase.Team.team2)
                {
                    gameManager.photonView.RPC("AddScoreToTeam1", PhotonTargets.AllBuffered, 10);
                }

            }
               
            health = 100;
        }

    }

This is Game manager script

[PunRPC]
    public void AddScoreToTeam1(int score)
    {       
       team1Score += score;
    }

    [PunRPC]
    public void AddScoreToTeam2(int score)
    {   
        team2Score  += score;   
    }

Hey there,

i’d suggest to not use buffered rpcs as a scorecounter. This could result in some massive message spike which kill your photon.

Instead save those points to custom room properties. This way anyone can access them at will and you cannot miss any.

Example from my own game:

curPointCounter = (int)(PhotonNetwork.CurrentRoom.CustomProperties ["RedPoints"]);
PhotonNetwork.CurrentRoom.SetCustomProperties (new ExitGames.Client.Photon.Hashtable (){ { "RedPoints",curPointCounter + pointsToAdd } });

try putting the script into a public void (:

contact me

shaysapozhnikov@gmail.com