本文整理汇总了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;
}
示例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;
}