Exemplo n.º 1
0
        public static Guid HugeOperationStart(string targetAggressiveness = "DISABLED")
        {
            RTC_RPC.SendToKillSwitch("FREEZE");

            if (RTC_Core.isStandalone)
            {
                if (lastNetCoreAggressivity == null)
                {
                    lastNetCoreAggressivity = RTC_Core.sForm.cbNetCoreCommandTimeout.SelectedIndex;
                }

                if (targetAggressiveness == "DISABLED")
                {
                    RTC_Core.sForm.cbNetCoreCommandTimeout.SelectedIndex = RTC_Core.sForm.cbNetCoreCommandTimeout.Items.Count - 1;
                }
                else
                {
                    RTC_Core.sForm.cbNetCoreCommandTimeout.SelectedIndex = RTC_Core.sForm.cbNetCoreCommandTimeout.Items.Count - 2;
                }
            }

            var token = Guid.NewGuid();

            if (lastNetCoreAggressivityGuid == null)
            {
                lastNetCoreAggressivityGuid = token;
            }

            return(token);
        }
Exemplo n.º 2
0
        public static void Start()
        {
            bool     Expires      = false;
            DateTime ExpiringDate = DateTime.Parse("2015-01-02");

            if (Expires && DateTime.Now > ExpiringDate)
            {
                RTC_RPC.SendToKillSwitch("CLOSE");
                MessageBox.Show("This version has expired");
                GlobalWin.MainForm.Close();
                RTC_Core.coreForm.Close();
                RTC_Core.ghForm.Close();
                RTC_Core.tfForm.Close();
                Application.Exit();
                return;
            }


            //Populating the Params Menu
            ParamsButtonMenu.Items.Add("Reset RTC Parameters", null, new EventHandler(coreForm.btnReboot_Click));
            ParamsButtonMenu.Items.Add("Reset RTC Parameters + Window Parameters", null, new EventHandler(coreForm.btnRebootWindow_Click));
            ParamsButtonMenu.Items.Add("Start AutoKillSwitch", null, new EventHandler(coreForm.btnAutoKillSwitch_Click));
            ParamsButtonMenu.Items.Add("RTC Factory Clean", null, new EventHandler(coreForm.btnFactoryClean_Click));

            //Populating the Easy Mode Menu
            EasyButtonMenu.Items.Add("Start with current settings", null, new EventHandler(coreForm.btnEasyModeCurrent_Click));
            EasyButtonMenu.Items.Add("Start with system template", null, new EventHandler(coreForm.btnEasyModeTemplate_Click));


            coreForm.Show();
            GlobalWin.MainForm.Focus();

            RTC_RPC.Start();
        }
Exemplo n.º 3
0
        private void btnCloudSave_Click(object sender, EventArgs e)
        {
            RTC_RPC.SendToKillSwitch("FREEZE");

            BlastLayer bl;
            StashKey   key;

            if (lbStashHistory.SelectedIndex != -1)
            {
                key = (lbStashHistory.SelectedItem as StashKey);
            }
            else if (lbStockpile.SelectedIndex != -1)
            {
                key = (lbStockpile.SelectedItem as StashKey);
            }
            else
            {
                return;
            }


            bl      = key.blastlayer;
            bl.CCGD = new CorruptCloudGameData(key);

            tbCorruptCloudCode.Text = RTC_CorruptCloud.CloudSave(bl);

            RTC_RPC.SendToKillSwitch("UNFREEZE");
        }
Exemplo n.º 4
0
        public static void Start()
        {
            Running = true;


            time          = new System.Windows.Forms.Timer();
            time.Interval = 200;
            time.Tick    += new EventHandler(CheckMessages);
            time.Start();

            if (RTC_Hooks.isRemoteRTC)
            {
                RTC_RPC.SendToKillSwitch("UNFREEZE");
            }
            else
            {
                bridgeThread = new Thread(new ThreadStart(ListenToBridge));
                bridgeThread.IsBackground = true;
                bridgeThread.Start();

                pluginThread = new Thread(new ThreadStart(ListenToPlugin));
                pluginThread.IsBackground = true;
                pluginThread.Start();
            }
        }
