Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

Safe and fast way to "take" item over network

$
0
0
Hi, I would like to handle situations where 2 clients could try to pick up an item at the same time.
So currently, I'm doing it by asking the master client if no one has taken that item and redirect to a success et failed event afterwards. This solution might be very slow since it depends on both clients connections (first RPC from client A to B, second from B to A, only then pick up the item).
I read about room's custom properties but I'm not sure if that would really be faster. If I were to do it with custom properties, I would probably use CAS. First try to set the room property, then in the OnPhotonPlayerPropertiesChanged, if the value of the property is the client's one, pick up the item.
Would something like this be correct and is it better than going through the master client ?

Viewing all articles
Browse latest Browse all 15755

Trending Articles