What are the distinctions between operations and events?
Options
In my situation (I am doing stuff just to learn Photon), I create an entity when a new client connects to the host:
I happened to notice that the host was not capable of sending an operation to the client; instead, it needed to send an event. At least, this is what I did to make it work 8-)
I didn't see a lot of mention about Events in the reference material - under "Operations & Events" there is decent material on sending Operations, but I could not find anything on Events aside from how they are implemented on top of Lite & LiteLobby (which is not what I am using).
What are the distinctions between operations and events?
protected override PeerBase CreatePeer(InitRequest initRequest) { var peer = new Peer(initRequest.Protocol, initRequest.PhotonPeer); EventData createEntityEvent = new EventData((byte)EventCodes.CreateEntity); createEntityEvent.Parameters = null; peer.SendEvent(createEntityEvent, new SendParameters()); return peer; }
I happened to notice that the host was not capable of sending an operation to the client; instead, it needed to send an event. At least, this is what I did to make it work 8-)
I didn't see a lot of mention about Events in the reference material - under "Operations & Events" there is decent material on sending Operations, but I could not find anything on Events aside from how they are implemented on top of Lite & LiteLobby (which is not what I am using).
What are the distinctions between operations and events?
0
Comments
-
Events (like client was moved, healed, teleported) happen on server, and you notify clients about this by sending Event
Operation happens on client. Client sends some request to server to perform some action or operation, like 'move me', 'heal me', 'teleport me'. if server will approve this request, then event on server happens
There is mostly logical distinction0 -
chvetsov wrote:Events (like client was moved, healed, teleported) happen on server, and you notify clients about this by sending Event
Operation happens on client. Client sends some request to server to perform some action or operation, like 'move me', 'heal me', 'teleport me'. if server will approve this request, then event on server happens
There is mostly logical distinction
Ok, sounds simple enough. Is this in the reference section?0 -
Yes: http://doc.exitgames.com/photon-server/BasicConcepts/ gives a high-level explanation of operations and events, and http://doc.exitgames.com/photon-server/ ... perations/ has some more details.0
-
Nicole wrote:Yes: http://doc.exitgames.com/photon-server/BasicConcepts/ gives a high-level explanation of operations and events, and doc.exitgames.com/photon-server/CallingOperations/ has some more details.
Yeah I figured I had just missed it! :oops:0