Exemplo n.º 5
0
 private void btnActiveTableQuickSave_Click(object sender, EventArgs e)
 {
     if (btnActiveTableQuickSave.ForeColor != Color.Silver)
     {
         RTC_RPC.SendToKillSwitch("FREEZE");
         RTC_FreezeEngine.SaveActiveTable(true);
         RTC_RPC.SendToKillSwitch("UNFREEZE");
     }
 }
Exemplo n.º 6
0
        private void btnSaveStockpile_Click(object sender, EventArgs e)
        {
            GlobalWin.Sound.StopSound();
            RTC_RPC.SendToKillSwitch("FREEZE");
            Stockpile sks = new Stockpile(lbStockpile);

            Stockpile.Save(sks, true);
            RTC_RPC.SendToKillSwitch("UNFREEZE");
            GlobalWin.Sound.StartSound();
        }
Exemplo n.º 7
0
        public static void EMU_CRASH(string msg)
        {
            if (DisableRTC)
            {
                return;
            }

            RTC_RPC.Stop();
            MessageBox.Show("SORRY EMULATOR CRASHED\n\n" + msg);
        }
Exemplo n.º 8
0
        private void btnActiveTableSubstractFile_Click(object sender, EventArgs e)
        {
            if (!RTC_FreezeEngine.FirstInit)
            {
                return;
            }

            RTC_RPC.SendToKillSwitch("FREEZE");
            RTC_FreezeEngine.SubstractActiveTable();
            RTC_RPC.SendToKillSwitch("UNFREEZE");
        }
Exemplo n.º 9
0
        private void btnActiveTableAddDump_Click(object sender, EventArgs e)
        {
            if (!RTC_FreezeEngine.FirstInit)
            {
                return;
            }

            RTC_RPC.SendToKillSwitch("FREEZE");
            RTC_FreezeEngine.AddDump();
            RTC_RPC.SendToKillSwitch("UNFREEZE");
        }
Exemplo n.º 10
0
        private void btnActiveTableSaveAs_Click(object sender, EventArgs e)
        {
            if (!RTC_FreezeEngine.ActiveTableReady)
            {
                return;
            }

            RTC_RPC.SendToKillSwitch("FREEZE");
            RTC_FreezeEngine.SaveActiveTable(false);
            RTC_RPC.SendToKillSwitch("UNFREEZE");
        }
Exemplo n.º 11
0
        public static void HugeOperationReset()
        {
            RTC_RPC.SendToKillSwitch("UNFREEZE");

            if (RTC_Core.isStandalone)
            {
                RTC_Core.sForm.cbNetCoreCommandTimeout.SelectedIndex = 0;
                lastNetCoreAggressivity     = null;
                lastNetCoreAggressivityGuid = null;
            }
        }
Exemplo n.º 12
0
        private void AutoKillSwitch_Load(object sender, EventArgs e)
        {
            cbDetection.SelectedIndex = 0;

            t          = new Timer();
            t.Interval = 300;
            t.Tick    += new EventHandler(CheckHeartbeat);
            t.Start();

            RTC_RPC.Start();
        }
