playMaker

Author Topic: Photon Set Master Client.  (Read 4112 times)

shinodan

  • Full Member
  • ***
  • Posts: 180
    • Shinozone
Photon Set Master Client.
« on: September 25, 2017, 09:13:38 AM »
Hi folks, been trying to come up with own solution for a few days.

Had a look at a invoking methods, had a look around the ecosystem too.

It seems unless I'm blind that there is no clear way to set a new room master manually. I have looked at the photon documentation and can see that there is a actually a method for setting a new master. But since I'm not a scripter I don't really know how to make that into an action.

Also, because "get photon view is mine" and "get is master client" have no option for every frame, I've needed to make a ticker myself and that fires every 0.01 seconds, I hate it doing as I know its bad practice/resource extensive. but at least its telling me who is the master properly.

From here what I'm trying to do, if the master quits, all of the powerups disappear, a new master is selected and the powerups FSM gets activated on the new master. bringing the powerups back.

I have a plan for when I get this working for the powerups to keep their "picked up" status, but I need to figure out how to get my game to sort everything out faster should the master client quit the game.

Half of this is question half of this is action request! sorry :)

I think my job would be easier if get photon view and get master client had every frame options.

Also an action for setting the new master client.

If anyone as any alternative workaround please do let me know!

Thanks,
Daniel x

shinodan

  • Full Member
  • ***
  • Posts: 180
    • Shinozone
Re: Photon Set Master Client.
« Reply #1 on: September 26, 2017, 03:01:47 AM »
Wow, I've just found the Photon master client switched Global Event. This may do the trick, that's my day sorted!

:D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Set Master Client.
« Reply #2 on: September 26, 2017, 03:59:33 AM »
Hi,

 the global event is for feedback, not for asking to change. For this you'll need a custom action. I'll do that for tomorrow.

 Bye,

 Jean

shinodan

  • Full Member
  • ***
  • Posts: 180
    • Shinozone
Re: Photon Set Master Client.
« Reply #3 on: September 26, 2017, 05:24:29 AM »
An action for that would still be great but the idea I had seems to have worked?

Here's a screen shot of my new FSM, No waits or Loops and seems to take effect instantly, I'm pretty happy with it!


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Set Master Client.
« Reply #4 on: September 27, 2017, 04:46:22 AM »
Hi,

 ok, maybe I don't understand.

 do you want to force masterClient switch or do you want to check when masterClient is indeed switched ( because it left the room basically)?

Bye,

 Jean

shinodan

  • Full Member
  • ***
  • Posts: 180
    • Shinozone
Re: Photon Set Master Client.
« Reply #5 on: September 29, 2017, 02:11:54 AM »
Hi,

 ok, maybe I don't understand.

 do you want to force masterClient switch or do you want to check when masterClient is indeed switched ( because it left the room basically)?

Bye,

 Jean

A bit of both to be honest :P, I wanted to tell if the master had quit, if he did I needed my pickup powerups to be deleted and re-instanciated by the new master seamlessly. :D
I basically needed to know if the master client has changed and if it has, give the control of pickups to the new master.
« Last Edit: September 29, 2017, 02:13:41 AM by shinodan »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Set Master Client.
« Reply #6 on: September 29, 2017, 02:38:42 AM »
Hi,

 ok, so yes, you want to listen to masterClient change, not actually forcing the masterClient to change ( which you should not, no point for 99.9% of cases).

 so yes you have everything, listen to the global event MASTERCLIENT SWITCHED, and the new master Client can take over.

so are you suggesting you would like an action to listen to MasterClient switch instead of listening via a global event?

 Bye,

 Jean