What should "UseMyServer" be replaced with in PUN2

Options
Beginner but attempting to migrate a project, curious how this should be replaced.
PhotonNetwork.PhotonServerSettings.UseMyServer(AuthIp, serverPort, appId);

All the best

Comments

  • Oliver123
    Oliver123
    edited March 2021
    Options
    also noticed "photonView.instantiationData" is missing from the migration manual
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Oliver123,

    Thank you for choosing Photon and very good question!
    PhotonNetwork.PhotonServerSettings.UseMyServer(AuthIp, serverPort, appId);
    
    can be replaced with:
    PhotonNetwork.PhotonServerSettings.AppSettings.Server = AuthIp;
    PhotonNetwork.PhotonServerSettings.AppSettings.Port = serverPort;
    PhotonNetwork.PhotonServerSettings.AppSettings.RealtimeAppId = appId; // although AppId is not really useful or used on self-hosted Photon Server maybe on v5? or set it to "master" as PUN Classic does when AppId is null
    

    Also, if you use v4:
    PhotonNetwork.PhotonServerSettings.AppSettings.UserNameServer = false;
    
    If you use v5 (it has name server same like Photon Cloud):
    PhotonNetwork.PhotonServerSettings.AppSettings.UserNameServer = true;
    
    We will think about adding something similar to this or include a snippet in the Migration Guide documentation.
    For the time being here is how to configure PUN 2 to connect to self-hosted Photon Server.

    photonView.instantiationData is renamed to photonView.InstantiationData.