Sending UDP packets through PUN

Options
ddn278
ddn278
edited September 2014 in Photon Unity Networking (PUN)
I've reviewed PUN and it seems to be missing any interfaces for sending lossy events directly from peer to peers. Seems odd since this is somewhat of a fundamental networking api. There is the RPC interface which is for reliable messages which really doesn't fit the role of what I'm looking for. There is also the seraliable interface for the PhotonView classes which can be made unreliable but is such and odd work around for trying to send unreliable events to the peers. Is there some API im missing? just sending a lossy event to the other peers? I want to build my networking framework off PUN, I don't needs PUN PhotonView logic, other than the RPCs.

Comments

  • ddn278
    Options
    Look through the API i see there is a mechanism for sending unreliable events, through the PhotonNetwork.RaiseEvent.

    BTW the documentation for the example handler is using the wrong prototype

    private void OnEventHandler(byte eventCode, object content, PhotonPlayer sender)

    but the delegate is actually ..

    public delegate void EventCallback(byte eventCode, object content, int senderId);

    now. I'll give this a try and see how it works.

    Thanks!

    -ddn
  • Tobias
    Options
    Sorry for the late reaction. I was on vacation and it seems you handled this yourself quite well, even working around some documentation errors.

    PUN is created as "look alike" for Unity's built-in networking and that didn't have those features, so they are not in the limelight in demos and documentation.
    You found the exact right method to make direct use of Photon's events and reliability options. The RaiseEventOption class gives you control over how things are sent.

    Let us know if the provided features work for you or if you miss something.