Change other player custom properties with c++

How do I get a MutablePlayer from the Room ,from another player that is not the local player ?


  • Hi @juaxix.

    Unfortunately this is not supported.

    What is the intended usage for this? Normally a player only really ever needs to modify its own properties. For properties which are modified by multiple players, room properties usually are a better match anyway, even if one could modify other players properties.

    That said, whats preventing the client from modifying other players properties is really just that the client side code does not support it. The server side code allows for it.

    Hence it would theoretically be possible to achieve this by modifying the LoadBalancing-cpp source to add this functionality yourself. However this would be a major custom modification and updating to newer versions would likely become a real merging PITA.
  • The intention is make the master the only one who can change scores for example. Like you can do in Photon PUN...but I see your point and I can understand it.
  • Hi @juaxix.

    For that usage scenario I would suggest that you simply make the player scores properties of the room and let the master client modify those room properties. The player to which a score belongs could be the key of the property.

    You could also make the scores of the other players properties of the master client, but in that case you would need to transfer them to the new master client if the old master client should leave the room or disconnect, so making them room properties is probably a simpler approach.
  • What would be the best way to store values only the master uses but when this master-client gets disconnected by error all those properties would move to the new master? , i don't want to send so many room properties messages as per each change or frame so,maybe store them like each 10seconds in the room?
  • Hi @juaxix.

    It doesn't really make a difference in terms of synchronization frequency, if you store the values as player properties or as room properties. Both will get synchronized every time you change them. If that happens too often, then maybe it would be acceptable to only update the score properties once or twice a second?
Sign In or Register to comment.