static ResultData DownloadWorldModsBlockingInternal(List <MyObjectBuilder_Checkpoint.ModItem> mods, CancelToken cancelToken) { MySandboxGame.Log.WriteLineAndConsole("Downloading world mods - START"); MySandboxGame.Log.IncreaseIndent(); ResultData resultData = default; resultData.Success = true; if (mods != null && mods.Count > 0) { FixModServiceName(mods); var list = new List <WorkshopId>(); foreach (MyObjectBuilder_Checkpoint.ModItem mod in mods) { if (mod.PublishedFileId != 0L) { var item = new WorkshopId(mod.PublishedFileId, mod.PublishedServiceName); if (!list.Contains(item)) { list.Add(item); } } else if (Sandbox.Engine.Platform.Game.IsDedicated) { MySandboxGame.Log.WriteLineAndConsole("Local mods are not allowed in multiplayer."); MySandboxGame.Log.DecreaseIndent(); return(default);
public MyModContext GetModContext() { MyModContext modContext = new MyModContext(); modContext.Init(new MyObjectBuilder_Checkpoint.ModItem(WorkshopId, "Steam")); modContext.Init(WorkshopId.ToString(), null, ModLocation); return(modContext); }
public override int GetHashCode() { return(Source == ModSource.SteamWorkshop ? WorkshopId.GetHashCode() : Name.GetHashCode()); }