Ejemplo n.º 1
0
        private void ExecuteGame(string args = "")
        {
            if (MainController.Get().Configuration == null)
            {
                return;
            }
            if (Process.GetProcessesByName("Witcher3").Length != 0)
            {
                CommonUIFunctions.SendNotification("Game is already running!");
                return;
            }
            var config = MainController.Get().Configuration;
            var proc   = new ProcessStartInfo(config.ExecutablePath)
            {
                Arguments              = args == "" ? "-net -debugscripts" : args,
                UseShellExecute        = false,
                RedirectStandardOutput = true
            };

            AddOutput("Executing " + proc.FileName + " " + proc.Arguments + "\n");

            var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            var scriptlog = Path.Combine(documents, @"The Witcher 3\scriptslog.txt");

            if (File.Exists(scriptlog))
            {
                File.Delete(scriptlog);
            }
            Process.Start(proc);
        }
Ejemplo n.º 2
0
 private void connectButton_Click(object sender, EventArgs e)
 {
     if (GameSocket.Connected)
     {
         CommonUIFunctions.SendNotification("Already connected!");
     }
     else
     {
         Connect(DebugProtoclAdress, GameSocket);
         if (GameSocket.Connected)
         {
             statusLabel.Text = "Status: Connected";
             CommonUIFunctions.SendNotification("Connected!");
             DataRecieveWorker.RunWorkerAsync();
         }
         else
         {
             statusLabel.Text = "Status: Error";
             CommonUIFunctions.SendNotification("Failed to connect!");
         }
     }
 }