public static void DirectIPConnect(string ip)
 {
     ConsoleWindow.ShowConsoleWindow(true);
     AttachProfilerUI.ms_NotificationMessage = new GUIContent("Connecting to player...(this can take a while)");
     ProfilerDriver.DirectIPConnect(ip);
     AttachProfilerUI.ms_NotificationMessage = null;
 }
 internal static void DirectIPConnect(string ip)
 {
     // Profiler.DirectIPConnect is a blocking call, so a notification message is used to show the progress
     s_NotificationMessage = Content.ConnectingToPlayerMessage;
     ProfilerDriver.DirectIPConnect(ip);
     s_NotificationMessage = null;
     SuccessfullyConnectedToPlayer(ip);
 }
示例#3
0
 public static void DirectIPConnect(string ip)
 {
     // Profiler.DirectIPConnect is a blocking call, so a notification message and the console are used to show progress
     ConsoleWindow.ShowConsoleWindow(true);
     ms_NotificationMessage = EditorGUIUtility.TrTextContent("Connecting to player...(this can take a while)");
     ProfilerDriver.DirectIPConnect(ip);
     ms_NotificationMessage = null;
 }
 internal static void DirectIPConnect(string ip)
 {
     // Profiler.DirectIPConnect is a blocking call, so a notification message and the console are used to show progress
     ConsoleWindow.ShowConsoleWindow(true);
     s_NotificationMessage = Content.ConnectingToPlayerMessage;
     ProfilerDriver.DirectIPConnect(ip);
     s_NotificationMessage = null;
     SuccessfullyConnectedToPlayer(ip);
 }
 internal static void DirectIPConnect(string ip)
 {
     // Profiler.DirectIPConnect is a blocking call, so a notification message is used to show the progress
     if (ProfilerDriver.connectedProfiler == PLAYER_DIRECT_IP_CONNECT_GUID)
     {
         return;
     }
     s_NotificationMessage = Content.ConnectingToPlayerMessage;
     ProfilerDriver.DirectIPConnect(ip);
     s_NotificationMessage = null;
     SuccessfullyConnectedToPlayer(ip);
 }
示例#6
0
    public static void Connect(string ip)
    {
        //if (NetManager.Instance == null)
        //    return;

        ProfilerDriver.connectedProfiler = -1;
        //if (NetManager.Instance.IsConnected)
        //    NetManager.Instance.Disconnect();

        try
        {
            if (!MemUtil.ValidateIPString(ip))
            {
                throw new Exception("Invaild IP");
            }

            //if (!NetManager.Instance.Connect(ip))
            //    throw new Exception("Bad Connect");

            if (!MemUtil.IsLocalhostIP(ip))
            {
                ProfilerDriver.DirectIPConnect(ip);
                if (!MemUtil.IsProfilerConnectedRemotely)
                {
                    throw new Exception("Bad Connect");
                }
            }

            EditorPrefs.SetString(MemPrefs.LastConnectedIP, ip);
        }
        catch (Exception ex)
        {
            EditorWindow.focusedWindow.ShowNotification(new GUIContent(string.Format("Connecting '{0}' failed: {1}", ip, ex.Message)));
            Debug.LogException(ex);

            ProfilerDriver.connectedProfiler = -1;
            //if (NetManager.Instance.IsConnected)
            //    NetManager.Instance.Disconnect();
        }
    }
        public void connectIP(string ip)
        {
            if (!isValidateIPAddress(ip))
            {
                ShowNotification(new GUIContent(string.Format("Invaild IP = {0}!", ip)));
                return;
            }

            if (!NetManager.Instance.Connect(ip))
            {
                ShowNotification(new GUIContent("Connecting failed!)"));
                Debug.LogErrorFormat("Connection failed ip:{0}", ip);
                _isRemoteConnected = false;
                return;
            }

            bool isNative = ip.Equals("127.0.0.1");

            if (!isNative)
            {
                ProfilerDriver.DirectIPConnect(ip);
            }

            if (ProfilerDriver.connectedProfiler == PLAYER_DIRECT_IP_CONNECT_GUID || isNative)
            {
                var content = new GUIContent(string.Format("Connecting {0} Succeeded!", ip));
                ShowNotification(content);
                _isRemoteConnected = true;
            }
            else
            {
                ShowNotification(new GUIContent("Connecting failed!)"));
                Debug.LogErrorFormat("Connection failed ip:{0}", ip);
                _isRemoteConnected = false;
                if (NetManager.Instance.IsConnected)
                {
                    NetManager.Instance.Disconnect();
                }
            }
        }
 public void connectIP(string ip)
 {
     if (!isValidateIPAddress(ip))
     {
         ShowNotification(new GUIContent(string.Format("Invaild IP = {0}!", ip)));
         return;
     }
     ProfilerDriver.DirectIPConnect(ip);
     if (ProfilerDriver.connectedProfiler == PLAYER_DIRECT_IP_CONNECT_GUID)
     {
         var content = new GUIContent(string.Format("Connecting {0} Succeeded!", ip));
         ShowNotification(content);
         _isRemoteConnected = true;
     }
     else
     {
         var content = new GUIContent("Connecting failed!)");
         ShowNotification(content);
         Debug.LogErrorFormat("Connection failed ip:{0}", ip);
         _isRemoteConnected = false;
     }
 }