.OnEvent vs .OnOperationResponse

Options
Sixross
edited October 2014 in DotNet
What is difference between IPhotonPeerListener.OnEvent and .OnOperationResponse. I read references and don't understand about how to use them.

Comments

  • Tobias
    Options
    OnOperationResponse gets called by the library, when you got a response to an Operation.
    Operations are basically RPCs that the clients can call on the server. a client gets a response for most of the Operation calls.
    The LoadBalancing API handles most of the responses for you.
    As example: You join a game and the server tells you if the join was successful and on which machine the room is.

    So when you implement your own Operations, the callback is the place to handle whatever you sent back to the client.


    Events on the other hand are incoming messages that can be caused by a lot of different triggers. You get one when other players join or leave a room you're in. You get some when a client called OpRaiseEvent to make the server send an event with some content.
    Implement OnEvent to handle those. Again, some of them are handled by the LoadBalancing API.