public static bool LoadRom_NET(StashKey sk) { if (sk == null) { return(false); } StashKey.SetCore(sk); LocalNetCoreRouter.Route(NetcoreCommands.VANGUARD, NetcoreCommands.REMOTE_LOADROM, sk.RomFilename, true); string ss = (string)RTCV.NetCore.AllSpec.VanguardSpec[VSPEC.SYNCSETTINGS]; //If the syncsettings are different, update them and load it again. Otheriwse, leave as is if (sk.SyncSettings != ss && sk.SyncSettings != null) { LocalNetCoreRouter.Route(NetcoreCommands.VANGUARD, NetcoreCommands.REMOTE_KEY_SETSYNCSETTINGS, sk.SyncSettings, true); LocalNetCoreRouter.Route(NetcoreCommands.VANGUARD, NetcoreCommands.REMOTE_LOADROM, sk.RomFilename, true); } return(true); }
public static bool LoadState_NET(StashKey sk, bool applyBlastLayer = true) { if (sk == null) { return(false); } bool useStates = (AllSpec.VanguardSpec[VSPEC.SUPPORTS_SAVESTATES] as bool? ?? false); if (useStates) { StashKey.SetCore(sk); string gameSystem = sk.SystemName; string gameName = CorruptCore_Extensions.MakeSafeFilename(sk.GameName, '-'); string key = sk.ParentKey; StashKeySavestateLocation stateLocation = sk.StateLocation; string theoreticalSaveStateFilename = Path.Combine(RtcCore.workingDir, stateLocation.ToString(), gameName + "." + key + ".timejump.State"); if (File.Exists(theoreticalSaveStateFilename)) { if (!LocalNetCoreRouter.QueryRoute <bool>(NetcoreCommands.VANGUARD, NetcoreCommands.LOADSAVESTATE, new object[] { theoreticalSaveStateFilename, stateLocation }, true)) { MessageBox.Show($"Error loading savestate : An internal error has occurred.\n Are you sure your savestate matches the game, your syncsettings match, and the savestate is supported by this version of {RtcCore.VanguardImplementationName}?"); return(false); } } else { MessageBox.Show($"Error loading savestate : (File {theoreticalSaveStateFilename} not found)"); return(false); } } if (applyBlastLayer && sk?.BlastLayer?.Layer?.Count > 0) { CorruptBL = sk.BlastLayer; sk.BlastLayer.Apply(true); } return(true); }