Change AppID

Hi Photon Team,

It's possible to change the AppID during the connect call with PUN using one of the ConnectToMaster function call. How do I do this with the loadbalancing client library? I know that during instantiation, we can specify the AppID, but how do we change this AppID after instantiation? Thanks.

Comments

  • Hi Stevie.

    That functionality is not supported out of the box. Could you explain a usage scenario to me in which you could not just recreate the Client instance when switching appIDs?

    However as the LoadBalancing library is open source you could just add an appID parameter to connect() yourself. and override the value of the mAppID member variable with the content of that parameter. That should work just fine, so the only downside would be that you would have to merge that change over on future lib updates.
  • Hi,

    I followed the demo_LoadBalancing app and extended ExitGames::LoadBalancing::Listener. Inside my class I declared ExitGames::LoadBalancing::Client mLoadBalancingClient; Since the LoadBalancingClient doesn't seem to have an empty constructor and copy constructor, it seems like I can't just reinitialize mLoadBalancingClient again anywhere in the code. Is it possible to have mLoadBalancingClient as a pointer to ExitGames::LoadBalancing::Client then, so that I can just use the following snippet whenever I change the AppID, while still extending ExitGames::LoadBalancing::Listener for my main class?

    ExitGames::LoadBalancing::Client * mLoadBalancingClient;
    mLoadBalancingClient = new ExitGames::LoadBalancing::Client(...);

    Since the LoadBalancing::Client works with a pointer to ExitGames::LoadBalancing::Listener, I should be able to keep all the logic the same for my code and just change the syntax for all the Client function calls, right?

    Thanks for your help.
  • Hi Stevie.

    Sure, your can do that.