当前位置: 首页>>代码示例>>C#>>正文


C# NetworkConnectionError类代码示例

本文整理汇总了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);
 }
开发者ID:peterklima,项目名称:ARJenga,代码行数:11,代码来源:NetworkBase.cs

示例2: OnFailedToConnect

 private void OnFailedToConnect(NetworkConnectionError error)
 {
     if(FailedToConnect != null)
     {
         FailedToConnect(error);
     }
 }
开发者ID:anneomcl,项目名称:LetsMake,代码行数:7,代码来源:ManagedNetworkBehaviour.cs

示例3: OnConnectionFailure

    public void OnConnectionFailure( NetworkConnectionError _info )
    {
        this.connectingPanelObj.SetActive( false );
        this.mainPanelObj.SetActive( true );

        this.currentState = STATE.MAIN;
    }
开发者ID:marshl,项目名称:Leviathan2,代码行数:7,代码来源:MainMenuButtons.cs

示例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)
	}
开发者ID:RobbSteel,项目名称:Lords-of-Distortion,代码行数:7,代码来源:JoinServer.cs

示例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......");
        }
    }
开发者ID:esmayl,项目名称:De-Zuidlanden-Stage-project,代码行数:28,代码来源:Networking.cs

示例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);
    }
开发者ID:datnewb,项目名称:Kartus,代码行数:8,代码来源:MenuJoinGame.cs

示例7: OnFailedToConnectToMasterServer

    void OnFailedToConnectToMasterServer(NetworkConnectionError info)
    {
        if(Preloading)
            Preloading.SetActive(false);

        if (TextInfo)
            TextInfo.text = info.ToString ();
    }
开发者ID:sparxcrossroads,项目名称:UnitZ,代码行数:8,代码来源:ConnectingEvent.cs

示例8: OnFailedToConnect

    void OnFailedToConnect(NetworkConnectionError error)
    {
        if(Preloading)
            Preloading.SetActive(false);

        if (TextInfo)
            TextInfo.text = error.ToString ();
    }
开发者ID:sparxcrossroads,项目名称:UnitZ,代码行数:8,代码来源:ConnectingEvent.cs

示例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;
    }
开发者ID:RavenNevermore,项目名称:EndOfLine,代码行数:9,代码来源:BtnJoinOtherBehaviour.cs

示例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();
     }
 }
开发者ID:Gamieon,项目名称:UniNetShooter,代码行数:18,代码来源:Client.cs

示例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);
     }
 }
开发者ID:nbilling,项目名称:TNPRH,代码行数:13,代码来源:NetworkManager.cs

示例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");
     }
 }
开发者ID:vladdie,项目名称:Galaga,代码行数:39,代码来源:NetworkManager.cs

示例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);
 }
开发者ID:Delacrowa,项目名称:project1,代码行数:5,代码来源:ObservableMonoBehaviour.cs

示例14: OnFailedToConnect

 void OnFailedToConnect(NetworkConnectionError error)
 {
     Debug.Log("Could not connect to server: " + error);
     GameState = (int)state.failconnect;
 }
开发者ID:Game-Group,项目名称:dog-fighter,代码行数:5,代码来源:networkController.cs

示例15: OnFailedToConnectToMasterServer

 void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     Debug.Log("Could not connect to master server: " + info);
 }
开发者ID:pkerkidhd,项目名称:CourierExpressTycoon,代码行数:4,代码来源:ServerScript.cs


注:本文中的NetworkConnectionError类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。