public void Dispose() { try { nitroxEntryPatch.Remove(); } catch (Exception) { // Ignored } gameProcess?.Dispose(); serverProcess?.Dispose(); }
private void MultiplayerButton_Click(object sender, EventArgs e) { string subnauticaPath = ""; if (ErrorConfiguringLaunch(ref subnauticaPath)) { return; } if (PirateDetection.IsPirate(subnauticaPath)) { PirateDetected(); return; } SyncAssembliesBetweenSubnauticaManagedAndLib(subnauticaPath); NitroxEntryPatch nitroxEntryPatch = new NitroxEntryPatch(subnauticaPath); nitroxEntryPatch.Remove(); // Remove any previous instances first. nitroxEntryPatch.Apply(); StartSubnautica(subnauticaPath); //TODO: maybe an async callback to remove when the app closes. }
private void SinglePlayerButton_Click(object sender, EventArgs e) { string subnauticaPath = ""; if (ErrorConfiguringLaunch(ref subnauticaPath)) { return; } if (PirateDetection.IsPirate(subnauticaPath)) { PirateDetected(); return; } SyncAssembliesBetweenSubnauticaManagedAndLib(subnauticaPath); NitroxEntryPatch nitroxEntryPatch = new NitroxEntryPatch(subnauticaPath); nitroxEntryPatch.Remove(); string subnauticaExe = Path.Combine(subnauticaPath, "Subnautica.exe"); Process.Start(subnauticaExe); }
internal void StartMultiplayer() { gameStarting = true; string subnauticaPath = ""; if (ErrorConfiguringLaunch(ref subnauticaPath)) { return; } if (PirateDetection.IsPirate(subnauticaPath)) { if (PirateDetectedEvent != null) { PirateDetectedEvent(this, new EventArgs()); } return; } SyncAssembliesBetweenSubnauticaManagedAndLib(subnauticaPath); NitroxEntryPatch nitroxEntryPatch = new NitroxEntryPatch(subnauticaPath); nitroxEntryPatch.Remove(); // Remove any previous instances first. nitroxEntryPatch.Apply(); StartSubnautica(subnauticaPath); Thread thread = new Thread(new ThreadStart(AsyncGetProcess)); thread.Start(); }
internal void StartSingleplayer() { string subnauticaPath = ""; if (ErrorConfiguringLaunch(ref subnauticaPath)) { return; } if (PirateDetection.IsPirate(subnauticaPath)) { if (PirateDetectedEvent != null) { PirateDetectedEvent(this, new EventArgs()); } return; } SyncAssembliesBetweenSubnauticaManagedAndLib(subnauticaPath); NitroxEntryPatch nitroxEntryPatch = new NitroxEntryPatch(subnauticaPath); nitroxEntryPatch.Remove(); StartSubnautica(subnauticaPath); }
internal void StartMultiplayer() { string subnauticaPath = ""; if (ErrorConfiguringLaunch(ref subnauticaPath)) { return; } if (PirateDetection.IsPirate(subnauticaPath)) { if (PirateDetectedEvent != null) { PirateDetectedEvent(this, new EventArgs()); } return; } SyncAssembliesBetweenSubnauticaManagedAndLib(subnauticaPath); NitroxEntryPatch nitroxEntryPatch = new NitroxEntryPatch(subnauticaPath); nitroxEntryPatch.Remove(); // Remove any previous instances first. nitroxEntryPatch.Apply(); StartSubnautica(subnauticaPath); //TODO: maybe an async callback to remove when the app closes. }
public void Dispose() { Application.Current.MainWindow?.Hide(); try { nitroxEntryPatch.Remove(); } catch (Exception ex) { Log.Error(ex, "Error while disposing the launcher"); } gameProcess?.Dispose(); Server?.Dispose(); LauncherNotifier.Shutdown(); }
public void RemovePatches() { NitroxEntryPatch nitroxPatch = new NitroxEntryPatch(SubnauticaAssembliesPath); if (nitroxPatch.IsApplied) { nitroxPatch.Remove(); } }
private void OnSubnauticaExited(object sender, EventArgs e) { gameStarting = false; string subnauticaPath = ""; Optional <string> installation = GameInstallationFinder.Instance.FindGame(new List <string>()); if (!installation.IsPresent()) { MessageBox.Show("Please configure your Subnautica location in settings.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } subnauticaPath = installation.Get(); NitroxEntryPatch nitroxEntryPatch = new NitroxEntryPatch(subnauticaPath); nitroxEntryPatch.Remove(); Log.Info("Finished removing patches!"); }
public static ActionResult UninstallPatch(Session session) { session.Log("Begin uninstall"); try { string managedDirectory = session.CustomActionData["MANAGEDDIR"]; NitroxEntryPatch nitroxPatch = new NitroxEntryPatch(managedDirectory); if (nitroxPatch.IsApplied) { nitroxPatch.Remove(); } } catch (Exception ex) { session.Log(ex.Message); return(ActionResult.Failure); } return(ActionResult.Success); }