Alternative to OnOperationResponse

Hello,
i want to get back a response from the webhook playfab, with realtime there is OnOperationResponse but with PUN 2, i can't extend my class with LoadBalancingClient. I guess there is an alternative ?

i send with raiseEvent and get back with onEvent when it comes from the others players, but how about this webhook ?

UP: OK I've manage to test it and this is exactly the same method which receive the response. But I don't get it, how we differentiate the event received from the webhook and the one from the other client client?

Thank you for your time.

Comments

  • I've manage to test it and this is exactly the same method which receive the response. But I don't get it, how we differentiate the event received from the webhook and the one from the other client client?


    RaiseEvent typically raises an event with some event code. You can choose that.
    There are a few event codes pre-defined by Photon, which you can't choose and where the content and meaning are fixed. I think a failed WebHook may trigger such an event but a successful reply by some service is returned in the operation response.
    Typically, RaiseEvent doesn't have a response (at that would be a lot of overhead for a very often used operation).
    So, I would say: You differentiate the event meaning and content by event code. Otherwise, the WebHook resonse should be a "response" to an operation you called - with the same operation code (but being a response).

    Not sure if I got your question and current situation.
    Next week, our WebHooks expert is back and may reply.
  • antigode
    antigode
    edited April 2019
    Thank you for your response. You said "is returned in the operation response", then how can i catch them if i can't use "OnOperationResponse" ? Is it about the last part of your message ? Sorry I'm not very good at english. What i want to do, is send with raise event the move i made (turned based game), the webhook catch it and save the move in database and send back if it succeeds. I'm looking at the memory card demo to understand but it's so different from PUN 2.
  • It's renamed and not exposed directly by the PhotonNetworking class but you can still get operation responses.
    Use:
    PhotonNetwork.NetworkingClient.OpResponseReceived += yourMethod;
    The Memory Demo uses Custom Properties. This means the current state is always complete in the Room on the server side and it can be stored with the "IsPersistent" option (a setting in the Dashboard).
    One drawback here would be that your (web) server has no saying about this change. It gets accepted. I think, you have some control over sending an event or not (but this is the terrain of another colleague, who should be back on Monday to help).
  • antigode
    antigode
    edited April 2019
    Thank you then i will wait him, hope he will read this post... Have a nice week end
    PS: i will try with what you gave me !
    By the way, where is the doc to know those renamed functions ?
  • I was wrong on when my colleague is back. It's Wednesday.
  • antigode
    antigode
    edited April 2019
    Well finally with what you gave me, I was able to make it work ! Thank you for your update. But, thinking about your response on the "high ping punbasis" post, I start to lose the point on using PUN, compared to Realtime, what does it bring that Realtime doesn't ? PUN handle the unity side with listener on transform, etc.. isn't it ?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited April 2019
    Hi @antigode,

    I'm back but I think I'm no longer needed here.

    By the way, where is the doc to know those renamed functions ?
    Photon Realtime had a major update lately that was first released as part of PUN2.
    We have only documented the list of changes from PUN1 to PUN2.
    We did not update documentation or reference API of Photon Realtime yet.

    i want to get back a response from the webhook playfab, with realtime there is OnOperationResponse but with PUN 2, i can't extend my class with LoadBalancingClient. I guess there is an alternative ?
    It's renamed and not exposed directly by the PhotonNetworking class but you can still get operation responses.


    Although @Tobias pointed you to the right direction, I wanted to mention that there was a confusion regarding OnOperationResponse.
    There is LoadBalancingClient.OnOperationResponse which is the implementation of IPhotonPeerListener.OnOperationResponse. This did not change.
    There WAS also LoadBalancingClient.OnOpResponseAction which was renamed to LoadBalancingClient.OpResponseReceived.

    One drawback here would be that your (web) server has no saying about this change. It gets accepted. I think, you have some control over sending an event or not
    Photon Realtime Webhooks cannot cancel or abort any operation. Also saving data from webhooks depends on what you need to do with the data. The only use case that we support out-of-the-box is persisting room state as is in whole using PathCreate and PathClose. Read the "Persistence Guide".

    what does it bring that Realtime doesn't ? PUN handle the unity side with listener on transform, etc.. isn't it ?
    You can use Photon Realtime only for your use case.
    If you are asking about the difference between PUN and Photon Realtime, here is the answer.
  • antigode
    antigode
    edited April 2019
    Thank you for all the details, I ve seen many response from you on forum here and playfab too I think, it really helped me. I am currently reading your (not really sure about this one) cloud script implementation of the memo demo and it really helps too. There is an issue with updtateEntry(gamelist(I'd)) but I think it's because you never created first the shared group data with the ID given. Im sorry I'm not perfectly clear cause I can't access to my computer right now... EDIT: yes i needed to create an updateSharedData name XX_GameList when a player is created. Probleme solved.