diff --git a/Content.YAMLLinter/Program.cs b/Content.YAMLLinter/Program.cs index b7b70bd1188c64..b23faa48fcd0c0 100644 --- a/Content.YAMLLinter/Program.cs +++ b/Content.YAMLLinter/Program.cs @@ -1,9 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Threading.Tasks; using Content.IntegrationTests; using Robust.Shared.Prototypes; +using Robust.Shared.Reflection; using Robust.Shared.Serialization.Markdown.Validation; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -103,9 +105,13 @@ await instance.WaitPost(() => return (yamlErrors, fieldErrors); } - public static async Task<(Dictionary> YamlErrors , List FieldErrors)> + public static async Task<(Dictionary> YamlErrors, List FieldErrors)> RunValidation() { + var (clientAssemblies, serverAssemblies) = await GetClientServerAssemblies(); + var serverTypes = serverAssemblies.SelectMany(n => n.GetTypes()).Select(t => t.Name).ToHashSet(); + var clientTypes = clientAssemblies.SelectMany(n => n.GetTypes()).Select(t => t.Name).ToHashSet(); + var yamlErrors = new Dictionary>(); var serverErrors = await ValidateServer(); @@ -117,9 +123,18 @@ await instance.WaitPost(() => var newErrors = val.Where(n => n.AlwaysRelevant).ToHashSet(); // We include sometimes-relevant errors if they exist both for the client & server - if (clientErrors.Item1.TryGetValue(key, out var clientVal)) + if (clientErrors.YamlErrors.TryGetValue(key, out var clientVal)) newErrors.UnionWith(val.Intersect(clientVal)); + // Include any errors that relate to server-only types + foreach (var errorNode in val) + { + if (errorNode is FieldNotFoundErrorNode fieldNotFoundNode && !clientTypes.Contains(fieldNotFoundNode.FieldType.Name)) + { + newErrors.Add(errorNode); + } + } + if (newErrors.Count != 0) yamlErrors[key] = newErrors; } @@ -135,6 +150,15 @@ await instance.WaitPost(() => errors.UnionWith(val.Where(n => n.AlwaysRelevant)); else yamlErrors[key] = newErrors; + + // Include any errors that relate to client-only types + foreach (var errorNode in val) + { + if (errorNode is FieldNotFoundErrorNode fieldNotFoundNode && !serverTypes.Contains(fieldNotFoundNode.FieldType.Name)) + { + newErrors.Add(errorNode); + } + } } // Finally, combine the prototype ID field errors. @@ -145,5 +169,23 @@ await instance.WaitPost(() => return (yamlErrors, fieldErrors); } + + private static async Task<(Assembly[] clientAssemblies, Assembly[] serverAssemblies)> + GetClientServerAssemblies() + { + await using var pair = await PoolManager.GetServerClient(); + + var result = (GetAssemblies(pair.Client), GetAssemblies(pair.Server)); + + await pair.CleanReturnAsync(); + + return result; + + Assembly[] GetAssemblies(RobustIntegrationTest.IntegrationInstance instance) + { + var refl = instance.ResolveDependency(); + return refl.Assemblies.ToArray(); + } + } } } diff --git a/Resources/Prototypes/Hydroponics/seeds.yml b/Resources/Prototypes/Hydroponics/seeds.yml index 8bbbed6135f29b..472242a5c3ea36 100644 --- a/Resources/Prototypes/Hydroponics/seeds.yml +++ b/Resources/Prototypes/Hydroponics/seeds.yml @@ -521,7 +521,6 @@ nutrientConsumption: 0.70 idealLight: 8 idealHeat: 298 - juicy: true growthStages: 2 splatPrototype: PuddleSplatter chemicals: diff --git a/Resources/Prototypes/Reagents/toxins.yml b/Resources/Prototypes/Reagents/toxins.yml index 11a9fd00aed84c..8c91c5f226f032 100644 --- a/Resources/Prototypes/Reagents/toxins.yml +++ b/Resources/Prototypes/Reagents/toxins.yml @@ -481,7 +481,6 @@ - !type:OrganType type: Animal shouldHave: false - reagent: Protein type: Local visualType: MediumCaution messages: [ "generic-reagent-effect-sick" ]