Exemplo n.º 13
0
        public static void LOAD_GAME_DONE()
        {
            if (DisableRTC)
            {
                return;
            }

            //RTC_HellgenieEngine.ClearCheats();
            //RTC_PipeEngine.ClearPipes();

            //Glitch Harvester warning for archives

            string uppercaseFilename = GlobalWin.MainForm.CurrentlyOpenRom.ToUpper();

            if (RTC_Core.ghForm.Visible && (uppercaseFilename.Contains(".ZIP") || uppercaseFilename.Contains(".7Z")))
            {
                MessageBox.Show($"The rom {RTC_Extensions.getShortFilenameFromPath(uppercaseFilename)} is in an archive and can't be added to a Stockpile");
            }

            //Load Game vars into RTC_Core
            PathEntry pathEntry = Global.Config.PathEntries[Global.Game.System, "Savestates"] ??
                                  Global.Config.PathEntries[Global.Game.System, "Base"];

            RTC_StockpileManager.currentGameSystem = RTC_Core.EmuFolderCheck(pathEntry.SystemDisplayName);
            RTC_StockpileManager.currentGameName   = PathManager.FilesystemSafeName(Global.Game);
            RTC_Core.lastOpenRom = GlobalWin.MainForm.CurrentlyOpenRom;
            RTC_RPC.RefreshPlugin();


            //prepare memory domains in advance on bizhawk side
            RTC_MemoryDomains.RefreshDomains(false);


            if (RTC_StockpileManager.currentGameName != lastGameName)
            {
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_EVENT_LOADGAMEDONE_NEWGAME));
            }
            else
            {
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_EVENT_LOADGAMEDONE_SAMEGAME));
            }



            lastGameName = RTC_StockpileManager.currentGameName;

            //RTC_Restore.SaveRestore();

            RTC_NetCore.HugeOperationEnd();
        }
Exemplo n.º 14
0
        private void btnLoadStockpile_Click(object sender, EventArgs e)
        {
            try
            {
                GlobalWin.Sound.StopSound();
                RTC_RPC.SendToKillSwitch("FREEZE");
                Stockpile.Load();
            }
            finally
            {
                RTC_RPC.SendToKillSwitch("UNFREEZE");
                GlobalWin.Sound.StartSound();
            }

            RTC_Restore.SaveRestore();
        }
Exemplo n.º 15
0
        public static void MAINFORM_CLOSING()
        {
            RTC_Core.lastOpenRom = null;

            RTC_Core.AutoCorrupt = false;
            RTC_Core.coreForm.cbUseTimeStack.Checked = false;
            RTC_TimeFlow.Stop();

            RTC_Restore.SaveRestore();
            RTC_RPC.SendToKillSwitch("CLOSE");

            ForceCloseTimer          = new Timer();
            ForceCloseTimer.Interval = 5000;
            ForceCloseTimer.Tick    += new EventHandler(ForceCloseTimer_Tick);
            ForceCloseTimer.Start();
        }
Exemplo n.º 16
0
        public static void HugeOperationEnd(Guid?operationGuid = null)
        {
            RTC_RPC.SendToKillSwitch("UNFREEZE");

            if (RTC_Core.isStandalone)
            {
                if (operationGuid != null && operationGuid != lastNetCoreAggressivityGuid)
                {
                    return;
                }

                if (lastNetCoreAggressivity != null)
                {
                    RTC_Core.sForm.cbNetCoreCommandTimeout.SelectedIndex = (int)lastNetCoreAggressivity;
                    lastNetCoreAggressivity     = null;
                    lastNetCoreAggressivityGuid = null;
                }
            }
        }
Exemplo n.º 17
0
        private void btnSaveStockpileAs_Click(object sender, EventArgs e)
        {
            if (lbStockpile.Items.Count == 0)
            {
                GlobalWin.Sound.StopSound();
                MessageBox.Show("You cannot save the Stockpile because it is empty");
                GlobalWin.Sound.StartSound();
                return;
            }

            GlobalWin.Sound.StopSound();
            RTC_RPC.SendToKillSwitch("FREEZE");
            Stockpile sks = new Stockpile(lbStockpile);

            Stockpile.Save(sks);
            RTC_RPC.SendToKillSwitch("UNFREEZE");
            GlobalWin.Sound.StartSound();

            RTC_Restore.SaveRestore();
        }
