Ejemplo n.º 1
0
        public void CheckCommonStockParts()
        {
            var missingPartsCount = 0;

            LunaLog.Log("[LMP]: Missing parts start");
            var modFile = new ModControlStructure();

            modFile.SetDefaultAllowedParts();

            var missingParts = PartLoader.LoadedPartsList.Where(p => !modFile.AllowedParts.Contains(p.name));

            foreach (var part in missingParts)
            {
                missingPartsCount++;
                LunaLog.Log($"[LMP]: Missing '{part.name}'");
            }

            LunaLog.Log("[LMP]: Missing parts end");

            LunaScreenMsg.PostScreenMessage(
                missingPartsCount > 0
                    ? $"{missingPartsCount} missing part(s) from Common.dll printed to debug log ({PartLoader.LoadedPartsList.Count} total)"
                    : $"No missing parts out of from Common.dll ({PartLoader.LoadedPartsList.Count} total)",
                5f, ScreenMessageStyle.UPPER_CENTER);
        }
Ejemplo n.º 2
0
        private static bool CheckFilesAndExpansions(ModControlStructure modInfo)
        {
            var checkOk = true;

            var currentExpansions = System.GetInstalledExpansions();
            var missingExpansions = modInfo.RequiredExpansions.Except(currentExpansions).ToArray();

            if (missingExpansions.Any())
            {
                Sb.AppendLine($"Missing {string.Join(", ", missingExpansions)} expansion/s!");
                System.MissingExpansions.AddRange(missingExpansions);
                checkOk = false;
            }

            foreach (var file in System.DllList)
            {
                checkOk &= CheckExistingFile(modInfo, file);
            }

            foreach (var requiredEntry in modInfo.MandatoryPlugins)
            {
                checkOk &= CheckMandatoryFile(requiredEntry);
            }

            foreach (var requiredEntry in modInfo.MandatoryParts)
            {
                checkOk &= CheckMandatoryPart(requiredEntry);
            }

            return(checkOk);
        }
Ejemplo n.º 3
0
        public bool ParseModFile(ModControlStructure modFileData)
        {
            if (!ModSystem.Singleton.ModControl)
            {
                return(true);
            }

            System.ModControlData = modFileData;
            Sb.Length             = 0;

            SaveCurrentModConfigurationFile();

            SetAllPathsToLowercase(modFileData);
            if (!CheckFilesAndExpansions(modFileData))
            {
                LunaLog.LogError("[LMP]: Mod check failed!");
                LunaLog.LogError(Sb.ToString());
                ModWindow.Singleton.Display = true;
                return(false);
            }

            System.AllowedParts     = modFileData.AllowedParts;
            System.AllowedResources = modFileData.AllowedResources;
            LunaLog.Log("[LMP]: Mod check passed!");
            return(true);
        }
Ejemplo n.º 4
0
        public static void GenerateNewModFile()
        {
            var defaultModFile = new ModControlStructure();

            defaultModFile.SetDefaultAllowedParts();

            FileHandler.WriteToFile(ServerContext.ModFilePath, LunaXmlSerializer.SerializeToXml(defaultModFile));
        }
Ejemplo n.º 5
0
        public static void GenerateNewModFile()
        {
            ModControlStructure defaultModFile = new ModControlStructure();

            //defaultModFile.AllowedParts = new List<string>(DefaultAllowedParts);
            //defaultModFile.AllowedResources = new List<string>(DefaultAllowedResources);
            ModControl = defaultModFile;

            FileHandler.WriteToFile(ServerContext.ModFilePath, LunaXmlSerializer.SerializeToXml(defaultModFile));
        }
Ejemplo n.º 6
0
 public static void LoadModFile()
 {
     try
     {
         ModControl = LunaXmlSerializer.ReadXmlFromPath <ModControlStructure>(ServerContext.ModFilePath);
     }
     catch (Exception)
     {
         LunaLog.Error("Cannot read LMPModControl file. Will load the default one. Please regenerate it");
         ModControl = LunaXmlSerializer.ReadXmlFromString <ModControlStructure>(LunaCommon.Properties.Resources.LMPModControl);
     }
 }
