question

robr84 avatar image
robr84 asked

webRpcResponse.Parameters are coming up null / RoomCreated not being called

When I try to use webRPC to obtain a saved game list, the webRPC parameters are coming up as null. As per the code states: "WebRpc executed ok but didn't get content back. This happens for empty save-game lists.". So checking my playstream I can see no RoomCreated ever gets called (only Room Property Changed). I've attached a snapshot of my webhooks setup in my Photon account, the cloud script regarding these functions, and playstream snapshot. I can't figure out why the RoomCreated doesn't get called. When I create a room, my script is as follows:

public void CreateRoom()

{

PhotonNetwork.CreateRoom(null, new RoomOptions { MaxPlayers = maxPlayersPerRoom, PlayerTtl=-1});

}

Any help is appreciated!

unity3dCloudScriptphotonwebhooksPlayStream
10 |1200

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

robr84 avatar image
robr84 answered

All fixed. I was missing the essential RoomClosed webhook. Silly overlook by me.

10 |1200

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

robr84 avatar image
robr84 answered

Sorry here is my Cloud Script code and snapshots regarding webhooks and playstream.

// Triggered automatically when a Photon room is first created
handlers.RoomCreated = function (args) {
    server.WriteTitleEvent({
    	EventName : "room_created"
    });
    return { ResultCode : 0, Message: 'Success' };
};


// Triggered automatically when a player joins a Photon room
handlers.RoomJoined = function (args) {
    server.WriteTitleEvent({
    	EventName : "room_joined"
    });
    return { ResultCode : 0, Message: 'Success' };
};


// Triggered automatically when a player leaves a Photon room
handlers.RoomLeft = function (args) {
    server.WriteTitleEvent({
    	EventName : "room_left"
    });
    return { ResultCode : 0, Message: 'Success' };
};




// Triggered automatically when a Photon room closes
// Note: currentPlayerId is undefined in this function
handlers.RoomClosed = function (args) {
    server.WriteTitleEvent({
    	EventName : "room_closed"
    });
    return { ResultCode : 0, Message: 'Success' };
};


// Triggered automatically when a Photon room game property is updated.
// Note: currentPlayerId is undefined in this function
handlers.RoomPropertyUpdated = function (args) {
    server.WriteTitleEvent({
    	EventName : "room_property_changed"
    });
    return { ResultCode : 0, Message: 'Success' };
};


// Triggered by calling "OpRaiseEvent" on the Photon client. The "args.Data" property is 
// set to the value of the "customEventContent" HashTable parameter, so you can use
// it to pass in arbitrary data.
handlers.RoomEventRaised = function (args) {
    server.WriteTitleEvent({
    	EventName : "room_event_raised"
    });
    return { ResultCode : 0, Message: 'Success' };
};

photon-webhooks-snapshot.png

playstream-snapshot.png


10 |1200

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

Seth Du avatar image
Seth Du answered

We have tested our Photon project but cannot reproduce your issue, the Cloud Script functions can be triggered properly, including RoomCreated, RoomLeft, RoomClosed and etc.

My advice for now is to check the tutorial: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/photon/quickstart and compare it with your code to see if there is anything missing or different.

I will also inform our team to check the back end of your title to see if the events have been triggered. Also, if you can find the Photon support channel, it will be good to check the back end log。

10 |1200

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

robr84 avatar image
robr84 answered

Thanks for looking into this for me. I have checked it with the tutorial and I cannot see anything different. As I'm getting the RoomPropertyUpdated title events, is it safe to say everything is connected correctly and just specifically not getting the RoomCreated title events? I am currently going back and forth with Photon support too so fingers crossed I can get to the bottom of this.

2 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.

Seth Du avatar image Seth Du ♦ commented ·

Yes, I believe it should be event-related functions not being triggered. However, to verify the functionality of Photon, you may open 2 clients to test if another player can join the room.

I will keep this thread updated and if there is any feedback from our team, I will inform you.

0 Likes 0 ·
robr84 avatar image robr84 commented ·

Ok I just tested it then and I can confirm I was able to join the room from another device. Double checked playstream and still only shows the RoomPropertyUpdated events

0 Likes 0 ·

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.