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)
	}
 private void OnFailedToConnect(NetworkConnectionError error)
 {
     if(FailedToConnect != null)
     {
         FailedToConnect(error);
     }
 }
Esempio n. 3
0
 /// <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);
 }
Esempio n. 4
0
    public void OnConnectionFailure( NetworkConnectionError _info )
    {
        this.connectingPanelObj.SetActive( false );
        this.mainPanelObj.SetActive( true );

        this.currentState = STATE.MAIN;
    }
    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......");
        }
    }
Esempio n. 6
0
    void OnFailedToConnectToMasterServer(NetworkConnectionError info)
    {
        if(Preloading)
            Preloading.SetActive(false);

        if (TextInfo)
            TextInfo.text = info.ToString ();
    }
Esempio n. 7
0
    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);
    }
Esempio n. 8
0
    void OnFailedToConnect(NetworkConnectionError error)
    {
        if(Preloading)
            Preloading.SetActive(false);

        if (TextInfo)
            TextInfo.text = error.ToString ();
    }
    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;
    }
Esempio n. 10
0
 /// <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();
     }
 }
Esempio n. 11
0
 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);
     }
 }
Esempio n. 12
0
 // 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");
     }
 }
Esempio n. 13
0
    void StartCreat()
    {
//		if (SceneManager.GetActiveScene().buildIndex != (int)GameLevel.Movie) {
//			return;
//		}

        if (!bIsLinkServer)
        {
            return;
        }
        bIsLinkServer = false;

        if (GameModeCtrl.ModeVal != GameMode.LianJi)
        {
            return;
        }

        if (GameTypeCtrl.IsServer)
        {
            NetworkConnectionError error = NetworkConnectionError.CreateSocketOrThreadFailure;
            //Debug.Log("PlayerPCState "+GameTypeCtrl.PlayerPCState);
            switch (GameTypeCtrl.PlayerPCState)
            {
            case PlayerEnum.PlayerOne:
                error = Network.InitializeServer(30, ServerPortVal, true);
                MasterServer.RegisterHost(GameTypeName, HostNameP1, Network.player.ipAddress);
                break;

            case PlayerEnum.PlayerTwo:
                error = Network.InitializeServer(30, ClientPortVal, true);
                MasterServer.RegisterHost(GameTypeName, HostNameP2, Network.player.ipAddress);
                break;
            }
            Network.incomingPassword = ServerPassword.XKMovie.ToString();

//			if (SceneManager.GetActiveScene().buildIndex == (int)GameLevel.Movie) {
//				Network.incomingPassword = ServerPassword.XKMovie.ToString();
//			}
//			else {
//				Network.incomingPassword = ServerPassword.XKGame.ToString();
//			}
            ScreenLog.Log("start create to server, Password " + Network.incomingPassword);

            //ScreenLog.Log("NetworkServerNet -> current level is " + SceneManager.GetActiveScene().buildIndexName);
            ScreenLog.Log("creat server: info is " + error);
            if (error.ToString() != "NoError")
            {
                bIsLinkServer = true;
            }
        }
        else
        {
            if (!IsActiveClient)
            {
                return;
            }

            string passwordVal = ServerPassword.XKMovie.ToString();
//			if (SceneManager.GetActiveScene().buildIndex > (int)GameLevel.Movie) {
//				passwordVal = ServerPassword.XKGame.ToString();
//			}
            ScreenLog.Log("start connect to server, password " + passwordVal);
            switch (GameTypeCtrl.PlayerPCState)
            {
            case PlayerEnum.PlayerOne:
                Network.Connect(HostServerIP, ClientPortVal, passwordVal);
                break;

            case PlayerEnum.PlayerTwo:
                Network.Connect(ip, ServerPortVal, passwordVal);
                break;
            }
        }
    }
Esempio n. 14
0
 void OnFailedToConnect(NetworkConnectionError _eConnectionError)
 {
     Debug.Log("Failed to join game: " + _eConnectionError.ToString());
 }
Esempio n. 15
0
 /// <summary>
 /// Raised when client fails to connect to the server
 /// </summary>
 void OnFailedToConnect(NetworkConnectionError info)
 {
     chatQueue.Enqueue("[ERROR] OnFailedToConnect -> Could not connect to the server: " + info);
 }
