ServerSettings.UseMyServer C# (CSharp) Method

UseMyServer() public method

public UseMyServer ( string serverAddress, int serverPort, string application ) : void
serverAddress string
serverPort int
application string
return void
    public void UseMyServer(string serverAddress, int serverPort, string application)
    {
        this.HostType = HostingOption.SelfHosted;
        this.AppID = (application != null) ? application : DefaultAppID;
        this.ServerAddress = serverAddress;
        this.ServerPort = serverPort;
    }

Usage Example

Example #1
0
    //3b
    void SetupSelfhostingGui()
    {
        GUILayout.Label("Your Photon Host");

        photonIP   = EditorGUILayout.TextField("IP:", photonIP);
        photonPort = EditorGUILayout.IntField("Port:", photonPort);
        //photonProtocol = (ExitGames.Client.Photon.ConnectionProtocol)EditorGUILayout.EnumPopup("Protocol:", photonProtocol);

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Cancel"))
        {
            GUIUtility.keyboardControl = 0;
            this.ReloadHostingSettingsFromFile();
        }
        if (GUILayout.Button("Save"))
        {
            GUIUtility.keyboardControl = 0;

            ServerSetting.UseMyServer(this.photonIP, this.photonPort, null);
            this.SavePhotonSettings();

            EditorUtility.DisplayDialog("Success", "Saved your settings.", "ok");
        }
        GUILayout.EndHorizontal();

        EditorGUILayout.Separator();

        GUILayout.Label("Running my own server is too much hassle..\nI want to give Photon's free app a try.");

        if (GUILayout.Button("Get the free cloud app"))
        {
            this.cloudAPPID  = "";
            photonSetupState = PhotonSetupStates._1;
        }
    }