playMaker

Author Topic: Photon Rooms, Lobbys and who receives PHOTON or Custom events.  (Read 1169 times)

unclebob

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Photon Rooms, Lobbys and who receives PHOTON or Custom events.
« on: October 27, 2016, 06:07:45 AM »
Hi all

Jean, Alex and the team thank you for a fantastic environment.

Just a quick question regarding rooms, lobbys and PHOTON events as we do not have enough pcs to test on.

1. Our system creates more than one room eg a RedRoom, GreenRoom, BlueRoom, etc
2. We have players join the lobby and they are then are assigned to a room giving players in each room.
3. A single player broadcasts an PHOTON event such as Disconnect or a custom event.

The question is, is that event only received by the players in that room or do the the players in all the other rooms receive the same event?

If every player in every room does indeed receive the same event is the accepted practice to filter by:

Getting Room Players ===> Dumping into an array ===> Sending the event to this array of players only

Is there a more elegant solution?

Thanks in advance, if we had enough pcs and people we would simply build and test.

Cheers and apologies if this seems obvious but I cannot find a reference to this anywhere.

Unclebob
« Last Edit: October 27, 2016, 07:42:25 AM by unclebob »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15403
  • Official Playmaker Support
    • View Profile
Re: Photon Rooms, Lobbys and who receives PHOTON or Custom events.
« Reply #1 on: November 01, 2016, 12:21:31 AM »
Hi,

 you don't need several pc to test, you simply publish your app, duplicate it as many time as you want and run them all.



----------------

- PlayMaker event if not sent using Photon actions will only be received locally, in order for a PlayMaker event to go over the network, you need to send and RPC ( you'll find actions for this).

- Photon do not allow players to communicate if not in the same room, so no Player A in room X can not contact Player B in room Y.

However, you can do that using the Photon Chat sdk, you combine PUN and Chat sdk together and use Player authorization Id ( when they sign in your game, or as you define unity Id for player sessions), and then you can start having Players communicating across rooms. That's already pretty advanced, so some warning applies if you have no experience with medium complexity coding.

Bye,

 Jean