Exemplo n.º 18
0
        public static void LOAD_GAME_DONE()
        {
            if (!RTC_Core.isLoaded)
            {
                return;
            }

            if (RTC_Core.currentGameName == lastGameName)
            {
                RTC_MemoryZones.RefreshAndKeepDomains();
            }

            RTC_HellgenieEngine.ClearCheats();


            //Load Game vars into RTC_Core
            PathEntry pathEntry = Global.Config.PathEntries[Global.Game.System, "Savestates"] ??
                                  Global.Config.PathEntries[Global.Game.System, "Base"];

            RTC_Core.currentGameSystem = RTC_Core.EmuFolderCheck(pathEntry.SystemDisplayName);
            RTC_Core.currentGameName   = PathManager.FilesystemSafeName(Global.Game);
            RTC_Core.lastOpenRom       = GlobalWin.MainForm.CurrentlyOpenRom;
            RTC_RPC.RefreshPlugin();

            if (RTC_Core.currentGameName != lastGameName)
            {
                RTC_TimeStack.Reset();
                RTC_MemoryZones.AutoSelectDomains();
            }

            if (RTC_MemoryZones.pendingSelectedDomains != null)
            {
                RTC_MemoryZones.setSelectedDomains(RTC_MemoryZones.pendingSelectedDomains);
                RTC_MemoryZones.pendingSelectedDomains = null;
            }
            lastGameName = RTC_Core.currentGameName;

            //RTC_Restore.SaveRestore();

            RTC_RPC.SendToKillSwitch("UNFREEZE");
        }
Exemplo n.º 19
0
        private static void initFullMap()
        {
            RTC_RPC.SendToKillSwitch("FREEZE");
            GlobalWin.Sound.StopSound();

            new Thread(() =>
            {
                Bitmap newMap = new Bitmap(204800, RTC_Core.tfForm.pbFullMap.Height);


                for (int x = 0; x < newMap.Width; x++)
                {
                    if (x % 30 == 0)
                    {
                        for (int y = 0; y < newMap.Height; y++)
                        {
                            SafeSetPixel(newMap, x, y, Color.FromArgb(32, 32, 32));
                        }
                    }
                }


                FullMap = newMap;

                Running = true;
            }
                       ).Start();


            timeGame     = 0;
            LastTimeGame = 0;
            State        = TimeState.Forward;

            TimeFlowGame.Clear();
            UniverseFlow.Clear();
            UniverseLayer.Clear();

            GlobalWin.Sound.StartSound();
            RTC_RPC.SendToKillSwitch("UNFREEZE");
        }
Exemplo n.º 20
0
        public static bool HOTKEY_CHECK(string trigger)
        {// You can go to the injected Hotkey Hijack by searching #HotkeyHijack
            if (DisableRTC)
            {
                return(false);
            }

            if (watch != null)
            {
                long elapsedMs = watch.ElapsedMilliseconds;
                if (elapsedMs > 3000)
                {
                    watch.Stop();
                    watch = null;
                }
            }

            switch (trigger)
            {
            default:
                return(false);

            case "Manual Blast":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_MANUALBLAST));
                break;

            case "Auto-Corrupt":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_AUTOCORRUPTTOGGLE));
                break;

            case "Error Delay--":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_ERRORDELAYDECREASE));
                break;

            case "Error Delay++":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_ERRORDELAYINCREASE));
                break;

            case "Intensity--":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_INTENSITYDECREASE));
                break;

            case "Intensity++":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_INTENSITYINCREASE));
                break;

            case "GH Load and Corrupt":
                watch = System.Diagnostics.Stopwatch.StartNew();
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_GHLOADCORRUPT));
                break;

            case "GH Just Corrupt":
                watch = System.Diagnostics.Stopwatch.StartNew();
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_GHCORRUPT));
                break;

            case "GH Load":
                watch = System.Diagnostics.Stopwatch.StartNew();
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_GHLOAD));
                break;

            case "GH Save":
                watch = System.Diagnostics.Stopwatch.StartNew();
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_GHSAVE));
                break;

            case "Stash->Stockpile":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_GHSTASHTOSTOCKPILE));
                break;

            case "Induce KS Crash":
                RTC_RPC.Stop();
                break;

            case "Blast+RawStash":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_BLASTRAWSTASH));
                break;

            case "Send Raw to Stash":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_SENDRAWSTASH));
                break;

            case "BlastLayer Toggle":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_BLASTLAYERTOGGLE));
                break;

            case "BlastLayer Re-Blast":
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.REMOTE_HOTKEY_BLASTLAYERREBLAST));
                break;
            }
            return(true);
        }
