dumb question

edited June 2010 in Photon Server
what's the diff between an event and operation?

thanks :)


  • Boris
    The event is sent from the server to the client.
    The operation is sent from the client to the server.
  • dreamora
    alternatively, custom events are sent from clients through server to clients without any server processing involved other than the message relay.
  • This was something that confused me too.

    I have server side logic that sends events (like round over).
    I have client sent events (like bullet fired)

    The way I see it, events are just types of Operations. There are a few standard types of operations: join, left, eventRaised (maybe more, cant see code right now)

    So when the client sends a bullet fired 'event', Photon wraps it in an operation of type 'eventRaised' and sends it to the server. Then the server does a switch statement on that operation and sees that it is of type 'eventRaised' so changes it into an 'event' and passes it to the event handler.
  • dreamora
    events are just data packets

    where as operations are instructions you send to the server (operations are always client -> server or server to itself)