Case Status
Log In


Home ยป Add-ons»Photon Networking»Photon DemoWorker Sample»Photon DemoWorker Master Clien…
Community Wiki

Photon DemoWorker Master Client switch watcher

Watch when a master client changes and inform players via the chat system

This is a minor Fsm, only here to demonstrate features. In this particular case, the Master client switch system.

In the cloud server, one of the application acts as Master, but when this instance quits, another connected instance is then acting as the master, and a PHOTON /MASTER CLIENT SWITCHED Event is fired as a result. It is important to note that this event is only sent to the new master, not to everyone. 

So, this Fsm watch for the PHOTON /MASTER CLIENT SWITCHED event, and double check we are indeed connected ( just some additional security measure). If we are indeed connected, we use the chat system to inform the users:

We first tell the new master that indeed he is, this is done in the "say hello to the new master", You'll notice that the "Photon View RPC Broadcast Fsm event" action has its photon target set to "Master client", this is how we make sure that only the master is receiving this Event ( CHAT RPC CALL )

Next, we inform all others ( remember, this event is only sent to the new master, that the cloud switched too), about this switch. We do this in the "inform player about the new master", we fire this to everyone, so the master will also receive this.


Photon Actions used:

Photon Events used


Last modified on 5/28/2012 4:18 AM by User.

  • RSS Feed