Exemplo n.º 21
0
        public static bool HOTKEY_CHECK(string trigger)
        {// You can go to the injected Hotkey Hijack by searching #HotkeyHijack
            switch (trigger)
            {
            default:
                return(false);

            case "Manual Blast":
                RTC_Core.coreForm.btnManualBlast_Click(null, null);
                break;

            case "Start/Stop AutoCorrupt":
                RTC_Core.coreForm.btnAutoCorrupt_Click(null, null);
                break;

            case "Error Delay--":
                if (RTC_Core.coreForm.track_ErrorDelay.Value > 1)
                {
                    RTC_Core.coreForm.track_ErrorDelay.Value--;
                    RTC_Core.coreForm.track_ErrorDelay_Scroll(null, null);
                }
                break;

            case "Error Delay++":
                if (RTC_Core.coreForm.track_ErrorDelay.Value < RTC_Core.coreForm.track_ErrorDelay.Maximum)
                {
                    RTC_Core.coreForm.track_ErrorDelay.Value++;
                    RTC_Core.coreForm.track_ErrorDelay_Scroll(null, null);
                }
                break;

            case "Intensity--":
                if (RTC_Core.coreForm.track_Intensity.Value > 1)
                {
                    RTC_Core.coreForm.track_Intensity.Value--;
                    RTC_Core.coreForm.track_Intensity_Scroll(null, null);
                }
                break;

            case "Intensity++":
                if (RTC_Core.coreForm.track_Intensity.Value < RTC_Core.coreForm.track_Intensity.Maximum)
                {
                    RTC_Core.coreForm.track_Intensity.Value++;
                    RTC_Core.coreForm.track_Intensity_Scroll(null, null);
                }
                break;

            case "GH Load and Corrupt":
                RTC_Core.ghForm.cbAutoLoadState.Checked = true;
                RTC_Core.ghForm.btnCorrupt_Click(null, null);
                break;

            case "GH Corrupt w/o Load":
                bool isload = RTC_Core.ghForm.cbAutoLoadState.Checked;
                RTC_Core.ghForm.cbAutoLoadState.Checked = false;
                RTC_Core.ghForm.btnCorrupt_Click(null, null);
                RTC_Core.ghForm.cbAutoLoadState.Checked = isload;
                break;

            case "GH Load":
                RTC_Core.ghForm.btnSaveLoad.Text = "LOAD";
                RTC_Core.ghForm.btnSaveLoad_Click(null, null);
                break;

            case "GH Save":
                RTC_Core.ghForm.btnSaveLoad.Text = "SAVE";
                RTC_Core.ghForm.btnSaveLoad_Click(null, null);
                break;

            case "Reset TimeStack":
                RTC_TimeStack.Reset();
                break;

            case "TimeStack Jump":
                RTC_TimeStack.Jump();
                break;

            case "Induce KS Crash":
                RTC_RPC.Stop();
                break;

            case "Send Raw to Stash":
                RTC_Core.ghForm.btnSendRaw_Click(null, null);
                break;

            case "Blast Toggle":
                RTC_Core.ghForm.btnBlastToggle_Click(null, null);
                break;
            }
            return(true);
        }
Exemplo n.º 22
0
 public static void EMU_CRASH(string msg)
 {
     RTC_RPC.Stop();
     MessageBox.Show("SORRY EMULATOR CRASHED\n\n" + msg);
 }
Exemplo n.º 23
0
 public static void LOAD_GAME_FAILED()
 {
     RTC_RPC.SendToKillSwitch("UNFREEZE");
 }
