how i can check that all client has received RPC successfully .

i made a ludo game and sometime it misbehave , and i think maybe some client didn't receive the RPC due to temporary slow net , so how i can check that all player has received the rpc successfully than only i want to continue the game.

Comments

  • That depends where you want to execute your code as soon as you know the player received the RPC call. For example if you want to execute the code for the object with the same photonview, you can send a RPC back as an acknowledgement. If you want to have a broader reach of the acknowledgement you can also raise an event if you want (this would be kind of weird to mix RPCs and events but if the situation is right then its not an issue). For whichever route you take you want to send a form of acknowledgement


  • public void OnMouseDown() //mouse down on dice
    {
    numberGot = get_numberGot();
    numberGotPower = get_numberGotPower();
    if(MainMenuManager.isOffline){
    RPC_RolingDice(numberGot, numberGotPower);
    } else {
    Debug.Log("RolingDice: rolingDice "+GameManager.gm.rolingDice);
    int room = RoomController.myNumberInRoom;
    //used so that only authorised person should click dice
    if(this.name == "RolingDiceBlue" && room == 1){
    PV.RPC("RPC_RolingDice", RpcTarget.AllBuffered, numberGot, numberGotPower);
    }
    else if(this.name == "RolingDiceRed" && room == 3){
    PV.RPC("RPC_RolingDice", RpcTarget.AllBuffered, numberGot, numberGotPower);
    }
    else if(this.name == "RolingDiceGreen" && room == 2){
    PV.RPC("RPC_RolingDice", RpcTarget.AllBuffered, numberGot, numberGotPower);
    }
    else if(this.name == "RolingDiceYellow" && room == 4){
    PV.RPC("RPC_RolingDice", RpcTarget.AllBuffered, numberGot, numberGotPower);
    }
    // PV.RPC("RPC_RolingDice", RpcTarget.AllBuffered, numberGot); //need to delete
    }
    }


    [PunRPC]
    public void RPC_RolingDice(int numberGot, int numberGotPower)
    {
    GameManager.gm.numberGotPower = numberGotPower;
    generateRandomNuonDice = StartCoroutine(RolingDice_Enum(numberGot));
    }



    In above code how to send RPC back as an acknowledgement. from other 3 players