當前位置: 首頁>>代碼示例>>C#>>正文


C# CloudRegionCode.ToString方法代碼示例

本文整理匯總了C#中CloudRegionCode.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# CloudRegionCode.ToString方法的具體用法?C# CloudRegionCode.ToString怎麽用?C# CloudRegionCode.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CloudRegionCode的用法示例。


在下文中一共展示了CloudRegionCode.ToString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ConnectToRegionMaster

    /// <summary>
    /// Connects you to a specific region's Master Server, using the Name Server to find the IP.
    /// </summary>
    /// <returns>If the operation could be sent. If false, no operation was sent.</returns>
    public bool ConnectToRegionMaster(CloudRegionCode region)
    {
        if (PhotonHandler.AppQuits)
        {
            Debug.LogWarning("Ignoring Connect() because app gets closed. If this is an error, check PhotonHandler.AppQuits.");
            return false;
        }

        IsUsingNameServer = true;
        this.CloudRegion = region;

        if (this.State == global::PeerState.ConnectedToNameServer)
        {
            return this.OpAuthenticate(this.mAppId, this.mAppVersionPun, this.PlayerName, this.CustomAuthenticationValues, region.ToString());
        }

        #if RHTTP
        string address = (this.UsedProtocol == ConnectionProtocol.RHttp) ? this.NameServerAddressHttp : this.NameServerAddress;
        #else
        string address = this.NameServerAddress;
        #endif

        if (!address.Contains(":"))
        {
            int port = 0;
            ProtocolToNameServerPort.TryGetValue(this.UsedProtocol, out port);
            address = string.Format("{0}:{1}", address, port);
            //Debug.Log("Server to connect to: "+ address + " settings protocol: " + PhotonNetwork.PhotonServerSettings.Protocol);
        }
        if (!base.Connect(address, "ns"))
        {
            return false;
        }

        this.State = global::PeerState.ConnectingToNameServer;
        return true;
    }
開發者ID:JonasSkaug,項目名稱:afgangsprojekt-team-tj,代碼行數:41,代碼來源:NetworkingPeer.cs

示例2: ConnectToRegionMaster

    /// <summary>
    /// Connects you to a specific region's Master Server, using the Name Server to find the IP.
    /// </summary>
    /// <returns>If the operation could be sent. If false, no operation was sent.</returns>
    public bool ConnectToRegionMaster(CloudRegionCode region)
    {
        if (PhotonHandler.AppQuits)
        {
            Debug.LogWarning("Ignoring Connect() because app gets closed. If this is an error, check PhotonHandler.AppQuits.");
            return false;
        }

        IsUsingNameServer = true;
        this.CloudRegion = region;

        if (this.State == global::PeerState.ConnectedToNameServer)
        {
            AuthenticationValues auth = this.CustomAuthenticationValues ?? new AuthenticationValues() { UserId = this.PlayerName };
            return this.OpAuthenticate(this.mAppId, this.mAppVersionPun, auth, region.ToString(), requestLobbyStatistics);
        }

        string address = this.NameServerAddress;
        if (!base.Connect(address, "ns"))
        {
            return false;
        }

        this.State = global::PeerState.ConnectingToNameServer;
        return true;
    }
開發者ID:houseofkohina,項目名稱:ProjectDoge,代碼行數:30,代碼來源:NetworkingPeer.cs


注:本文中的CloudRegionCode.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。