Wiki

Case Status
Log In

Wiki

 
Home ยป Add-ons»Photon Networking»Photon DemoWorker Sample»Photon DemoWorker Room players…
Index
Navigation
Community Wiki

Photon DemoWorker Room players Watcher Fsm

Watch the number of players in the room and dispatch events to tell everyone interested. 

Watching for Photon Player connections

This Fsm is a small utility used by the Chat system to know when the room is busy or not. If there is no one in the room, we do not need to show any chat related features.

So, to do that, we simply watch for PHOTON / PHOTON PLAYER CONNECTED and PHOTON / PHOTON PLAYER DISCONNECTED. These events are part of the Playmaker Photon integration

When these events are triggered, this means the number of players in the room has changed, so we query for the number of players on the room, and depending on the result sends a ROOM IS BUSY or ROOM IS EMPTY global event. You'll notice that the state "is there players in the room?" expects least two players to be in, you and at least someone else.

 

Photon Actions used:

Photon Events used

Tags:

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

  • RSS Feed