question

oosnuyh86 avatar image
oosnuyh86 asked

CloudScript Response with null refernce

I have requested cloudscript to write player event on playstream, but it gives me back javascript errors and unity error simultaneously.

My cloud script is :

handlers.RoomJoined = function (args) 
{
    log.debug("Room Joined - Game: " + args.GameId + " PlayFabId: " + args.UserId);
    server.WritePlayerEvent({
        "PlayFabId" : args.UserId,
        "EventName" : "OnJoinedRoom",
        "Body" : { "event" : "OnJoinedRoom" }
    });
  
};

My unity code calling cloudscript is :

 PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
        {
            FunctionName = "RoomJoined",
            
        }, OnCloudResponse, OnErrorShared);

I've tried this because webhooks actually not working well. Is there anything I have missed so far?

Title ID would be "D63C"

Thank you, in advance.

CloudScriptwebhooks
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

First, can you explain what you mean concerning webhooks? We have quite a few titles using Photon Realtime via our integration, and we've yet to have anyone encounter an issue with this. Are you using the App ID from the Add-ons page for your title (https://developer.playfab.com/en-us/D63C/addons/Photon)? If not, can you try using that? If you are, can you provide details on the issue you're seeing?

For the call you're making, you're specifically using two input parameters - GameId and UserId - but you're not passing in any arguments in the call to ExecuteCloudScript, in your code snippet.

10 |1200

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

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.