Пример #1
0
        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);
Пример #2
0
        public MyModContext GetModContext()
        {
            MyModContext modContext = new MyModContext();

            modContext.Init(new MyObjectBuilder_Checkpoint.ModItem(WorkshopId, "Steam"));
            modContext.Init(WorkshopId.ToString(), null, ModLocation);
            return(modContext);
        }
Пример #3
0
 public override int GetHashCode()
 {
     return(Source == ModSource.SteamWorkshop
         ? WorkshopId.GetHashCode()
         : Name.GetHashCode());
 }