public static bool Prefix(string saveFileName) { string fileName = saveFileName; string fileContent = System.IO.File.ReadAllText(GenFilePaths.FilePathForSavedGame(saveFileName)); if (SyncTickData.cliendID == 0) { PirateRPC.PirateRPC.SendInvocation(NetDemo.ns, u => { NetDemo.SetSFD(new NetDemo.SaveFileData() { tcontext = fileContent, partial_name = fileName + "_received" }); PirateRPC.PirateRPC.SendInvocation(u, uu => { NetDemo.LoadFromRemoteSFD(); }); }); LongEventHandler.QueueLongEvent(() => { for (; NetDemo.GetSFD() == null;) { } }, "Downloading savefile".Translate(), true, e => { RimLog.Error(e.ToString()); }); } return(false); }
public static void GenerateWorld() { ThingIDMakerPatch.stopID = true; ThinkTreeKeyAssigner.Reset(); foreach (var def in DefDatabase <ThinkTreeDef> .AllDefsListForReading) { ThinkTreeKeyAssigner.AssignKeys(def.thinkRoot, 0); } if (SyncTickData.cliendID == 0) { Find.WindowStack.Add(new Dialog_SaveFileList_Load()); } else { LongEventHandler.QueueLongEvent(() => { NetDemo.LoadFromRemoteSFD(); for (; NetDemo.GetSFD() == null;) { } }, "Downloading savefile".Translate(), true, e => { RimLog.Error(e.ToString()); }); } }