Esempio n. 16
0
 protected void OnFailedToConnectToMaster(NetworkConnectionError error)
 {
     Debug.Log("failed to connect to master " + error);
 }
 void OnFailedToConnect(NetworkConnectionError info)
 {
     CancelInvoke("ConnectTimeout");
     if (lastConnectIP != null)
     {
         Debug.Log("Failed to connect [" + lastConnectIP[0] + ":" + lastConnectPort + " ] info:" + info);
         StartCoroutine(FailedConnectRetry(info));
     }
     else
     {
         Debug.Log("Failed to connect, no data:S " + info);
         connecting = false;
     }
 }
 /// <summary>Called on clients or servers when there is a problem connecting to the MasterServer.</summary>
 public override void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     if (onFailedToConnectToMasterServer != null) onFailedToConnectToMasterServer.OnNext(info);
 }
Esempio n. 19
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     Debug.Log("Could not connect to server!!: " + error);
     local_fail = true;
 }
Esempio n. 20
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     Debug.Log("Could not connect to server: " + error);
     panelInternetRestringido.SetActive(true);
     panelSpinner.SetActive(false);
 }
Esempio n. 21
0
 void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     Debug.Log("Could not connect to master server: " + info);
     panelInternetRestringido.SetActive(true);
     panelSpinner.SetActive(false);
 }
 void m_networkBehaviour_FailedToConnect(NetworkConnectionError obj)
 {
     this.error = obj;
     this.Fire("FailedToConnect");
 }
Esempio n. 23
0
 void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     DebugConsole.Log("Game Server Could not connect to master server: " + info);
 }
Esempio n. 24
0
 void OnFailedToConnectToMasterServer(NetworkConnectionError error)
 {
 }
Esempio n. 25
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
 }
Esempio n. 26
0
 void OnFailedToConnectToMasterServer(NetworkConnectionError error)
 {
     printC(lc.clnt .ToString() + error);
 }
Esempio n. 27
0
 void OnFailedToConnect(NetworkConnectionError e)
 {
     print("X " + e);
 }
 public static void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     Debug.Log("Unable to connect to Master Server! -> " + info);
 }
Esempio n. 29
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     Debug.Log("Could not connect to server: " + error);
     GameState = (int)state.failconnect;
 }
Esempio n. 30
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     // If we can't connect, tell the user why
     errorText.text = "Error: " + error.ToString() + "\n" + errorText.text;
 }
Esempio n. 31
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     ShowPopup("Could not connect to server: " + error);
 }
