question

justas.antanauskas@gmail.com avatar image
justas.antanauskas@gmail.com asked

RoomJoined webhook error result is ignored

I successfully integrated Photon webhooks and I want to do some api calls on these hooks, that checks if certain player is allowed to create/join the room. For that I need hooks to return an error result and Photon to respond to it.

I made a simple test where RoomCreated returns this: return { ResultCode : 4, Message: 'Test error result' };

It works fine, Photon recognizes the error and interrupts the create room flow.

I did the same test on RoomJoined, but it does not work. It seems like it is ignoring the ResultCode entirely and the room join flow is not interruptable. As I understood from the docs, any ResultCode other than 0 should trigger an error. Is this a limitation, or only RoomCreated responds to errors?

CloudScriptphotonwebhooks
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

·
Gosen Gao avatar image
Gosen Gao answered

According to Photon docs, they mention "Any webhook call with a return object that has a ResultCode different than zero is considered as failed. If HasErrorInfo is set to true in the configuration; an ErrorInfo event will be broadcast to clients still joined to the room. Other than PathCreate, the server continues normal execution, despite this."

1 comment
10 |1200

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

justas.antanauskas@gmail.com avatar image justas.antanauskas@gmail.com commented ·

Thanks, I missed that part. Changed 'HasErrorInfo' to true and it returns the error result while not breaking the flow.

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.