예제 #1
0
    string GetNetworkError(NetworkConnectionError error)
    {
        Debug.Log(error);
        preventInputPanel.SetActive(error.Equals(NetworkConnectionError.NoError));
        switch (error)
        {
        case NetworkConnectionError.NoError:
            return("Connecting..");

        case NetworkConnectionError.AlreadyConnectedToServer:
        case NetworkConnectionError.AlreadyConnectedToAnotherServer:
            return(retryError);

        case NetworkConnectionError.ConnectionBanned:
            return("Banned from server");

        case NetworkConnectionError.InvalidPassword:
            return("Incorrect password");

        case NetworkConnectionError.TooManyConnectedPlayers:
            return("Server is full");

        case NetworkConnectionError.EmptyConnectTarget:
            return("Please enter target server");

        case NetworkConnectionError.NATPunchthroughFailed:
        case NetworkConnectionError.NATTargetConnectionLost:
        case NetworkConnectionError.NATTargetNotConnected:
        case NetworkConnectionError.InternalDirectConnectFailed:
            return("Nat error");

        default:
            return("Failed to connect");
        }
    }