Where does SocketServer.PeerBase.SendEvent go?
Options
Client.Photon.PhotonPeer (Unity3D) has no OnEvent. What happens when I call SocketServer.PeerBase.SendEvent against a unity client?
I see that IPhotonPeerListener has an OnEvent method, but PhotonPeer doesn't. I'm coming from the S2S API where both peers are the same type and they both have SendOperation/OnOperation and SendEvent/OnEvent.
Thanks
I see that IPhotonPeerListener has an OnEvent method, but PhotonPeer doesn't. I'm coming from the S2S API where both peers are the same type and they both have SendOperation/OnOperation and SendEvent/OnEvent.
Thanks
0
Comments
-
Oh. Now I got what you're looking for.
The client side is different (as you noticed). There, your game implements the callbacks, as defined by IPhotonPeerListener. The PhotonPeer (and it's deriving classes) need a IPhotonPeerListener implementation to call the callback methods on that.
Say, you implement IPhotonPeerListener in MyClient, then you pass a instance of that to the constructor of PhotonPeer.
The examples show this.public class Game : IPhotonPeerListener { public void OnEvent(EventData photonEvent) { // event reaction } // in some method: this.Peer = new LitePeer(this, this.protocol);
Have a look at the client SDK's samples.0 -
:oops: Sorry, Tobias. I was confused in a way that I can't even imagine. All I remember now is having about 6 copies of visual studio open, so that's probably where I went wrong . Weird.
Anyway, your explanation makes sense and I like the listener approach.
Thanks!0