Validate prototype ids in c# fields (#18224)

This commit is contained in:
Leon Friedrich
2023-07-30 05:34:51 +12:00
committed by GitHub
parent d4a85afb88
commit 385b587cfc
21 changed files with 116 additions and 74 deletions

View File

@@ -1,3 +1,6 @@
using Content.Shared.Roles;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.GameTicking.Rules.Components;
/// <summary>
@@ -8,12 +11,12 @@ namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent]
public sealed class NukeOperativeSpawnerComponent : Component
{
[DataField("name")]
public string OperativeName = "";
[DataField("name", required:true)]
public string OperativeName = default!;
[DataField("rolePrototype")]
public string OperativeRolePrototype = "";
[DataField("rolePrototype", customTypeSerializer:typeof(PrototypeIdSerializer<AntagPrototype>), required:true)]
public string OperativeRolePrototype = default!;
[DataField("startingGearPrototype")]
public string OperativeStartingGear = "";
[DataField("startingGearPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<StartingGearPrototype>), required:true)]
public string OperativeStartingGear = default!;
}