Does a self hosted photon server support host migration?

I am running a self hosted server. If I am in a room and the master client leaves, no one gets assigned, master client. I noticed that OnMasterClientSwitched never gets called when the master client leaves. So does a self hosted server support host migration? Would I have to manually assign the master client when they leave a room?

Answers

  • hi, @jvalderrama91

    switching of master client is basic functionality that is supported out of the box. you do not have to do any things. I assume that there is an issue with OnMasterClientSwitched implementation. it is part of PluginBase class and you may see how it is implemented and either try to fix it in your code or just use something else

    best,
    ilya
  • Hi, @chvetsov

    I tested running my application with photon cloud and OnMasterClientSwitched was called. But when I ran the same application without any changes on self hosted server, it was not called. I think the issue is that the switching of the master client when it leaves a room, does not happen automatically with photon self hosted. Same thing goes with setting the master client with PhotonNetwork.SetMasterClient(), it doesn't work.

    I set up a photon server on my laptop and then connected with my pc just to make sure I was coding it correctly. Everything works as intended.

    For my original problem, I am connecting to a remote server that I don't have control over. Do you think it is a setting that is not allowing to change the master server? maybe they are using an older version of photon server sdk that doesn't have host migration features?
  • @jvalderrama91 I'm a bit confused. do you have an enterprise cloud where you may host your plugin? And you are saying that it works there, but does not work locally if you are using selfhosted solution?

    do I understand you right?


    there is no any config. try photon v5 beta, it is much more closer to what we have in cloud, so it may work better for you

    best,
    ilya
  • @chvetsov So it's the opposite. It does not work on the enterprise cloud, but it works when I selfhost locally.
  • well, I'm totally confused. You started this topic with message that something does not work in SelfHosted version. then you wrote:
    >I tested running my application with photon cloud and OnMasterClientSwitched was called.
    so, I assume that means that call to OnMasterClientSwitched works on cloud but not in self hosted.

    please describe your issue more precise. Please specify what versions of our products you are using

    best,
    ilya
  • @chvetsov Sorry for the confusion. I'll try to explain it better.

    If I don't self host, host migration work and all the callbacks work. So what I tried doing was setting up a photon server with photon control on my pc to see if there was some sort of setup issue that is causing host migration not to work. Connecting to the server I set up, worked fine.

    My issue is that in the project I am currently working on, we have a google cloud server that is hosting a photon server. Connecting an application through there is where host migration is not working.

    As I think about it the google/photon server was setup a while ago. Which could mean that it's not up to the current photon server sdk. I think I will try to make sure if it's up to the current version and see if I still get an issue.

  • @jvalderrama91 if you did not try yet Photon 5 beta, please do. it is very close to cloud version and thus I assume it will just work for you

    best,
    ilya