Beispiel #1
0
        private void MultiplayerButton_Click(object sender, EventArgs e)
        {
            string subnauticaPath = "";

            if (ErrorConfiguringLaunch(ref subnauticaPath))
            {
                return;
            }

            SyncAssembliesBetweenSubnauticaManagedAndLib(subnauticaPath);

            NitroxEntryPatch nitroxEntryPatch = new NitroxEntryPatch(subnauticaPath);

            nitroxEntryPatch.Apply();

            string subnauticaExe = Path.Combine(subnauticaPath, "Subnautica.exe");

            Process.Start(subnauticaExe, "-EpicPortal");

            //TODO: maybe an async callback to remove when the app closes.
        }
Beispiel #2
0
        internal void StartMultiplayer()
        {
            string subnauticaPath = "";

            if (ErrorConfiguringLaunch(ref subnauticaPath))
            {
                return;
            }

            if (PirateDetection.IsPirate(subnauticaPath))
            {
                if (PirateDetectedEvent != null)
                {
                    PirateDetectedEvent(this, new EventArgs());
                }
                return;
            }

            try
            {
                gameStarting = true;

                SyncAssetBundles(subnauticaPath);
                SyncMonoAssemblies(subnauticaPath);
                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();
            }
            catch (Exception ex)
            {
                gameStarting = false;
                MessageBox.Show(ex.ToString());
            }
        }