NetworkingPeer.SetApp C# (CSharp) Method

SetApp() public method

public SetApp ( string appId, string gameVersion ) : void
appId string
gameVersion string
return void
    public void SetApp(string appId, string gameVersion)
    {
        this.mAppId = appId.Trim();

        if (!string.IsNullOrEmpty(gameVersion))
        {
            PhotonNetwork.gameVersion = gameVersion.Trim();
        }
    }

Usage Example

Exemplo n.º 1
0
 public static bool ConnectUsingSettings(string gameVersion)
 {
     if (PhotonServerSettings == null)
     {
         Debug.LogError("Can't connect: Loading settings failed. ServerSettings asset must be in any 'Resources' folder as: PhotonServerSettings");
         return(false);
     }
     SwitchToProtocol(PhotonServerSettings.Protocol);
     networkingPeer.SetApp(PhotonServerSettings.AppID, gameVersion);
     if (PhotonServerSettings.HostType == ServerSettings.HostingOption.OfflineMode)
     {
         offlineMode = true;
         return(true);
     }
     if (offlineMode)
     {
         Debug.LogWarning("ConnectUsingSettings() disabled the offline mode. No longer offline.");
     }
     offlineMode                     = false;
     isMessageQueueRunning           = true;
     networkingPeer.IsInitialConnect = true;
     if (PhotonServerSettings.HostType == ServerSettings.HostingOption.SelfHosted)
     {
         networkingPeer.IsUsingNameServer   = false;
         networkingPeer.MasterServerAddress = PhotonServerSettings.ServerAddress + ":" + PhotonServerSettings.ServerPort;
         return(networkingPeer.Connect(networkingPeer.MasterServerAddress, ServerConnection.MasterServer));
     }
     if (PhotonServerSettings.HostType == ServerSettings.HostingOption.BestRegion)
     {
         return(ConnectToBestCloudServer(gameVersion));
     }
     return(networkingPeer.ConnectToRegionMaster(PhotonServerSettings.PreferredRegion));
 }
All Usage Examples Of NetworkingPeer::SetApp
NetworkingPeer