That's how it works if you're using the App ID for Photon Realtime you get from the Photon Add-ons page in PlayFab, yes - when the room events occur, they can call to the handlers in Cloud Script to process some specific logic. The base handlers for those events are in the Revision 1 Cloud Script we automatically load into all newly created title in PlayFab.
1 Person is following this question.