Esempio n. 32
0
 // Called on clients or servers when there is a problem connecting to the MasterServer (Since v2.0)
 /// <summary>
 /// 当连接主服务器出现问题时在客户端或服务器端调用.
 ///失败原因将作为 NetworkConnectionError 枚举传入.
 /// </summary>
 /// <param name="info"></param>
 public void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     Debug.Log("Could not connect to master server: " + info);
 }
        private void doGetNetworkErrorInfo()
        {
            NetworkConnectionError connectionError = Fsm.EventData.ConnectionError;

            this.errorLabel.Value = connectionError.ToString();
            NetworkConnectionError networkConnectionError = connectionError;

            switch (networkConnectionError)
            {
            case NetworkConnectionError.ConnectionFailed:
                if (this.ConnectionFailedEvent != null)
                {
                    base.Fsm.Event(this.ConnectionFailedEvent);
                }
                return;

            case NetworkConnectionError.AlreadyConnectedToServer:
                if (this.AlreadyConnectedToServerEvent != null)
                {
                    base.Fsm.Event(this.AlreadyConnectedToServerEvent);
                }
                return;

            case (NetworkConnectionError)17:
            case (NetworkConnectionError)19:
            case (NetworkConnectionError)20:
IL_50:
                switch (networkConnectionError + 5)
                {
                case NetworkConnectionError.NoError:
                    if (this.InternalDirectConnectFailedEvent != null)
                    {
                        base.Fsm.Event(this.InternalDirectConnectFailedEvent);
                    }
                    return;

                case (NetworkConnectionError)1:
                    if (this.EmptyConnectTargetEvent != null)
                    {
                        base.Fsm.Event(this.EmptyConnectTargetEvent);
                    }
                    return;

                case (NetworkConnectionError)2:
                    if (this.IncorrectParametersEvent != null)
                    {
                        base.Fsm.Event(this.IncorrectParametersEvent);
                    }
                    return;

                case (NetworkConnectionError)3:
                    if (this.CreateSocketOrThreadFailureEvent != null)
                    {
                        base.Fsm.Event(this.CreateSocketOrThreadFailureEvent);
                    }
                    return;

                case (NetworkConnectionError)4:
                    if (this.AlreadyConnectedToAnotherServerEvent != null)
                    {
                        base.Fsm.Event(this.AlreadyConnectedToAnotherServerEvent);
                    }
                    return;

                case (NetworkConnectionError)5:
                    if (this.NoErrorEvent != null)
                    {
                        base.Fsm.Event(this.NoErrorEvent);
                    }
                    return;

                default:
                    switch (networkConnectionError)
                    {
                    case NetworkConnectionError.NATTargetNotConnected:
                        if (this.NATTargetNotConnectedEvent != null)
                        {
                            base.Fsm.Event(this.NATTargetNotConnectedEvent);
                        }
                        return;

                    case (NetworkConnectionError)70:
                    case (NetworkConnectionError)72:
                        return;

                    case NetworkConnectionError.NATTargetConnectionLost:
                        if (this.NATTargetConnectionLostEvent != null)
                        {
                            base.Fsm.Event(this.NATTargetConnectionLostEvent);
                        }
                        return;

                    case NetworkConnectionError.NATPunchthroughFailed:
                        if (this.NATPunchthroughFailedEvent != null)
                        {
                            base.Fsm.Event(this.NoErrorEvent);
                        }
                        return;

                    default:
                        return;
                    }
                    break;
                }
                break;

            case NetworkConnectionError.TooManyConnectedPlayers:
                if (this.TooManyConnectedPlayersEvent != null)
                {
                    base.Fsm.Event(this.TooManyConnectedPlayersEvent);
                }
                return;

            case NetworkConnectionError.RSAPublicKeyMismatch:
                if (this.RSAPublicKeyMismatchEvent != null)
                {
                    base.Fsm.Event(this.RSAPublicKeyMismatchEvent);
                }
                return;

            case NetworkConnectionError.ConnectionBanned:
                if (this.ConnectionBannedEvent != null)
                {
                    base.Fsm.Event(this.ConnectionBannedEvent);
                }
                return;

            case NetworkConnectionError.InvalidPassword:
                if (this.InvalidPasswordEvent != null)
                {
                    base.Fsm.Event(this.InvalidPasswordEvent);
                }
                return;
            }
            goto IL_50;
        }
Esempio n. 34
0
 // Called on the client when a connection attempt fails for some reason (Since v2.0)
 /// <summary>
 /// 当一个连接因为某些原因失败时在客户端调用。
 ///失败原因将作为 NetworkConnectionError 枚举传入。
 /// </summary>
 /// <param name="error"></param>
 public void OnFailedToConnect(NetworkConnectionError error)
 {
     Debug.Log("Could not connect to server: " + error);
 }
Esempio n. 35
0
 protected void OnFailedToConnect(NetworkConnectionError error)
 {
     Debug.Log("failed to connect " + error);
 }
 /// <summary>Called on the client when a connection attempt fails for some reason.</summary>
 public virtual void OnFailedToConnect(NetworkConnectionError error)
 {
 }
Esempio n. 37
0
 void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     chatQueue.Enqueue("Failed to connect to the master server! (info=" + info + ")");
 }
 /// <summary>Called on clients or servers when there is a problem connecting to the MasterServer.</summary>
 public virtual void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
 }
Esempio n. 39
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     Debug.Log("failed to connect " + error);
     showMultiplayer = true;
     joinGameMessage = "Failed to connect: " + error;
 }
