Operation Response VS Events

Options
eyewitness4560
edited October 2013 in Photon Server
We have an amateurish question regarding OperationResponse and Events :)

Situation is as follows: we refresh the ActionPoints (AP from now) of users every 500ms, until it reaches the specified maximum for that user. The rest of the users in the room don't need to know how much AP everyone is getting, so we opted to send it to the clients by OP code as an OperationResponse, which is then handled by the client.

We're not really sure if this is the best way, or should we use events for this? Since we don't want every player in the room to get it (although we are aware that events don't have to be broadcasted to everyone) we found OperationResponse to be a bit better suited for the task. What's your opinion?
In cases where the client does not send a request for the server, but when certain criteria are met, the server updates values on its own, is it worth it to go with OperationResponse, and address only a single client?

Thanks in advance,
Andrew

Comments

  • chvetsov
    Options
    Hi, Andrew.

    In Photon we have Operations/Responses and Events.
    You should thing about Operation/Response as about RPC call. You call some remote procedure and this procedure may return some value or may not. This is done by Response.

    Events are not connected to operation/responses. But they can be triggered by some operation. Events are just events on server. They can be sent either to one of players or to all of them or some of them.
    For instance, day time change is event on server. Your time got the flag and you got bonus points. Notification about this events should be done through Evet

    Hope, you get the idea