RPC Status

marfmarf
Hi! I've a little question for you. I'm using an RPC AllBuffered to get all players in room (when someone enters in it), after this i need to get the players and taking in which team they are in, to assign the team for the new player just joined. My problem is the first RPC, because the second RPC starts with the first, and it returns 0 players, instead the real number got by waiting the first RPC until it has done its work.

So I need a method to wait the first RPC, or maybe make a callback. Is it possible? Otherwise how can i do?

Sorry for my bad english, but I'm just an young italian :)
I hope you can help me.

Comments

  • My problem is the first RPC, because the second RPC starts with the first, and it returns 0 players, instead the real number got by waiting the first RPC until it has done its work.
    You can't really change the order of RPCs once they are buffered. We made the buffer to repeat anything buffered in the sequence in which you added each for exactly the case when RPC #2 depends on RPC #1 being called first.

    a) The number of players is available as PhotonNetworking.playerList.count.
    b) Each player also can have custom properties which are synced while in a room. They can be set even before someone joins a room. Maybe this helps you avoid the RPC completely.

    I can't help with code or such. In general, RPCs will arrive in order but just be executed when it's their turn - no way to re-order them.
    Your RPC method however could buffer the data, if something else did not yet happen.

    I can't help here with code, sorry, but that's the general idea.
    Sorry for my bad english, but I'm just an young italian :)

    8-)
Sign In or Register to comment.