Question about the Photon3DotNet dll

I want to know what the IphotonPeerListener.OnMessage is, and information about when it is called. It does not appear in the unity dll nor does the API Doc have it listed as method on there.

Comments

  • Hi, @mjoye
    this is for a case when you send messages instead of Operations. LoadBalancing does not support this. it is useful if you develop something your self.

    A message is an object serializable by photon. it could be string or byte[]. this will allow to use external serializers like protobuf

    best,
    ilya
  • mjoyemjoye
    edited November 2018
    Do you have any examples from server and client code that uses this? Why does this method appear in the Unity3d dll and only appears in the DotNet dll? It sound like to could be useful since we are looking at protobuf and MessagePak, and this could be a feature that we can use
  • @mjoye we do not have currently such samples.

    But as i said if you are going to use it with photon cloud or load balancing this will not work. It might be useful only if you write and host your code yourself

    best,
    ilya
  • I am currently am writing my own code and hosting it myself.
  • bad new that OnMessage handler is not accessible on the server side

    best,
    ilya
  • mjoyemjoye
    edited November 2018
    chvetsov said:

    bad new that OnMessage handler is not accessible on the server side

    best,
    ilya

    @chvetsov what do you mean by the statement? Why does the OnMessage method appears on the IPeerListener in Photon3DotNet.dll and not Photon3Unity3D.dll
  • hey @mjoye,

    Thank you for choosing Photon!

    Maybe you are using an old Photon3Unity3D.dll provided in the server SDK.
    You could get a newer one from Photon Realtime Unity SDK.
    The newest ones are provided inside PUN2 or Voice 2.
  • @JohnTube I have download the PUN2/Voice2 asset package from the unity store. It comes with the Photon3Unity3D.dll with the version 4.1.2.1 and it lacks the method OnMessage on the IPeerListener interface. The only methods that are on the interface are:
    OnEvent
    DebugReturn
    OnOperationResponse
    OnStatusChange
  • JohnTubeJohnTube mod
    edited December 2018
    Hi @mjoye,

    Sorry for the delay, I miss some discussions sometimes.
    You are right, OnMessage is not in the Photon3Unity3D.dll.
    Although all C#/Mono/.Net lib. flavors, including Unity's, share the same source code they are built differently.
    I can see multiple reasons why that method was excluded.
    Do you need it?
  • @JohnTube
    Yes this would be a helpful adaptation we have started using it for unit test clients(that use Photon3DotNet.dll assembly), and it is very useful. If you could tell us, what were some of the reasons that the method was exluded?
  • I think it was excluded because:

    - the same DLL was used in old projects that did not support raw message exchange (Photon Server v3)
    - most of our customers don't need it or don't use it
    - nobody asked for it before

    So just to make sure, you are using the raw message exchange feature yourself?
    I will see if we can release a new Unity lib (Photon3Unity3D.dll) that has it early next year.
  • Yes we incorporating the raw message exchange into our game.
  • chvetsovchvetsov mod
    edited January 3
    mjoye said:

    chvetsov said:

    bad new that OnMessage handler is not accessible on the server side

    ....
    @chvetsov what do you mean by the statement? Why does the OnMessage method appears on the IPeerListener in Photon3DotNet.dll and not Photon3Unity3D.dll
    to use messages you do need support on both sides client and server. Current server sdk does not support this.

    best,
    ilya
  • @chvetsov
    Do you if it could be exposed on the server side? This would help allowing us to send our own objects down the network. Yes we know this wont work for the products like PUN or CHAT however we are not using this products.
  • hi, @mjoye

    it is not possible to do for currently released SDK. Just use standard photon operations but add there only one parameter - byte array of your data.

    that is all that I can do for you here

    best,
    Ilya
Sign In or Register to comment.