I think the documentation for Photon webhooks and webRPC handlers and the basic samples given in the CloudScript revision 1 should be updated:
1. Unlike the comment on top of the respective handler (which is maybe due to copy/paste) currentPlayerId is available for RoomPropertyUpdated. It takes the value of args.UserId which is the UserId of the actor who updated the room or player properties.
2. It does not make sense to use log.Debug inside webhooks handlers. Instead you should use custom PlayStream events (a luxury early PlayFab users did not have :)).
3. In RoomEventRaised the right way to know event type is via args.EvCode which is the event code which should be between 0 and 200 for custom user events. So what is shown in the CloudScript sample is not a best practice or recommended as you use an extra field in the data to specify the event type. This may have been relevant in early stages of webhooks but not applicable anymore.
4. GetGameList is an example of webRPC and not a built in feature of Photon not PlayFab. This should be clearly documented as users tend to get confused about this.
5. An example of WebRPC is welcome to let customers know that hey can call any custom handler from Photon directly.
6. Default return type of webhooks handlers (in case of success or exception) should documented. IMO RoomCreated should not return State:"" on behalf of the user.
7. Webhooks settings values (HasErrorInfo, IsPersistent) could be mentioned for those who look for that info.
handlers.RoomCreated = function (args) { server.WritePlayerEvent( { PlayFabId: currentPlayerId, EventName: "photon_room_created", Timestamp: new Date(), Body: args } ); }; handlers.RoomJoined = function (args) { server.WritePlayerEvent( { PlayFabId: currentPlayerId, EventName: "photon_player_joined", Timestamp: new Date(), Body: args } ); }; handlers.RoomLeft = function (args) { server.WritePlayerEvent( { PlayFabId: currentPlayerId, EventName: "photon_player_left", Timestamp: new Date(), Body: args } ); }; handlers.RoomClosed = function (args) { server.WriteTitleEvent( { EventName: "photon_room_closed", Timestamp: new Date(), Body: args } ); }; handlers.RoomPropertyUpdated = function (args) { server.WritePlayerEvent( { PlayFabId: currentPlayerId, EventName: "photon_property_updated", Timestamp: new Date(), Body: args } ); }; handlers.RoomEventRaised = function (args) { server.WritePlayerEvent( { PlayFabId: currentPlayerId, EventName: "photon_event_raised", Timestamp: new Date(), Body: args } ); };