Ejemplo n.º 1
0
        /// <summary>
        /// Connects to target.
        /// If platform doesn't require connection, just return true.
        /// IMPORTANT:
        /// Since NetCheat connects and attaches a few times after the user does (Constant write thread, searching, ect)
        /// You must have it automatically use the settings that the user input, instead of asking again
        /// This can be reset on Disconnect()
        /// </summary>
        public bool Connect()
        {
            //attached = false;
            if (PS4.IsConnected)
            {
                return(true);
            }
            string ip = string.Empty;

            using (Connect connectForm = new Connect())
            {
                try
                {
                    if (String.IsNullOrEmpty(Properties.Settings.Default.ip))
                    {
                        connectForm.ipBox.Text = "192.168.1.3";
                    }
                    else
                    {
                        connectForm.ipBox.Text = Properties.Settings.Default.ip;
                    }
                    connectForm.cnct.Click += (o, e) => { connectForm.Close(); connectForm.DialogResult = DialogResult.OK; };
                    connectForm.ShowDialog();
                    Properties.Settings.Default.ip = connectForm.ipBox.Text;
                    Properties.Settings.Default.Save();
                    if (connectForm.DialogResult != DialogResult.OK)
                    {
                        return(false);
                    }
                    ip  = connectForm.ipBox.Text;
                    PS4 = new PS4RPC(ip);
                    PS4.Connect();
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
        }
Ejemplo n.º 2
0
 public API()
 {
     PS4 = new PS4RPC();
 }