question

glen avatar image
glen asked

Photon CloudScript Webhooks not being called

I am probably missing something here, but currently the Photon webhooks for CloudScript don't seem to be getting called for my title. I'm using the correct Photon AppId (the one in the Add-ons section). I'm also able to do custom authentication with PlayFab. I'm able to connect 2 clients and play a match successfully.

I've tested both Photon Cloud hosting and a local on premise server running on my desktop. I've tested handlers.RoomCreated and handlers.RoomJoined. I've tested with and without using a Photon plugin.

As similar inquiry, would it be possible to call a CloudScript handler directly from within a Photon plugin?

The end goal is to have a Photon dedicated server using their plugins method for authoritative logic. We'd use this in conjunction with PlayFab CloudScript for more complete server authority/anti-cheating.

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Forgive me if this seems pedantic, but I find that it's best to be extremely clear in defining terms:

Using a Photon Realtime App ID from the add-ons page in PlayFab lets you use that service, which allows for creating "Rooms" that clients can search on and use to exchange data. It does not provide for any hosted server-authoritative logic. Whenever a room is created, joined, left, etc., a Webhook call is made to PlayFab using the handlers defined in this doc: https://api.playfab.com/docs/using-photon-with-playfab/.

Photon on premise refers to Photon Server, which is a custom game server Exit Games provides licenses to, which you can add server authoritative logic to and then host in a game server provider. It is completely distinct from Photon Realtime.

Photon Enterprise is the service that Exit Games provides which is similar to Photon Realtime, in that Exit Games hosts the servers for your title, but which also allows you to add your own server-authoritative logic to, using their plugin model. It is also completely distinct from Photon Realtime.

It sounds like what you're using is Photon Enterprise. In that case, you would use an App ID generated by Exit Games. The Photon Realtime App ID from your Add-ons page in PlayFab is specifically for the apps we have pre-configured in Photon Cloud, so you shouldn't re-use them on a separate app that you manage in the Photon dashboard. But yes, you can call any of the PlayFab API methods from your custom logic in that model. In that case, I would recommend only using Cloud Script for cases where you don't need to have players connected to the server, such as when they're in menus on the client before joining game sessions.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

glen avatar image glen commented ·

Yes the final setup will be Photon Enterprise Cloud. But for development of the plugin we need to use a Photon On-Premise Server. So we develop and test the plugin on a local LAN setup in office. Then we push the final plugin .dll to the Photon Enterprise Cloud.

From what you're saying, I'm understanding that we won't be using the Photon Add-on in the PlayFab MarketPlace at all, this is correct?

I'm a bit confused on your last couple statements:

"...yes, you can call any of the PlayFab API methods from your custom logic in that model"

and:

"I would recommend only using Cloud Script for cases where you don't need to have players connected to the server"

A photon plugin doesn't get instantiated until a room is created which means a player has already connected to and joined a photon room. From that point, and while the room exists, is when photon plugin logic is available. It is during that time I'd want to call 2 CloudScript functions. One at the very beginning of the match to validate items the player will be using for the match and one at the end of the match to update information for both players such as Inventory items or statistics (based on winning or losing).

0 Likes 0 ·
brendan avatar image brendan glen commented ·

Correct - when you're using Photon Enterprise, you'll be using your own App ID. Photon Enterprise is a custom contract between you and Exit Games, and it's distinct from Photon Realtime, which is what we offer via the Add-ons Marketplace.

For PlayFab enterprise customers, we can make sure that webhook usage from a Photon Enterprise app is part of our agreement with you, and can work with you to enable that path. Alternately, if you need server authoritative logic that isn't triggered by a Cloud Script call from the client, and which cannot be supported in Photon Enterprise, you may want to consider custom game servers instead (https://api.playfab.com/docs/custom-game-servers). But I'd recommend checking with the Exit Games team first, to see if they can provide you with a way to enable your server-side logic where you need it in your game flow.

0 Likes 0 ·
wintah avatar image wintah brendan commented ·

A related question: for current live Photon customers, can the webhooks be configured in the Photon Webhooks configuration page to enable PlayFab integration? (I saw a mention about PlayFab Photon App IDs being preconfigured in some other answer.)

If not, are there other ways to do this (such as migrating the realtime cloud agreement)? And would this introduce a cost overhead (either as cost on top of the current agreement, or from compulsory professional modules, or something else)?

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.