Ejemplo n.º 7
0
        private static bool CheckExistingPart(ModControlStructure modInfo, string partName)
        {
            var forbiddenPart = modInfo.ForbiddenParts.FirstOrDefault(f => f.PartName == partName);

            if (forbiddenPart != null)
            {
                Sb.AppendLine($"Banned part {partName} exists on client!");
                System.ForbiddenPartsFound.Add(forbiddenPart);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 8
0
        public void CheckCommonStockParts()
        {
            var missingPartsCount     = 0;
            var missingResourcesCount = 0;
            var modFile = new ModControlStructure();

            modFile.SetDefaultAllowedParts();
            modFile.SetDefaultAllowedResources();

            LunaLog.Log("[LMP]: Missing parts start");
            foreach (var part in PartLoader.LoadedPartsList.Where(p => !modFile.AllowedParts.Contains(p.name)))
            {
                missingPartsCount++;
                LunaLog.Log($"[LMP]: Missing part: '{part.name}'");
            }
            LunaLog.Log("[LMP]: Missing parts end");

            LunaLog.Log("[LMP]: Missing resources start");
            foreach (var resource in PartResourceLibrary.Instance.resourceDefinitions.Cast <PartResourceDefinition>().Select(r => r.name)
                     .Where(r => !modFile.AllowedResources.Contains(r)))
            {
                missingResourcesCount++;
                LunaLog.Log($"[LMP]: Missing resource: '{resource}'");
            }
            LunaLog.Log("[LMP]: Missing resources end");

            if (missingPartsCount > 0 && missingResourcesCount <= 0)
            {
                LunaScreenMsg.PostScreenMessage($"{missingPartsCount} missing part(s) from Common.dll printed to log ({PartLoader.LoadedPartsList.Count} total)",
                                                5f, ScreenMessageStyle.UPPER_CENTER);
            }
            else if (missingPartsCount <= 0 && missingResourcesCount <= 0)
            {
                LunaScreenMsg.PostScreenMessage("No missing parts/resources from Common.dll", 5f, ScreenMessageStyle.UPPER_CENTER);
            }
            else if (missingPartsCount <= 0 && missingResourcesCount > 0)
            {
                LunaScreenMsg.PostScreenMessage($"{missingResourcesCount} missing resources from Common.dll printed to log ({PartResourceLibrary.Instance.resourceDefinitions.Count} total)", 5f, ScreenMessageStyle.UPPER_CENTER);
            }
            else
            {
                LunaScreenMsg.PostScreenMessage($"{missingPartsCount} missing part(s) from Common.dll printed to log ({PartLoader.LoadedPartsList.Count} total). " +
                                                $"{missingResourcesCount} missing resources from Common.dll printed to log ({PartResourceLibrary.Instance.resourceDefinitions.Count} total)",
                                                5f, ScreenMessageStyle.UPPER_CENTER);
            }
        }
Ejemplo n.º 9
0
        private static bool CheckExistingFile(ModControlStructure modInfo, KeyValuePair <string, string> file)
        {
            var forbiddenItem = modInfo.ForbiddenPlugins.FirstOrDefault(f => f.FilePath == file.Key);

            if (forbiddenItem != null)
            {
                Sb.AppendLine($"Banned file {file.Key} exists on client!");
                System.ForbiddenFilesFound.Add(forbiddenItem);
                return(false);
            }

            if (!modInfo.AllowNonListedPlugins && modInfo.MandatoryPlugins.All(f => f.FilePath != file.Key))
            {
                Sb.AppendLine($"Server does not allow external plugins and banned file {file.Key} exists on client!");
                System.NonListedFilesFound.Add(file.Key);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 10
0
        public void GenerateModControlFile(bool appendSha)
        {
            var modCtrlStructure = new ModControlStructure
            {
                RequiredExpansions = GetInstalledExpansions()
            };

            modCtrlStructure.AllowedParts.AddRange(PartLoader.LoadedPartsList.Select(p => p.name));
            modCtrlStructure.AllowedResources.AddRange(PartResourceLibrary.Instance.resourceDefinitions.Cast <PartResourceDefinition>().Select(r => r.name));

            foreach (var modFile in GetModFiles())
            {
                modCtrlStructure.MandatoryPlugins.Add(new MandatoryDllFile
                {
                    FilePath = GetRelativePath(modFile),
                    Sha      = appendSha ? Common.CalculateSha256FileHash(modFile) : string.Empty,
                    Text     = $"{Path.GetFileNameWithoutExtension(modFile)}. Version: {FileVersionInfo.GetVersionInfo(modFile).FileVersion}"
                });
            }

            LunaXmlSerializer.WriteToXmlFile(modCtrlStructure, CommonUtil.CombinePaths(MainSystem.KspPath, "LMPModControl.xml"));
            LunaScreenMsg.PostScreenMessage(LocalizationContainer.ScreenText.ModFileGenerated, 5f, ScreenMessageStyle.UPPER_CENTER);
        }
Ejemplo n.º 11
0
        public void GenerateModControlFile(bool appendSha)
        {
            var modFile = new ModControlStructure
            {
                RequiredExpansions = GetInstalledExpansions()
            };

            var extraParts = PartLoader.LoadedPartsList.Where(p => !modFile.AllowedParts.Contains(p.name)).Select(p => p.name);

            modFile.AllowedParts.AddRange(extraParts);

            var gameDataDir = CommonUtil.CombinePaths(MainSystem.KspPath, "GameData");

            foreach (var modDirectory in Directory.GetDirectories(gameDataDir))
            {
                var relPathFolder = modDirectory.Substring(modDirectory.ToLower().IndexOf("gamedata", StringComparison.Ordinal) + 9).Replace("\\", "/");
                if (relPathFolder.StartsWith("squad", StringComparison.OrdinalIgnoreCase) || relPathFolder.StartsWith("lunamultiplayer", StringComparison.OrdinalIgnoreCase))
                {
                    continue;
                }

                var filesInModFolder = Directory.GetFiles(modDirectory, "*.dll", SearchOption.AllDirectories);
                foreach (var file in filesInModFolder)
                {
                    var relativeFilePath = file.Substring(file.ToLower().IndexOf("gamedata", StringComparison.Ordinal) + 9).Replace("\\", "/");
                    modFile.MandatoryPlugins.Add(new MandatoryDllFile
                    {
                        FilePath = relativeFilePath,
                        Sha      = appendSha ? Common.CalculateSha256FileHash(file) : string.Empty,
                        Text     = $"{Path.GetFileNameWithoutExtension(file)}. Version: {FileVersionInfo.GetVersionInfo(file).FileVersion}"
                    });
                }
            }

            LunaXmlSerializer.WriteToXmlFile(modFile, CommonUtil.CombinePaths(MainSystem.KspPath, "LMPModControl.xml"));
            LunaScreenMsg.PostScreenMessage(LocalizationContainer.ScreenText.ModFileGenerated, 5f, ScreenMessageStyle.UPPER_CENTER);
        }
Ejemplo n.º 12
0
 public static void LoadModFile()
 {
     try
     {
         ModControl = LunaXmlSerializer.ReadXmlFromPath <ModControlStructure>(ServerContext.ModFilePath);
     }
     catch (Exception)
     {
         LunaLog.Warning("LMPModControl file was either missing or corrupt, a fresh default copy has been regenerated.");
         GenerateNewModFile();
     }
     string[] DefaultAllowedParts = new string[]
     {
         "StandardCtrlSrf",
         "CanardController",
         "noseCone",
         "AdvancedCanard",
         "airplaneTail",
         "deltaWing",
         "noseConeAdapter",
         "rocketNoseCone",
         "smallCtrlSrf",
         "standardNoseCone",
         "sweptWing",
         "tailfin",
         "wingConnector",
         "winglet",
         "R8winglet",
         "winglet3",
         "Mark1Cockpit",
         "Mark2Cockpit",
         "Mark1-2Pod",
         "advSasModule",
         "asasmodule1-2",
         "avionicsNoseCone",
         "crewCabin",
         "cupola",
         "landerCabinSmall",
         "mark3Cockpit",
         "mk1pod",
         "mk2LanderCabin",
         "probeCoreCube",
         "probeCoreHex",
         "probeCoreOcto",
         "probeCoreOcto2",
         "probeCoreSphere",
         "probeStackLarge",
         "probeStackSmall",
         "sasModule",
         "seatExternalCmd",
         "rtg",
         "batteryBank",
         "batteryBankLarge",
         "batteryBankMini",
         "batteryPack",
         "ksp.r.largeBatteryPack",
         "largeSolarPanel",
         "solarPanels1",
         "solarPanels2",
         "solarPanels3",
         "solarPanels4",
         "solarPanels5",
         "JetEngine",
         "engineLargeSkipper",
         "ionEngine",
         "liquidEngine",
         "liquidEngine1-2",
         "liquidEngine2",
         "liquidEngine2-2",
         "liquidEngine3",
         "liquidEngineMini",
         "microEngine",
         "nuclearEngine",
         "radialEngineMini",
         "radialLiquidEngine1-2",
         "sepMotor1",
         "smallRadialEngine",
         "solidBooster",
         "solidBooster1-1",
         "toroidalAerospike",
         "turboFanEngine",
         "MK1Fuselage",
         "Mk1FuselageStructural",
         "RCSFuelTank",
         "RCSTank1-2",
         "rcsTankMini",
         "rcsTankRadialLong",
         "fuelTank",
         "fuelTank1-2",
         "fuelTank2-2",
         "fuelTank3-2",
         "fuelTank4-2",
         "fuelTankSmall",
         "fuelTankSmallFlat",
         "miniFuelTank",
         "mk2Fuselage",
         "mk2SpacePlaneAdapter",
         "mk3Fuselage",
         "mk3spacePlaneAdapter",
         "radialRCSTank",
         "toroidalFuelTank",
         "xenonTank",
         "xenonTankRadial",
         "adapterLargeSmallBi",
         "adapterLargeSmallQuad",
         "adapterLargeSmallTri",
         "adapterSmallMiniShort",
         "adapterSmallMiniTall",
         "nacelleBody",
         "radialEngineBody",
         "smallHardpoint",
         "stationHub",
         "structuralIBeam1",
         "structuralIBeam2",
         "structuralIBeam3",
         "structuralMiniNode",
         "structuralPanel1",
         "structuralPanel2",
         "structuralPylon",
         "structuralWing",
         "strutConnector",
         "strutCube",
         "strutOcto",
         "trussAdapter",
         "trussPiece1x",
         "trussPiece3x",
         "CircularIntake",
         "landingLeg1",
         "landingLeg1-2",
         "RCSBlock",
         "stackDecoupler",
         "airScoop",
         "commDish",
         "decoupler1-2",
         "dockingPort1",
         "dockingPort2",
         "dockingPort3",
         "dockingPortLarge",
         "dockingPortLateral",
         "fuelLine",
         "ladder1",
         "largeAdapter",
         "largeAdapter2",
         "launchClamp1",
         "linearRcs",
         "longAntenna",
         "miniLandingLeg",
         "parachuteDrogue",
         "parachuteLarge",
         "parachuteRadial",
         "parachuteSingle",
         "radialDecoupler",
         "radialDecoupler1-2",
         "radialDecoupler2",
         "ramAirIntake",
         "roverBody",
         "sensorAccelerometer",
         "sensorBarometer",
         "sensorGravimeter",
         "sensorThermometer",
         "spotLight1",
         "spotLight2",
         "stackBiCoupler",
         "stackDecouplerMini",
         "stackPoint1",
         "stackQuadCoupler",
         "stackSeparator",
         "stackSeparatorBig",
         "stackSeparatorMini",
         "stackTriCoupler",
         "telescopicLadder",
         "telescopicLadderBay",
         "SmallGearBay",
         "roverWheel1",
         "roverWheel2",
         "roverWheel3",
         "wheelMed",
         "flag",
         "kerbalEVA",
         "mediumDishAntenna",
         "GooExperiment",
         "science.module",
         "RAPIER",
         "Large.Crewed.Lab",
         "GrapplingDevice",
         "LaunchEscapeSystem",
         "MassiveBooster",
         "PotatoRoid",
         "Size2LFB",
         "Size3AdvancedEngine",
         "size3Decoupler",
         "Size3EngineCluster",
         "Size3LargeTank",
         "Size3MediumTank",
         "Size3SmallTank",
         "Size3to2Adapter",
         "omsEngine",
         "vernierEngine",
         "delta.small",
         "elevon2",
         "elevon3",
         "elevon5",
         "IntakeRadialLong",
         "MK1IntakeFuselage",
         "mk2.1m.AdapterLong",
         "mk2.1m.Bicoupler",
         "mk2CargoBayL",
         "mk2CargoBayS",
         "mk2Cockpit.Inline",
         "mk2Cockpit.Standard",
         "mk2CrewCabin",
         "mk2DockingPort",
         "mk2DroneCore",
         "mk2FuselageLongLFO",
         "mk2FuselageShortLFO",
         "mk2FuselageShortLiquid",
         "mk2FuselageShortMono",
         "shockConeIntake",
         "structuralWing2",
         "structuralWing3",
         "structuralWing4",
         "sweptWing1",
         "sweptWing2",
         "wingConnector2",
         "wingConnector3",
         "wingConnector4",
         "wingConnector5",
         "wingStrake",
         "adapterMk3-Mk2",
         "adapterMk3-Size2",
         "adapterMk3-Size2Slant",
         "adapterSize2-Mk2",
         "adapterSize2-Size1",
         "adapterSize2-Size1Slant",
         "adapterSize3-Mk3",
         "mk3CargoBayL",
         "mk3CargoBayM",
         "mk3CargoBayS",
         "mk3Cockpit.Shuttle",
         "mk3CrewCabin",
         "mk3FuselageLF.100",
         "mk3FuselageLF.25",
         "mk3FuselageLF.50",
         "mk3FuselageLFO.100",
         "mk3FuselageLFO.25",
         "mk3FuselageLFO.50",
         "mk3FuselageMONO",
         "kerbalEVAfemale",
         "airbrake1",
         "airlinerCtrlSrf",
         "airlinerMainWing",
         "airlinerTailFin",
         "pointyNoseConeA",
         "pointyNoseConeB",
         "airplaneTailB",
         "fairingSize1",
         "fairingSize2",
         "fairingSize3",
         "HeatShield1",
         "HeatShield2",
         "HeatShield3",
         "wingShuttleDelta",
         "elevonMk3",
         "wingShuttleElevon1",
         "wingShuttleElevon2",
         "wingShuttleRudder",
         "wingShuttleStrake",
         "delta.small",
         "mk2Cockpit.Inline",
         "mk2Cockpit.Standard",
         "mk3Cockpit.Shuttle",
         "ksp.r.largeBatteryPack",
         "solidBooster.sm",
         "fuelTank.long",
         "mk2.1m.Bicoupler",
         "mk2.1m.AdapterLong",
         "mk3FuselageLFO.100",
         "mk3FuselageLFO.25",
         "mk3FuselageLFO.50",
         "mk3FuselageLF.100",
         "mk3FuselageLF.25",
         "mk3FuselageLF.50",
         "xenonTankLarge",
         "mk3Cockpit.Shuttle",
         "FuelCell",
         "FuelCellArray",
         "ISRU",
         "LargeTank",
         "OrbitalScanner",
         "RadialDrill",
         "SmallTank",
         "SurfaceScanner",
         "SurveyScanner",
         "sensorAtmosphere",
         "Large.Crewed.Lab",
         "science.module",
         "radialDrogue",
         "ServiceBay.125",
         "ServiceBay.250",
         "GearFixed",
         "GearFree",
         "GearLarge",
         "GearMedium",
         "basicFin",
         "foldingRadLarge",
         "foldingRadMed",
         "foldingRadSmall",
         "radPanelLg",
         "radPanelSm",
         "turboJet",
         "turboFanSize2",
         "miniJetEngine",
         "SSME",
         "adapterEngines",
         "miniFuselage",
         "miniIntake",
         "MK1CrewCabin",
         "MiniISRU",
         "MiniDrill",
         "RadialOreTank",
         "radPanelEdge",
         "mk3CargoRamp",
         "InflatableHeatShield",
         "HECS2.ProbeCore",
         "HighGainAntenna",
         "LgRadialSolarPanel",
         "GearSmall",
         "ScienceBox",
         "SurfAntenna",
         "HighGainAntenna5",
         "RelayAntenna100",
         "RelayAntenna5",
         "RelayAntenna50",
         "HeatShield0",
         "InfraredTelescope",
         "kerbalEVAVintage",
         "kerbalEVAfemaleVintage",
         "mk1-3pod",
         "Decoupler_0",
         "Decoupler_1",
         "Decoupler_2",
         "Decoupler_3",
         "Separator_0",
         "Separator_1",
         "Separator_2",
         "Separator_3",
         "externalTankCapsule",
         "externalTankRound",
         "externalTankToroid",
         "Rockomax16_BW",
         "Rockomax32_BW",
         "Rockomax64_BW",
         "Rockomax8BW",
         "Decoupler.0",
         "Decoupler.1",
         "Decoupler.2",
         "Decoupler.3",
         "Separator.0",
         "Separator.1",
         "Separator.2",
         "Separator.3",
         "Rockomax16.BW",
         "Rockomax32.BW",
         "Rockomax64.BW",
         "Decoupler.1p5",
         "Decoupler.4",
         "EnginePlate1p5",
         "EnginePlate2",
         "EnginePlate3",
         "EnginePlate4",
         "InflatableAirlock",
         "Separator.1p5",
         "Separator.4",
         "Size1p5.Strut.Decoupler",
         "LiquidEngineKE-1",
         "LiquidEngineLV-T91",
         "LiquidEngineLV-TX87",
         "LiquidEngineRE-I2",
         "LiquidEngineRE-J10",
         "LiquidEngineRK-7",
         "LiquidEngineRV-1",
         "monopropMiniSphere",
         "Size1p5.Monoprop",
         "Size1p5.Size0.Adapter.01",
         "Size1p5.Size1.Adapter.01",
         "Size1p5.Size1.Adapter.02",
         "Size1p5.Size2.Adapter.01",
         "Size1p5.Tank.01",
         "Size1p5.Tank.02",
         "Size1p5.Tank.03",
         "Size1p5.Tank.04",
         "Size1p5.Tank.05",
         "Size3.Size4.Adapter.01",
         "Size4.EngineAdapter.01",
         "Size4.Tank.01",
         "Size4.Tank.02",
         "Size4.Tank.03",
         "Size4.Tank.04",
         "roverWheelM1-F",
         "fairingSize1p5",
         "fairingSize4",
         "Size1to0ServiceModule",
         "ServiceModule18",
         "ServiceModule25",
         "kv1Pod",
         "kv2Pod",
         "kv3Pod",
         "Mk2Pod",
         "MEMLander",
         "EquiTriangle0",
         "EquiTriangle1",
         "EquiTriangle1p5",
         "EquiTriangle2",
         "Panel0",
         "Panel1",
         "Panel1p5",
         "Panel2",
         "Triangle0",
         "Triangle1",
         "Triangle1p5",
         "Triangle2",
         "Tube1",
         "Tube1p5",
         "Tube2",
         "Tube3",
         "Tube4",
         "HeatShield1p5",
         "mk1pod.v2",
         "probeCoreHex.v2",
         "probeCoreOcto2.v2",
         "probeCoreOcto.v2",
         "roverBody.v2",
         "probeCoreSphere.v2",
         "solidBooster.v2",
         "solidBooster.sm.v2",
         "rocketNoseCone.v2",
         "mk2LanderCabin.v2",
         "liquidEngineMini.v2",
         "liquidEngine3.v2",
         "liquidEngine2-2.v2",
         "Size3To2Adapter.v2",
         "stackBiCoupler.v2",
         "stackTriCoupler.v2",
         "rocketNoseConeSize3",
         "smallRadialEngine.v2",
         "radialEngineMini.v2",
         "microEngine.v2",
         "RCSBlock.v2",
         "kerbalEVAFuture",
         "kerbalEVAfemaleFuture",
         "rocketNoseConeSize4",
         "cargoContainer",
         "smallCargoContainer",
         "DeployedCentralStation",
         "DeployedGoExOb",
         "DeployedIONExp",
         "DeployedRTG",
         "DeployedSatDish",
         "DeployedSeismicSensor",
         "DeployedSolarPanel",
         "DeployedWeatherStn",
         "hinge.01",
         "hinge.01.s",
         "hinge.03",
         "hinge.03.s",
         "hinge.04",
         "piston.01",
         "piston.02",
         "piston.03",
         "piston.04",
         "rotor.01",
         "rotor.02",
         "rotor.03",
         "rotoServo.00",
         "rotoServo.02",
         "rotoServo.03",
         "rotoServo.04",
         "controller1000",
         "RobotArmScanner.S1",
         "RobotArmScanner.S2",
         "RobotArmScanner.S3",
         "noseconeTiny",
         "noseconeVS",
         "largeHeliBlade",
         "largePropeller",
         "mediumHeliBlade",
         "mediumPropeller",
         "smallHeliBlade",
         "smallPropeller",
         "RotorEngine.02",
         "RotorEngine.03",
         "rotor.01s",
         "rotor.02s",
         "rotor.03s",
         "lGripPad",
         "lGripStrip",
         "mGripPad",
         "sGripPad",
         "sGripStrip",
         "Thoroughbred",
         "Clydesdale",
         "Shrimp",
         "Mite",
         "ServiceBay.125.v2",
         "ServiceBay.250.v2",
         "liquidEngineMainsail.v2",
         "engineLargeSkipper.v2",
         "ReleaseValve",
         "Size.1.5.Cone",
         "Pollux",
         "FanShroud.01",
         "FanShroud.02",
         "FanShroud.03",
         "largeFanBlade",
         "mediumFanBlade",
         "smallFanBlade",
         "Magnetometer",
         "MpoProbe",
         "MtmStage",
         "PotatoComet",
         "flagPartFlat",
         "flagPartSize0",
         "flagPartSize1",
         "flagPartSize2",
         "flagPartSize3",
         "smallClaw",
         "evaCylinder",
         "evaJetpack",
         "evaChute",
         "evaRepairKit",
         "evaScienceKit",
         "CargoStorageUnit",
         "ConformalStorageUnit",
         "Size2LFB.v2",
         "HighGainAntenna5.v2",
         "domeLight1",
         "groundLight1",
         "groundLight2",
         "navLight1",
         "spotLight3",
         "stripLight1",
         "RCSblock.01.small",
         "RCSLinearSmall",
         "flagPartSize1p5",
         "flagPartSize4"
     };
     string[] DefaultAllowedResources = new string[]
     {
         "LiquidFuel",
         "Oxidizer",
         "SolidFuel",
         "MonoPropellant",
         "XenonGas",
         "ElectricCharge",
         "IntakeAir",
         "EVA Propellant",
         "Ore",
         "Ablator"
     };
     foreach (string part in DefaultAllowedParts)
     {
         if (!ModControl.AllowedParts.Contains(part))
         {
             ModControl.AllowedParts.Add(part);
         }
     }
     foreach (string res in DefaultAllowedResources)
     {
         if (!ModControl.AllowedResources.Contains(res))
         {
             ModControl.AllowedResources.Add(res);
         }
     }
 }
Ejemplo n.º 13
0
 private static void SetAllPathsToLowercase(ModControlStructure modFileInfo)
 {
     modFileInfo.MandatoryPlugins.ForEach(m => m.FilePath = m.FilePath.ToLower());
     modFileInfo.ForbiddenPlugins.ForEach(m => m.FilePath = m.FilePath.ToLower());
 }