Operations, Events

Options
duke
edited June 2012 in Photon Server
Operation Requests can be made by client peers, but not server peers.
Operation Responses can be made to client requests by the server, a client doesn't do the same for server Events.
Events are sent by the servers, and do not expect a response back from the client. A client doesn't send Events.

Is this correct?

Comments

  • Fratyr
    Options
    Operation is a request sent by client to the server. The client might expect optional response. (I think server can respond with Event as well)
    Event is sent by the server to one, group or all available peers. Server doesn't expect a response.

    But you can mix it and according to the situation, you can send another Operation request from the client when received server Event.

    For example,

    Client 1 initiates mass summon of his party members to his location. Client sends operation request to the server, that he wants to summon all his party members to him.
    The server parses the request, does the logic (assuming everything is fine and client really can do such things) and raises an event to all party members, expect the summoner.
    All clients around start to play the event, which shows a message "Client 1 wants to summon you to location "XX" Accept? Yes / No"

    Whether you click Yes or No, it means you're sending another operation (each of the party members) back to the server notifying him about your choice, and once all answers collected, the server will raise another event and teleport those who accepted..

    That's how I see it :)
  • Philip
    Options
    duke wrote:
    a) Operation Requests can be made by client peers, but not server peers.
    b) Operation Responses can be made to client requests by the server, a client doesn't do the same for server Events.
    c) Events are sent by the servers, and do not expect a response back from the client. A client doesn't send Events.
    Is this correct?

    This is correct for client-to-server communication. In a server-to-server scenario it is allowed to send all 3 in any direction.