Exemplo n.º 24
0
        private void btnCloudCorrupt_Click(object sender, EventArgs e)
        {
            if (!IsValidCCC())
            {
                GlobalWin.Sound.StopSound();
                MessageBox.Show("The CorruptCloud Code entered below isn't valid");
                GlobalWin.Sound.StartSound();
                return;
            }



            GlobalWin.Sound.StopSound();
            RTC_RPC.SendToKillSwitch("FREEZE");


            BlastLayer bl = RTC_CorruptCloud.CloudLoad(tbCorruptCloudCode.Text);

            if (!bl.CCGD.CheckCompatibility())
            {
                GlobalWin.Sound.StartSound();
                RTC_RPC.SendToKillSwitch("UNFREEZE");
                return;
            }

            if (cbAutoLoadState.Checked)
            {
                bl.CCGD.PutBackSavestate();
                LoadState(bl.CCGD.originalKey, bl.CCGD.originalGameSystem, bl.CCGD.originalGameName);
            }

            if (bl != null)
            {
                bl.Apply();
            }
            else
            {
                return;
            }


            if (bl != null)
            {
                IsCorruptionApplied = true;
            }

            if (cbStashCorrupted.Checked)
            {
                RTC_Core.currentStashkey = new StashKey(RTC_Core.GetRandomKey(), bl.CCGD.originalKey, bl);

                DontLoadSelectedStash = true;
                lbStashHistory.Items.Add(RTC_Core.currentStashkey);
                lbStashHistory.SelectedIndex = lbStashHistory.Items.Count - 1;
                lbStockpile.ClearSelected();
            }

            if (cbRenderAtCorrupt.Checked)
            {
                StartRender();
            }

            RTC_RPC.SendToKillSwitch("UNFREEZE");
            GlobalWin.Sound.StartSound();
        }
Exemplo n.º 25
0
        private void btnCloudInject_Click(object sender, EventArgs e)
        {
            if (!IsValidCCC())
            {
                GlobalWin.Sound.StopSound();
                MessageBox.Show("The CorruptCloud Code entered below isn't valid");
                GlobalWin.Sound.StartSound();
                return;
            }
            GlobalWin.Sound.StopSound();
            RTC_RPC.SendToKillSwitch("FREEZE");

            BlastLayer bl = RTC_CorruptCloud.CloudLoad(tbCorruptCloudCode.Text);

            if (!bl.CCGD.CheckCompatibility())
            {
                GlobalWin.Sound.StartSound();
                return;
            }

            if (cbAutoLoadState.Checked)
            {
                if (btnParentKeys[Convert.ToInt32(currentSelectedState)] != null)
                {
                    LoadState();
                }
                else
                {
                    GlobalWin.Sound.StopSound();
                    MessageBox.Show("There is no SaveState in the selected box,\nPress 'Switch: Save/Load State' then Press 'SAVE'");
                    GlobalWin.Sound.StartSound();
                    RTC_RPC.SendToKillSwitch("UNFREEZE");
                    return;
                }
            }


            if (bl != null)
            {
                bl.Apply();
            }
            else
            {
                GlobalWin.Sound.StartSound();
                return;
            }

            if (bl != null)
            {
                IsCorruptionApplied = true;
            }


            if (cbStashInjected.Checked)
            {
                RTC_Core.currentStashkey = new StashKey(RTC_Core.GetRandomKey(), btnParentKeys[Convert.ToInt32(currentSelectedState)], bl);


                DontLoadSelectedStash = true;
                lbStashHistory.Items.Add(RTC_Core.currentStashkey);
                lbStashHistory.SelectedIndex = lbStashHistory.Items.Count - 1;
                lbStockpile.ClearSelected();
            }

            if (cbRenderAtCorrupt.Checked)
            {
                StartRender();
            }

            GlobalWin.Sound.StartSound();
            RTC_RPC.SendToKillSwitch("UNFREEZE");
        }
