Ejemplo n.º 1
0
 protected override void OnDisabled()
 {
     base.OnDisabled();
     ModControl = ModControlMode.EnabledStopInvalidPartSync;
     FailText   = "";
     DllList.Clear();
     AllowedParts.Clear();
     LastModFileData = "";
 }
Ejemplo n.º 2
0
        public void BuildDllFileList()
        {
            DllList.Clear();

            foreach (var modFile in GetModFiles())
            {
                var fileHash = Common.CalculateSha256FileHash(modFile);
                DllList.Add(GetRelativePath(modFile), fileHash);
            }
        }
Ejemplo n.º 3
0
 public override void OnDisabled()
 {
     base.OnDisabled();
     ModControl   = ModControlMode.ENABLED_STOP_INVALID_PART_SYNC;
     DllListBuilt = false;
     FailText     = "";
     DllList.Clear();
     AllowedParts.Clear();
     LastModFileData = "";
 }
Ejemplo n.º 4
0
        public void BuildDllFileList()
        {
            DllList.Clear();
            var checkList = Directory.GetFiles(CommonUtil.CombinePaths(Client.KspPath, "GameData"), "*",
                                               SearchOption.AllDirectories);

            foreach (var checkFile in checkList.Where(f => f.ToLower().EndsWith(".dll")))
            {
                //We want the relative path to check against, example: LunaMultiPlayer/Plugins/LunaMultiPlayer.dll
                //Strip off everything from GameData
                //Replace windows backslashes with mac/linux forward slashes.
                //Make it lowercase so we don't worry about case sensitivity.
                var relativeFilePath = checkFile.ToLowerInvariant()
                                       .Substring(checkFile.ToLowerInvariant().IndexOf("gamedata", StringComparison.Ordinal) + 9)
                                       .Replace('\\', '/');

                var fileHash = Common.CalculateSha256Hash(checkFile);
                DllList.Add(relativeFilePath, fileHash);

                LunaLog.Log($"[LMP]: Hashed file: {relativeFilePath}, hash: {fileHash}");
            }
        }