本文整理汇总了C#中NetworkConnectionError类的典型用法代码示例。如果您正苦于以下问题:C# NetworkConnectionError类的具体用法?C# NetworkConnectionError怎么用?C# NetworkConnectionError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetworkConnectionError类属于命名空间,在下文中一共展示了NetworkConnectionError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnFailedToConnect
/// <summary>
/// Client callback
/// See Unity-Script-Reference
/// </summary>
void OnFailedToConnect(NetworkConnectionError error)
{
Debug.Log("Could not connect to server: "+ error);
Debug.Log("Retry to connect to: " + serverAddress + " - " + serverPort);
// Try to connect to server
ConnectToServer(serverAddress,serverPort);
}
示例2: OnFailedToConnect
private void OnFailedToConnect(NetworkConnectionError error)
{
if(FailedToConnect != null)
{
FailedToConnect(error);
}
}
示例3: OnConnectionFailure
public void OnConnectionFailure( NetworkConnectionError _info )
{
this.connectingPanelObj.SetActive( false );
this.mainPanelObj.SetActive( true );
this.currentState = STATE.MAIN;
}
示例4: OnFailedToConnect
void OnFailedToConnect(NetworkConnectionError error){
if(!askedForConnection)
return;
print (error);
//TODO Update label to show that the game is in progress (even though the error is too many players)
}
示例5: JoinServer
void JoinServer()
{
//content = connectIP;
var host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
//err = Network.Connect(System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList[0], 843);
HostData[] test = MasterServer.PollHostList();
if (test.Length > 0)
{
err = Network.Connect(test[0]);
Debug.Log("Connecting....");
}
else
{
Debug.Log("No host online!");
Debug.Log("" + err);
Debug.Log(test[0].gameType + test[0].gameName);
}
if (err != NetworkConnectionError.NoError)
{
Debug.LogError("Unable to connect to server: " + err);
}
else
{
Debug.Log("Connecting to server......");
}
}
示例6: OnFailedToConnect
void OnFailedToConnect(NetworkConnectionError error)
{
string title = "CONNECTION FAILED";
string message = "Failed to connect to server. Either server doesn't exist or network has problems.";
UnityAction okAction = ConnectionFailedConfirm;
mainMenuHandler.ShowErrorDialog(title, message, okAction);
}
示例7: OnFailedToConnectToMasterServer
void OnFailedToConnectToMasterServer(NetworkConnectionError info)
{
if(Preloading)
Preloading.SetActive(false);
if (TextInfo)
TextInfo.text = info.ToString ();
}
示例8: OnFailedToConnect
void OnFailedToConnect(NetworkConnectionError error)
{
if(Preloading)
Preloading.SetActive(false);
if (TextInfo)
TextInfo.text = error.ToString ();
}
示例9: OnFailedToConnect
void OnFailedToConnect(NetworkConnectionError error)
{
this.errorState.AddLine("Failed to connect to " + this.gameState.hostIp, true);
this.errorState.ClearButtons();
this.errorState.Show(3.0f);
this.OnAbortedConnection();
this.connecting = false;
}
示例10: OnConnectToServerComplete
/// <summary>
/// This message is sent by the Input Director component if this application
/// has just connected to a server
/// </summary>
/// <param name='error'>
/// Error.
/// </param>
void OnConnectToServerComplete(NetworkConnectionError error)
{
// Now handle player stuff
if (NetworkConnectionError.NoError == error)
{
// Reset our own ID
selfID = null;
// Register with the server. This will send out an RPC call.
server.Register();
}
}
示例11: OnFailedToConnectToMasterServer
void OnFailedToConnectToMasterServer(NetworkConnectionError info)
{
if (Network.isServer)
{
Debug.Log("Start Server: Failed to connect to master server. Retrying...");
MasterServer.RegisterHost(typeName, gameName);
}
else
{
Debug.Log("Refresh Host List: Failed to connect to master server. Retying...");
MasterServer.RequestHostList(typeName);
}
}
示例12: OnFailedToConnect
// Called on the client when a connection attempt fails for some reason (Since v2.0)
void OnFailedToConnect(NetworkConnectionError error)
{
switch (error)
{
case NetworkConnectionError.NoError:
break;
case NetworkConnectionError.RSAPublicKeyMismatch:
break;
case NetworkConnectionError.InvalidPassword:
break;
case NetworkConnectionError.ConnectionFailed:
break;
case NetworkConnectionError.TooManyConnectedPlayers:
break;
case NetworkConnectionError.ConnectionBanned:
break;
case NetworkConnectionError.AlreadyConnectedToServer:
break;
case NetworkConnectionError.AlreadyConnectedToAnotherServer:
break;
case NetworkConnectionError.CreateSocketOrThreadFailure:
break;
case NetworkConnectionError.IncorrectParameters:
break;
case NetworkConnectionError.EmptyConnectTarget:
break;
case NetworkConnectionError.InternalDirectConnectFailed:
break;
case NetworkConnectionError.NATTargetNotConnected:
break;
case NetworkConnectionError.NATTargetConnectionLost:
break;
case NetworkConnectionError.NATPunchthroughFailed:
break;
default:
throw new ArgumentOutOfRangeException("error");
}
}
示例13: OnFailedToConnect
/// <summary>Called on the client when a connection attempt fails for some reason.</summary>
public override void OnFailedToConnect(NetworkConnectionError error)
{
if (onFailedToConnect != null) onFailedToConnect.OnNext(error);
}
示例14: OnFailedToConnect
void OnFailedToConnect(NetworkConnectionError error)
{
Debug.Log("Could not connect to server: " + error);
GameState = (int)state.failconnect;
}
示例15: OnFailedToConnectToMasterServer
void OnFailedToConnectToMasterServer(NetworkConnectionError info)
{
Debug.Log("Could not connect to master server: " + info);
}