Exemplo n.º 1
0
        ////////////////

        internal void PostLoad(ModHelpersWorld modworld)
        {
            this.IsInitialized         = true;
            this.MismatchBroadcastMade = false;
            this.ScanMods(modworld);
            this.ExitDuration = 60 * 20;
        }
Exemplo n.º 2
0
        ////////////////

        private void ScanMods(ModHelpersWorld modworld)
        {
            this.FoundModNames   = new HashSet <string>();
            this.MissingModNames = new HashSet <string>();
            this.ExtraModNames   = new HashSet <string>();

            if (!this.WorldModLocks.ContainsKey(modworld.ObsoleteId2))
            {
                this.IsMismatched = false;
                return;
            }

            ISet <string>     reqModNames     = this.WorldModLocks[modworld.ObsoleteId2];
            ISet <string>     checkedModNames = new HashSet <string>();
            IEnumerable <Mod> allMods         = ModListHelpers.GetAllLoadedModsPreferredOrder();

            foreach (Mod mod in allMods)
            {
                if (!reqModNames.Contains(mod.Name))
                {
                    this.ExtraModNames.Add(mod.Name);
                }
                else
                {
                    this.FoundModNames.Add(mod.Name);
                }
                checkedModNames.Add(mod.Name);
            }

            foreach (string modName in reqModNames)
            {
                if (!checkedModNames.Contains(modName))
                {
                    this.MissingModNames.Add(modName);
                }
            }

            this.IsMismatched = ModLockService.IsModMismatchFound();
//LogHelpers.Log( "req_modNames:"+string.Join(",",req_modNames)+
//", extra:"+string.Join(",",this.ExtraModNames)+
//", found:"+string.Join(",",this.FoundModNames)+
//", missing:"+string.Join(",",this.MissingModNames ) );
//LogHelpers.Log( "IsInitialized:"+this.IsInitialized+" IsMismatched:"+this.IsMismatched+ ", ExitDuration:" + this.ExitDuration);
        }