Esempio n. 40
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     printC(lc.clnt.ToString() + error.ToString().Replace("InvalidPassword", lc.gamealreadystarted.ToString()));
 }
Esempio n. 41
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     printC(lc.clnt .ToString() + error.ToString().Replace("InvalidPassword", lc.gald .ToString()));
 }
Esempio n. 42
0
 void OnFailedToConnectToMasterServer(NetworkConnectionError error)
 {
     printC(lc.clnt.ToString() + error);
 }
Esempio n. 43
0
 private void OnFailedToConnect(NetworkConnectionError error)
 {
     Debug.Log("Could not connect to server: " + error);
 }
 void OnFailedToConnect(NetworkConnectionError info)
 {
     windowManager.BringIn("FailToConnectPanel");
 }
Esempio n. 45
0
	void OnFailedToConnect(NetworkConnectionError error) {
		Debug.Log("Could not connect to server: " + error);
		state = GameState.Error;
		errorLog = error.ToString();
		Network.Disconnect();
	}
 void OnFailedToConnect(NetworkConnectionError info)
 {
     Debug.Log ("OnFailedToConnect : "+info);
 }
 void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     Debug.Log("Could not connect to master server: " + info);
 }
 void OnFailedToConnect(NetworkConnectionError error)
 {
     callIfExist(idOnFailedToConnect, error);
 }
 /// <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);
 }
Esempio n. 50
0
 void OnFailedToConnectToMasterServer(NetworkConnectionError error)
 {
     onTrigger.Invoke(gameObject, error);
 }
Esempio n. 51
0
 //Called on client side if the connection failed
 void OnFailedToConnect(NetworkConnectionError error)
 {
     joinMenu.GetComponent<sJoinMenu>().sConnectionErrorMessage = "Could not connect to server: " + error;
     joinMenu.SetActive(true);
     this.gameObject.SetActive(false);
 }
Esempio n. 52
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     callIfExist(idOnFailedToConnect, error);
 }
    //Try again with some different settings..mainly try connecting without NAT
    IEnumerator FailedConnectRetry(NetworkConnectionError info)
    {
        lastConnectionError = info;
        if (!lastConnectMayRetry || info == NetworkConnectionError.TooManyConnectedPlayers || info == NetworkConnectionError.InvalidPassword)
        {
            //Stop retrying
        }
        else if (lastConnectUsedNAT || lastConnectPort != defaultServerPort)
        {
            //Retry (without NAT) on default port!
            yield return 0; //Workaround against "too many open connections"
            DirectConnect(lastConnectIP, MultiplayerFunctionScript.SP.defaultServerPort, lastConnectPW, true, lastConnectionFailDelegate);
            yield break;
        }

        //Finished: failed
        connecting = false;
        if (lastConnectionFailDelegate != null)
        {
            lastConnectionFailDelegate();
        }
    }
Esempio n. 54
0
 void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     callIfExist(idOnFailedToConnectToMasterServer, info);
 }
 void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     //Two possible causes: FetchHostList OR RegisterHost failed to connect
     Debug.LogWarning("OnFailedToConnectToMasterServer: " + info);
     int retryTime = 5 + 5 * msRetries * msRetries; // 5,10,20,50,.. to not overload the masterserver when its down
     if (lastMSRetry < Time.time - retryTime)
     {
         lastMSRetry = Time.time;
         FetchHostList();
     }
 }
 void OnFailedToConnect(NetworkConnectionError error)
 {
     connected = false;
     Debug.Log("Could not connect to server: " + error);
 }
 void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     Debug.Log ("OnFailedToConnectToMasterServer : "+info);
 }
Esempio n. 58
0
 private void OnFailedToConnect(NetworkConnectionError error)
 {
     GameObject.Destroy(this);
 }
 void OnFailedToConnectToMasterServer(NetworkConnectionError info)
 {
     callIfExist(idOnFailedToConnectToMasterServer, info);
 }
Esempio n. 60
0
 void OnFailedToConnect(NetworkConnectionError error)
 {
     ScreenLog.Log("Could not connect to server: " + error);
     CancelInvoke("DelaySetIsLinkServer");
     Invoke("DelaySetIsLinkServer", 2f);
 }