Exemplo n.º 26
0
        //This is the entry point of RTC. Without this method, nothing will load.
        public static void Start(Form _standaloneForm = null)
        {
            //Timed releases. Only for exceptionnal cases.
            bool     Expires      = false;
            DateTime ExpiringDate = DateTime.Parse("2017-03-03");

            if (Expires && DateTime.Now > ExpiringDate)
            {
                RTC_RPC.SendToKillSwitch("CLOSE");
                MessageBox.Show("This version has expired");
                GlobalWin.MainForm.Close();
                RTC_Core.coreForm.Close();
                RTC_Core.ghForm.Close();
                Application.Exit();
                return;
            }

            coreForm = new RTC_Core_Form();
            ecForm   = new RTC_EngineConfig_Form();
            spForm   = new RTC_StockpilePlayer_Form();
            ghForm   = new RTC_GlitchHarvester_Form();
            sForm    = new RTC_Settings_Form();

            multiForm           = new RTC_Multiplayer_Form();
            multipeerpopoutForm = new RTC_MultiPeerPopout_Form();
            sbForm      = new RTC_StockpileBlastBoard_Form();
            beForm      = new RTC_BlastEditor_Form();
            vmdPoolForm = new RTC_VmdPool_Form();
            vmdGenForm  = new RTC_VmdGen_Form();
            vmdActForm  = new RTC_VmdAct_Form();

            standaloneForm = _standaloneForm;


            if (!Directory.Exists(RTC_Core.rtcDir + "\\TEMP\\"))
            {
                Directory.CreateDirectory(RTC_Core.rtcDir + "\\TEMP\\");
            }

            if (!Directory.Exists(RTC_Core.rtcDir + "\\TEMP2\\"))
            {
                Directory.CreateDirectory(RTC_Core.rtcDir + "\\TEMP2\\");
            }

            if (!Directory.Exists(RTC_Core.rtcDir + "\\TEMP3\\"))
            {
                Directory.CreateDirectory(RTC_Core.rtcDir + "\\TEMP3\\");
            }

            if (!Directory.Exists(RTC_Core.rtcDir + "\\TEMP4\\"))
            {
                Directory.CreateDirectory(RTC_Core.rtcDir + "\\TEMP4\\");
            }


            //Loading RTC PArams
            RTC_Params.LoadRTCColor();
            RTC_Core.sForm.cbDisableBizhawkOSD.Checked        = !RTC_Params.IsParamSet("ENABLE_BIZHAWK_OSD");
            RTC_Core.sForm.cbAllowCrossCoreCorruption.Checked = RTC_Params.IsParamSet("ALLOW_CROSS_CORE_CORRUPTION");

            //Initiation of loopback TCP, only in DETACHED MODE
            if (RTC_Hooks.isRemoteRTC || RTC_Core.isStandalone)
            {
                RemoteRTC         = new RTC_NetCore();
                RemoteRTC.port    = 42042;
                RemoteRTC.address = "";
            }

            //Initialize RemoteRTC server
            if (RTC_Hooks.isRemoteRTC && !RTC_Core.isStandalone)
            {
                //Bizhawk has started in REMOTERTC mode, no RTC form will be loaded
                RemoteRTC.StartNetworking(NetworkSide.CLIENT, true);
                RemoteRTC.SendCommand(new RTC_Command(CommandType.REMOTE_EVENT_BIZHAWKSTARTED), false, true);
            }
            else
            {
                //Setup of Detached-exclusive features
                if (RTC_Core.isStandalone)
                {
                    coreForm.Text = "RTC : Detached Mode";

                    if (csForm == null)
                    {
                        csForm = new RTC_ConnectionStatus_Form();
                    }

                    RTC_Core.coreForm.showPanelForm(csForm);

                    RemoteRTC.ServerStarted += new EventHandler((ob, ev) =>
                    {
                        RemoteRTC_SupposedToBeConnected = false;
                        Console.WriteLine("RemoteRTC.ServerStarted");


                        if (csForm != null && !csForm.IsDisposed)
                        {
                            if (RTC_Core.csForm == null)
                            {
                                csForm = new RTC_ConnectionStatus_Form();
                            }

                            RTC_Core.coreForm.showPanelForm(csForm);
                        }

                        if (ghForm != null && !ghForm.IsDisposed)
                        {
                            ghForm.pnHideGlitchHarvester.BringToFront();
                            ghForm.pnHideGlitchHarvester.Show();
                        }
                    });

                    RemoteRTC.ServerConnected += new EventHandler((ob, ev) =>
                    {
                        RemoteRTC_SupposedToBeConnected = true;
                        Console.WriteLine("RemoteRTC.ServerConnected");
                        csForm.lbConnectionStatus.Text = "Connection status: Connected";

                        if (FirstConnection)
                        {
                            FirstConnection = false;
                            coreForm.btnEngineConfig_Click(ob, ev);
                        }
                        else
                        {
                            coreForm.showPanelForm(coreForm.previousForm, false);
                        }

                        ghForm.pnHideGlitchHarvester.Hide();
                        csForm.btnStartEmuhawkDetached.Text = "Restart BizHawk";

                        RTC_RPC.Heartbeat = true;
                        RTC_RPC.Freeze    = false;
                    });


                    RemoteRTC.ServerConnectionLost += new EventHandler((ob, ev) =>
                    {
                        RemoteRTC_SupposedToBeConnected = false;
                        Console.WriteLine("RemoteRTC.ServerConnectionLost");


                        if (csForm != null && !csForm.IsDisposed)
                        {
                            csForm.lbConnectionStatus.Text = "Connection status: Bizhawk timed out";
                            coreForm.showPanelForm(csForm);
                        }

                        if (ghForm != null && !ghForm.IsDisposed)
                        {
                            ghForm.lbConnectionStatus.Text = "Connection status: Bizhawk timed out";
                            ghForm.pnHideGlitchHarvester.BringToFront();
                            ghForm.pnHideGlitchHarvester.Show();
                        }

                        RTC_GameProtection.Stop();
                    });

                    RemoteRTC.ServerDisconnected += new EventHandler((ob, ev) =>
                    {
                        RemoteRTC_SupposedToBeConnected = false;
                        Console.WriteLine("RemoteRTC.ServerDisconnected");
                        csForm.lbConnectionStatus.Text = "Connection status: NetCore Shutdown";
                        ghForm.lbConnectionStatus.Text = "Connection status: NetCore Shutdown";
                        coreForm.showPanelForm(csForm);

                        ghForm.pnHideGlitchHarvester.BringToFront();
                        ghForm.pnHideGlitchHarvester.Show();

                        RTC_GameProtection.Stop();
                    });

                    RemoteRTC.StartNetworking(NetworkSide.SERVER, false, false);
                }
                else if (RTC_Hooks.isRemoteRTC)
                {                 //WILL THIS EVER HAPPEN? TO BE REMOVED IF NOT
                    RemoteRTC.StartNetworking(NetworkSide.SERVER, false, true);
                }

                // Show the main RTC Form
                coreForm.Show();
            }

            //Starting UDP loopback for Killswitch and External Rom Plugins
            RTC_RPC.Start();


            //Refocus on Bizhawk
            if (GlobalWin.MainForm != null)
            {
                GlobalWin.MainForm.Focus();
            }


            //Force create bizhawk config file if it doesn't exist
            if (!File.Exists(RTC_Core.bizhawkDir + "\\config.ini"))
            {
                RTC_Hooks.BIZHAWK_SAVE_CONFIG();
            }

            //Fetch NetCore aggressiveness
            if (RTC_Hooks.isRemoteRTC)
            {
                RTC_Core.SendCommandToRTC(new RTC_Command(CommandType.GETAGGRESSIVENESS));
            }
        }
Exemplo n.º 27
0
 public static void LOAD_SAVESTATE_BEGIN()
 {
     RTC_RPC.SendToKillSwitch("FREEZE");
 }
Exemplo n.º 28
0
 public static void LOAD_SAVESTATE_END()
 {
     RTC_RPC.SendToKillSwitch("UNFREEZE");
 }
Exemplo n.º 29
0
 static void Main(string[] args)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     RTC_RPC.Send("RTC|CORRUPT", args);
 }
Exemplo n.º 30
0
 private void btnActiveTableLoad_Click(object sender, EventArgs e)
 {
     RTC_RPC.SendToKillSwitch("FREEZE");
     RTC_FreezeEngine.LoadActiveTable();
     RTC_RPC.SendToKillSwitch("UNFREEZE");
 }