diff --git a/Content.Benchmarks/ComponentManagerGetAllComponents.cs b/Content.Benchmarks/ComponentManagerGetAllComponents.cs index 0507b58b5e..80cba3ca02 100644 --- a/Content.Benchmarks/ComponentManagerGetAllComponents.cs +++ b/Content.Benchmarks/ComponentManagerGetAllComponents.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using BenchmarkDotNet.Attributes; using Moq; using Robust.Shared.Exceptions; @@ -45,8 +45,7 @@ namespace Content.Benchmarks var dummyReg = new Mock(); dummyReg.SetupGet(p => p.Name).Returns("Dummy"); dummyReg.SetupGet(p => p.Type).Returns(typeof(DummyComponent)); - dummyReg.SetupGet(p => p.NetID).Returns((uint?) null); - dummyReg.SetupGet(p => p.NetworkSynchronizeExistence).Returns(false); + dummyReg.SetupGet(p => p.NetID).Returns((ushort?) null); dummyReg.SetupGet(p => p.References).Returns(new [] {typeof(DummyComponent)}); var componentFactory = new Mock(); diff --git a/Content.Client/Administration/UI/CustomControls/CommandButton.cs b/Content.Client/Administration/UI/CustomControls/CommandButton.cs index f728b8b6e2..c4dce7e05d 100644 --- a/Content.Client/Administration/UI/CustomControls/CommandButton.cs +++ b/Content.Client/Administration/UI/CustomControls/CommandButton.cs @@ -9,7 +9,7 @@ namespace Content.Client.Administration.UI.CustomControls { public string? Command { get; set; } - public CommandButton() : base() + public CommandButton() { OnPressed += Execute; } diff --git a/Content.Client/Clothing/ClothingComponent.cs b/Content.Client/Clothing/ClothingComponent.cs index bceed9f7fe..030ab4533b 100644 --- a/Content.Client/Clothing/ClothingComponent.cs +++ b/Content.Client/Clothing/ClothingComponent.cs @@ -4,11 +4,11 @@ using Content.Client.Items.Components; using Content.Shared.Clothing; using Content.Shared.Inventory; using Content.Shared.Item; -using Content.Shared.NetIDs; using Robust.Client.Graphics; using Robust.Client.ResourceManagement; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -18,12 +18,12 @@ namespace Content.Client.Clothing [RegisterComponent] [ComponentReference(typeof(SharedItemComponent))] [ComponentReference(typeof(ItemComponent))] + [NetworkedComponent()] public class ClothingComponent : ItemComponent { [DataField("femaleMask")] private FemaleClothingMask _femaleMask = FemaleClothingMask.UniformFull; public override string Name => "Clothing"; - public override uint? NetID => ContentNetIDs.CLOTHING; private string? _clothingEquippedPrefix; diff --git a/Content.Client/Entry/EntryPoint.cs b/Content.Client/Entry/EntryPoint.cs index 2bc5e3f265..b975c28673 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -105,6 +105,7 @@ namespace Content.Client.Entry } IoCManager.BuildGraph(); + factory.GenerateNetIds(); IoCManager.Resolve().Initialize(); IoCManager.Resolve().LoadParallax(); diff --git a/Content.Client/Tools/Components/MultiToolComponent.cs b/Content.Client/Tools/Components/MultiToolComponent.cs index 4752efef76..df90cd55be 100644 --- a/Content.Client/Tools/Components/MultiToolComponent.cs +++ b/Content.Client/Tools/Components/MultiToolComponent.cs @@ -1,11 +1,11 @@ using Content.Client.Items.Components; using Content.Client.Message; using Content.Client.Stylesheets; -using Content.Shared.NetIDs; using Content.Shared.Tool; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Timing; using Robust.Shared.ViewVariables; @@ -13,6 +13,7 @@ using Robust.Shared.ViewVariables; namespace Content.Client.Tools.Components { [RegisterComponent] + [NetworkedComponent()] public class MultiToolComponent : Component, IItemStatus { private ToolQuality _behavior; @@ -24,7 +25,6 @@ namespace Content.Client.Tools.Components [ViewVariables] public ToolQuality? Behavior => _behavior; public override string Name => "MultiTool"; - public override uint? NetID => ContentNetIDs.MULTITOOLS; public override void HandleComponentState(ComponentState? curState, ComponentState? nextState) { diff --git a/Content.Client/Tools/Components/WelderComponent.cs b/Content.Client/Tools/Components/WelderComponent.cs index f37a81ff5a..9c9beb6e82 100644 --- a/Content.Client/Tools/Components/WelderComponent.cs +++ b/Content.Client/Tools/Components/WelderComponent.cs @@ -2,11 +2,11 @@ using System; using Content.Client.Items.Components; using Content.Client.Message; using Content.Client.Stylesheets; -using Content.Shared.NetIDs; using Content.Shared.Tool; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Localization; using Robust.Shared.Timing; using Robust.Shared.ViewVariables; @@ -14,10 +14,11 @@ using Robust.Shared.ViewVariables; namespace Content.Client.Tools.Components { [RegisterComponent] + [NetworkedComponent()] + public class WelderComponent : SharedToolComponent, IItemStatus { public override string Name => "Welder"; - public override uint? NetID => ContentNetIDs.WELDER; private ToolQuality _behavior; [ViewVariables(VVAccess.ReadWrite)] private bool _uiUpdateNeeded; diff --git a/Content.Client/Weapons/Ranged/Barrels/Components/ClientBatteryBarrelComponent.cs b/Content.Client/Weapons/Ranged/Barrels/Components/ClientBatteryBarrelComponent.cs index d2286b87bd..1170669ae9 100644 --- a/Content.Client/Weapons/Ranged/Barrels/Components/ClientBatteryBarrelComponent.cs +++ b/Content.Client/Weapons/Ranged/Barrels/Components/ClientBatteryBarrelComponent.cs @@ -1,22 +1,22 @@ -using System; +using System; using Content.Client.Items.Components; using Content.Client.Stylesheets; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged.Barrels.Components; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.ViewVariables; namespace Content.Client.Weapons.Ranged.Barrels.Components { [RegisterComponent] + [NetworkedComponent()] public class ClientBatteryBarrelComponent : Component, IItemStatus { public override string Name => "BatteryBarrel"; - public override uint? NetID => ContentNetIDs.BATTERY_BARREL; private StatusControl? _statusControl; diff --git a/Content.Client/Weapons/Ranged/Barrels/Components/ClientBoltActionBarrelComponent.cs b/Content.Client/Weapons/Ranged/Barrels/Components/ClientBoltActionBarrelComponent.cs index f36ccf2995..46ec782f56 100644 --- a/Content.Client/Weapons/Ranged/Barrels/Components/ClientBoltActionBarrelComponent.cs +++ b/Content.Client/Weapons/Ranged/Barrels/Components/ClientBoltActionBarrelComponent.cs @@ -1,24 +1,24 @@ -using System; +using System; using Content.Client.IoC; using Content.Client.Items.Components; using Content.Client.Resources; using Content.Client.Stylesheets; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged.Barrels.Components; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.ViewVariables; namespace Content.Client.Weapons.Ranged.Barrels.Components { [RegisterComponent] + [NetworkedComponent()] public class ClientBoltActionBarrelComponent : Component, IItemStatus { public override string Name => "BoltActionBarrel"; - public override uint? NetID => ContentNetIDs.BOLTACTION_BARREL; private StatusControl? _statusControl; diff --git a/Content.Client/Weapons/Ranged/Barrels/Components/ClientMagazineBarrelComponent.cs b/Content.Client/Weapons/Ranged/Barrels/Components/ClientMagazineBarrelComponent.cs index dd05d7ede1..efa02b24e8 100644 --- a/Content.Client/Weapons/Ranged/Barrels/Components/ClientMagazineBarrelComponent.cs +++ b/Content.Client/Weapons/Ranged/Barrels/Components/ClientMagazineBarrelComponent.cs @@ -1,9 +1,8 @@ -using System; +using System; using Content.Client.IoC; using Content.Client.Items.Components; using Content.Client.Resources; using Content.Client.Stylesheets; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged; using Content.Shared.Weapons.Ranged.Barrels.Components; using Robust.Client.Animations; @@ -12,6 +11,7 @@ using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.Animations; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.Network; using Robust.Shared.Players; @@ -21,6 +21,7 @@ using Robust.Shared.ViewVariables; namespace Content.Client.Weapons.Ranged.Barrels.Components { [RegisterComponent] + [NetworkedComponent()] public class ClientMagazineBarrelComponent : Component, IItemStatus { private static readonly Animation AlarmAnimationSmg = new() @@ -70,7 +71,6 @@ namespace Content.Client.Weapons.Ranged.Barrels.Components }; public override string Name => "MagazineBarrel"; - public override uint? NetID => ContentNetIDs.MAGAZINE_BARREL; private StatusControl? _statusControl; diff --git a/Content.Client/Weapons/Ranged/Barrels/Components/ClientPumpBarrelComponent.cs b/Content.Client/Weapons/Ranged/Barrels/Components/ClientPumpBarrelComponent.cs index 3f9f70b885..fb95c27c61 100644 --- a/Content.Client/Weapons/Ranged/Barrels/Components/ClientPumpBarrelComponent.cs +++ b/Content.Client/Weapons/Ranged/Barrels/Components/ClientPumpBarrelComponent.cs @@ -1,24 +1,24 @@ -using System; +using System; using Content.Client.IoC; using Content.Client.Items.Components; using Content.Client.Resources; using Content.Client.Stylesheets; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged.Barrels.Components; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.ViewVariables; namespace Content.Client.Weapons.Ranged.Barrels.Components { [RegisterComponent] + [NetworkedComponent()] public class ClientPumpBarrelComponent : Component, IItemStatus { public override string Name => "PumpBarrel"; - public override uint? NetID => ContentNetIDs.PUMP_BARREL; private StatusControl? _statusControl; diff --git a/Content.Client/Weapons/Ranged/Barrels/Components/ClientRevolverBarrelComponent.cs b/Content.Client/Weapons/Ranged/Barrels/Components/ClientRevolverBarrelComponent.cs index 1b009c25a3..988675b190 100644 --- a/Content.Client/Weapons/Ranged/Barrels/Components/ClientRevolverBarrelComponent.cs +++ b/Content.Client/Weapons/Ranged/Barrels/Components/ClientRevolverBarrelComponent.cs @@ -1,22 +1,22 @@ -using Content.Client.IoC; +using Content.Client.IoC; using Content.Client.Items.Components; using Content.Client.Resources; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged.Barrels.Components; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.ViewVariables; namespace Content.Client.Weapons.Ranged.Barrels.Components { [RegisterComponent] + [NetworkedComponent()] public class ClientRevolverBarrelComponent : Component, IItemStatus { public override string Name => "RevolverBarrel"; - public override uint? NetID => ContentNetIDs.REVOLVER_BARREL; private StatusControl? _statusControl; diff --git a/Content.IntegrationTests/Tests/Networking/NetworkIdsMatchTest.cs b/Content.IntegrationTests/Tests/Networking/NetworkIdsMatchTest.cs new file mode 100644 index 0000000000..3d0a541202 --- /dev/null +++ b/Content.IntegrationTests/Tests/Networking/NetworkIdsMatchTest.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using NUnit.Framework; +using Robust.Server.Player; +using Robust.Shared.Enums; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; +using Robust.Shared.Network; + +namespace Content.IntegrationTests.Tests.Networking +{ + [TestFixture] + class NetworkIdsMatchTest : ContentIntegrationTest + { + [Test] + public async Task TestConnect() + { + var client = StartClient(); + var server = StartServer(); + + await ConnectNetworking(client, server); + + var clientCompFactory = client.ResolveDependency(); + var serverCompFactory = server.ResolveDependency(); + + var clientNetComps = clientCompFactory.NetworkedComponents; + var serverNetComps = serverCompFactory.NetworkedComponents; + + Assert.That(clientNetComps, Is.Not.Null); + Assert.That(serverNetComps, Is.Not.Null); + Assert.That(clientNetComps.Count, Is.EqualTo(serverNetComps.Count)); + + // Checks that at least Metadata and Transform are registered. + Assert.That(clientNetComps.Count, Is.GreaterThanOrEqualTo(2)); + + for (var netId = 0; netId < clientNetComps.Count; netId++) + { + Assert.That(clientNetComps[netId].Name, Is.EqualTo(serverNetComps[netId].Name)); + } + } + + private static async Task ConnectNetworking(ClientIntegrationInstance client, ServerIntegrationInstance server) + { + await Task.WhenAll(client.WaitIdleAsync(), server.WaitIdleAsync()); + + // Connect. + + client.SetConnectTarget(server); + + client.Post(() => IoCManager.Resolve().ClientConnect(null, 0, null)); + + // Run some ticks for the handshake to complete and such. + + for (var i = 0; i < 10; i++) + { + server.RunTicks(1); + await server.WaitIdleAsync(); + client.RunTicks(1); + await client.WaitIdleAsync(); + } + + await Task.WhenAll(client.WaitIdleAsync(), server.WaitIdleAsync()); + } + } +} diff --git a/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs b/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs index 5b918488bb..75288a7eaf 100644 --- a/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs +++ b/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs @@ -3,13 +3,13 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Content.Shared.NetIDs; using NUnit.Framework; using Robust.Client.GameObjects; using Robust.Client.GameStates; using Robust.Server.Player; using Robust.Shared; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Players; @@ -391,10 +391,10 @@ namespace Content.IntegrationTests.Tests.Networking } } + [NetworkedComponent()] private sealed class PredictionTestComponent : Component { public override string Name => "PredictionTest"; - public override uint? NetID => ContentNetIDs.PREDICTION_TEST; private bool _foo; @@ -428,7 +428,7 @@ namespace Content.IntegrationTests.Tests.Networking { public bool Foo { get; } - public PredictionComponentState(bool foo) : base(ContentNetIDs.PREDICTION_TEST) + public PredictionComponentState(bool foo) { Foo = foo; } diff --git a/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs b/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs index 6634ae5d9a..157b5e3b7f 100644 --- a/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs +++ b/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs @@ -7,8 +7,6 @@ using Content.Server.UserInterface; using Content.Shared.ActionBlocker; using Content.Shared.Arcade; using Content.Shared.Interaction; -using Content.Shared.Interaction.Events; -using Content.Shared.NetIDs; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.GameObjects; @@ -25,7 +23,6 @@ namespace Content.Server.Arcade.Components [Dependency] private readonly IRobustRandom _random = default!; public override string Name => "BlockGameArcade"; - public override uint? NetID => ContentNetIDs.BLOCKGAME_ARCADE; [ComponentDependency] private readonly ApcPowerReceiverComponent? _powerReceiverComponent = default!; diff --git a/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs b/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs index d2aae64b6a..0e9f52b248 100644 --- a/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs +++ b/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs @@ -7,7 +7,6 @@ using Content.Server.WireHacking; using Content.Shared.ActionBlocker; using Content.Shared.Arcade; using Content.Shared.Interaction; -using Content.Shared.Interaction.Events; using Content.Shared.Wires; using Robust.Server.GameObjects; using Robust.Shared.Audio; diff --git a/Content.Server/Body/Surgery/Components/SurgeryToolComponent.cs b/Content.Server/Body/Surgery/Components/SurgeryToolComponent.cs index da11f79a34..248f3fb6fa 100644 --- a/Content.Server/Body/Surgery/Components/SurgeryToolComponent.cs +++ b/Content.Server/Body/Surgery/Components/SurgeryToolComponent.cs @@ -10,8 +10,6 @@ using Content.Shared.Body.Mechanism; using Content.Shared.Body.Part; using Content.Shared.Body.Surgery; using Content.Shared.Interaction; -using Content.Shared.NetIDs; -using Content.Shared.Notification; using Content.Shared.Notification.Managers; using Robust.Server.GameObjects; using Robust.Server.Player; @@ -31,7 +29,6 @@ namespace Content.Server.Body.Surgery.Components public class SurgeryToolComponent : Component, ISurgeon, IAfterInteract { public override string Name => "SurgeryTool"; - public override uint? NetID => ContentNetIDs.SURGERY; private readonly Dictionary _optionsCache = new(); diff --git a/Content.Server/Clothing/Components/ClothingComponent.cs b/Content.Server/Clothing/Components/ClothingComponent.cs index 04f8520538..7e29bfd9bf 100644 --- a/Content.Server/Clothing/Components/ClothingComponent.cs +++ b/Content.Server/Clothing/Components/ClothingComponent.cs @@ -4,9 +4,9 @@ using Content.Server.Items; using Content.Shared.Clothing; using Content.Shared.Interaction; using Content.Shared.Item; -using Content.Shared.NetIDs; using Content.Shared.Notification.Managers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Players; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -17,10 +17,10 @@ namespace Content.Server.Clothing.Components [RegisterComponent] [ComponentReference(typeof(SharedItemComponent))] [ComponentReference(typeof(ItemComponent))] + [NetworkedComponent()] public class ClothingComponent : ItemComponent, IUse { public override string Name => "Clothing"; - public override uint? NetID => ContentNetIDs.CLOTHING; [ViewVariables] [DataField("Slots")] diff --git a/Content.Server/Engineering/Components/DisassembleOnActivateComponent.cs b/Content.Server/Engineering/Components/DisassembleOnActivateComponent.cs index 214f22a46b..ac0be9c81b 100644 --- a/Content.Server/Engineering/Components/DisassembleOnActivateComponent.cs +++ b/Content.Server/Engineering/Components/DisassembleOnActivateComponent.cs @@ -1,6 +1,5 @@ #nullable enable using System.Threading; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager.Attributes; @@ -8,12 +7,11 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy using Robust.Shared.ViewVariables; namespace Content.Server.Engineering.Components - { - [RegisterComponent] - public class DisassembleOnActivateComponent : Component +{ + [RegisterComponent] + public class DisassembleOnActivateComponent : Component { public override string Name => "DisassembleOnActivate"; - public override uint? NetID => ContentNetIDs.DISASSEMBLE_ON_ACTIVATE; [ViewVariables] [DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer))] diff --git a/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs b/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs index 64958de3a5..10151b2086 100644 --- a/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs +++ b/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs @@ -1,5 +1,4 @@ #nullable enable -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager.Attributes; @@ -12,7 +11,6 @@ namespace Content.Server.Engineering.Components public class SpawnAfterInteractComponent : Component { public override string Name => "SpawnAfterInteract"; - public override uint? NetID => ContentNetIDs.SPAWN_AFTER_INTERACT; [ViewVariables] [DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer))] diff --git a/Content.Server/Entry/EntryPoint.cs b/Content.Server/Entry/EntryPoint.cs index 42b3130724..7f5e56b98e 100644 --- a/Content.Server/Entry/EntryPoint.cs +++ b/Content.Server/Entry/EntryPoint.cs @@ -1,4 +1,4 @@ -using Content.Server.Administration.Managers; +using Content.Server.Administration.Managers; using Content.Server.AI.Utility; using Content.Server.AI.Utility.Considerations; using Content.Server.AI.WorldState; @@ -56,6 +56,7 @@ namespace Content.Server.Entry } IoCManager.BuildGraph(); + factory.GenerateNetIds(); _euiManager = IoCManager.Resolve(); _voteManager = IoCManager.Resolve(); diff --git a/Content.Server/Kitchen/Components/ReagentGrinderComponent.cs b/Content.Server/Kitchen/Components/ReagentGrinderComponent.cs index 4a9ff99166..f66a8f5734 100644 --- a/Content.Server/Kitchen/Components/ReagentGrinderComponent.cs +++ b/Content.Server/Kitchen/Components/ReagentGrinderComponent.cs @@ -10,7 +10,6 @@ using Content.Server.UserInterface; using Content.Shared.Chemistry.Solution; using Content.Shared.Interaction; using Content.Shared.Kitchen.Components; -using Content.Shared.Notification; using Content.Shared.Notification.Managers; using Content.Shared.Random.Helpers; using Content.Shared.Tag; diff --git a/Content.Server/Light/Components/LightReplacerComponent.cs b/Content.Server/Light/Components/LightReplacerComponent.cs index a0490b913e..d086ddc882 100644 --- a/Content.Server/Light/Components/LightReplacerComponent.cs +++ b/Content.Server/Light/Components/LightReplacerComponent.cs @@ -3,8 +3,6 @@ using System; using System.Collections.Generic; using System.Linq; using Content.Server.Storage.Components; -using Content.Shared.NetIDs; -using Content.Shared.Notification; using Content.Shared.Notification.Managers; using Robust.Server.GameObjects; using Robust.Shared.Audio; @@ -27,7 +25,6 @@ namespace Content.Server.Light.Components public class LightReplacerComponent : Component { public override string Name => "LightReplacer"; - public override uint? NetID => ContentNetIDs.LIGHT_REPLACER; [DataField("sound")] private string _sound = "/Audio/Weapons/click.ogg"; diff --git a/Content.Server/Tools/Components/MultitoolComponent.cs b/Content.Server/Tools/Components/MultitoolComponent.cs index bc7508f373..410dc26a5a 100644 --- a/Content.Server/Tools/Components/MultitoolComponent.cs +++ b/Content.Server/Tools/Components/MultitoolComponent.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Content.Shared.Interaction; -using Content.Shared.NetIDs; using Content.Shared.Tool; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Player; using Robust.Shared.Players; using Robust.Shared.Serialization.Manager.Attributes; @@ -15,6 +15,7 @@ namespace Content.Server.Tools.Components /// Not to be confused with Multitool (power) /// [RegisterComponent] + [NetworkedComponent()] public class MultiToolComponent : Component, IUse { [DataDefinition] @@ -42,7 +43,6 @@ namespace Content.Server.Tools.Components } public override string Name => "MultiTool"; - public override uint? NetID => ContentNetIDs.MULTITOOLS; [DataField("tools")] private List _tools = new(); private int _currentTool = 0; diff --git a/Content.Server/Tools/Components/WelderComponent.cs b/Content.Server/Tools/Components/WelderComponent.cs index 2394ea0e39..a33ae7b55e 100644 --- a/Content.Server/Tools/Components/WelderComponent.cs +++ b/Content.Server/Tools/Components/WelderComponent.cs @@ -13,7 +13,6 @@ using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Solution.Components; using Content.Shared.Examine; using Content.Shared.Interaction; -using Content.Shared.NetIDs; using Content.Shared.Notification; using Content.Shared.Notification.Managers; using Content.Shared.Temperature; @@ -21,6 +20,7 @@ using Content.Shared.Tool; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Player; @@ -35,12 +35,12 @@ namespace Content.Server.Tools.Components [ComponentReference(typeof(ToolComponent))] [ComponentReference(typeof(IToolComponent))] [ComponentReference(typeof(IHotItem))] + [NetworkedComponent()] public class WelderComponent : ToolComponent, IExamine, IUse, ISuicideAct, ISolutionChange, IHotItem, IAfterInteract { [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; public override string Name => "Welder"; - public override uint? NetID => ContentNetIDs.WELDER; /// /// Default Cost of using the welder fuel for an action diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs index 55a74605eb..9d625d6d5d 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs @@ -5,7 +5,6 @@ using Content.Shared.ActionBlocker; using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; -using Content.Shared.NetIDs; using Content.Shared.Notification.Managers; using Content.Shared.Verbs; using Content.Shared.Weapons.Ranged.Barrels.Components; @@ -13,6 +12,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.Player; @@ -27,13 +27,13 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components /// Shotguns mostly /// [RegisterComponent] + [NetworkedComponent()] public sealed class BoltActionBarrelComponent : ServerRangedBarrelComponent, IMapInit, IExamine { // Originally I had this logic shared with PumpBarrel and used a couple of variables to control things // but it felt a lot messier to play around with, especially when adding verbs public override string Name => "BoltActionBarrel"; - public override uint? NetID => ContentNetIDs.BOLTACTION_BARREL; public override int ShotsLeft { diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs index df514a4417..5e543a81e5 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Content.Server.Weapon.Ranged.Ammunition.Components; using Content.Shared.Interaction; -using Content.Shared.NetIDs; using Content.Shared.Notification; using Content.Shared.Notification.Managers; using Content.Shared.Weapons.Ranged.Barrels.Components; @@ -10,6 +9,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.Player; @@ -25,10 +25,10 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components /// Bolt-action rifles /// [RegisterComponent] + [NetworkedComponent()] public sealed class PumpBarrelComponent : ServerRangedBarrelComponent, IMapInit, ISerializationHooks { public override string Name => "PumpBarrel"; - public override uint? NetID => ContentNetIDs.PUMP_BARREL; public override int ShotsLeft { diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/RevolverBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/RevolverBarrelComponent.cs index 4ec03a3b28..55c2504db5 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/RevolverBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/RevolverBarrelComponent.cs @@ -4,7 +4,6 @@ using Content.Server.Weapon.Ranged.Ammunition.Components; using Content.Shared.ActionBlocker; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; -using Content.Shared.NetIDs; using Content.Shared.Notification.Managers; using Content.Shared.Verbs; using Content.Shared.Weapons.Ranged.Barrels.Components; @@ -12,6 +11,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Map; @@ -25,12 +25,12 @@ using Robust.Shared.ViewVariables; namespace Content.Server.Weapon.Ranged.Barrels.Components { [RegisterComponent] + [NetworkedComponent()] public sealed class RevolverBarrelComponent : ServerRangedBarrelComponent, ISerializationHooks { [Dependency] private readonly IRobustRandom _random = default!; public override string Name => "RevolverBarrel"; - public override uint? NetID => ContentNetIDs.REVOLVER_BARREL; [ViewVariables] [DataField("caliber")] diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs index 9909470dac..60d61c3cb3 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs @@ -9,13 +9,13 @@ using Content.Shared.ActionBlocker; using Content.Shared.Damage; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; -using Content.Shared.NetIDs; using Content.Shared.Verbs; using Content.Shared.Weapons.Ranged.Barrels.Components; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.Player; @@ -26,10 +26,10 @@ using Robust.Shared.ViewVariables; namespace Content.Server.Weapon.Ranged.Barrels.Components { [RegisterComponent] + [NetworkedComponent()] public sealed class ServerBatteryBarrelComponent : ServerRangedBarrelComponent { public override string Name => "BatteryBarrel"; - public override uint? NetID => ContentNetIDs.BATTERY_BARREL; // The minimum change we need before we can fire [DataField("lowerChargeLimit")] diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerMagazineBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerMagazineBarrelComponent.cs index 15916e16bd..227aa658ed 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerMagazineBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerMagazineBarrelComponent.cs @@ -8,7 +8,6 @@ using Content.Shared.ActionBlocker; using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; -using Content.Shared.NetIDs; using Content.Shared.Notification.Managers; using Content.Shared.Verbs; using Content.Shared.Weapons.Ranged; @@ -17,6 +16,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.Player; @@ -28,10 +28,10 @@ using Robust.Shared.ViewVariables; namespace Content.Server.Weapon.Ranged.Barrels.Components { [RegisterComponent] + [NetworkedComponent()] public sealed class ServerMagazineBarrelComponent : ServerRangedBarrelComponent, IExamine { public override string Name => "MagazineBarrel"; - public override uint? NetID => ContentNetIDs.MAGAZINE_BARREL; [ViewVariables] private ContainerSlot _chamberContainer = default!; diff --git a/Content.Shared/Actions/Components/SharedActionsComponent.cs b/Content.Shared/Actions/Components/SharedActionsComponent.cs index 01e42498fd..e6ab446a71 100644 --- a/Content.Shared/Actions/Components/SharedActionsComponent.cs +++ b/Content.Shared/Actions/Components/SharedActionsComponent.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using Content.Shared.Actions.Prototypes; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Players; @@ -29,6 +29,7 @@ namespace Content.Shared.Actions.Components /// may be unusable while the player is stunned, but this component will still have an entry for the action /// so the user can see whether it's currently toggled on or off. /// + [NetworkedComponent()] public abstract class SharedActionsComponent : Component { private static readonly TimeSpan CooldownExpiryThreshold = TimeSpan.FromSeconds(10); @@ -41,7 +42,6 @@ namespace Content.Shared.Actions.Components protected readonly IEntityManager EntityManager = default!; public override string Name => "Actions"; - public override uint? NetID => ContentNetIDs.ACTIONS; /// /// Actions granted to this entity as soon as they spawn, regardless @@ -405,7 +405,7 @@ namespace Content.Shared.Actions.Components public Dictionary> ItemActions; public ActionComponentState(Dictionary actions, - Dictionary> itemActions) : base(ContentNetIDs.ACTIONS) + Dictionary> itemActions) { Actions = actions; ItemActions = itemActions; diff --git a/Content.Shared/Alert/SharedAlertsComponent.cs b/Content.Shared/Alert/SharedAlertsComponent.cs index d4af917cd0..5fc76cd33e 100644 --- a/Content.Shared/Alert/SharedAlertsComponent.cs +++ b/Content.Shared/Alert/SharedAlertsComponent.cs @@ -1,8 +1,8 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Players; @@ -15,13 +15,13 @@ namespace Content.Shared.Alert /// Handles the icons on the right side of the screen. /// Should only be used for player-controlled entities. /// + [NetworkedComponent()] public abstract class SharedAlertsComponent : Component { [Dependency] protected readonly AlertManager AlertManager = default!; public override string Name => "Alerts"; - public override uint? NetID => ContentNetIDs.ALERTS; [ViewVariables] private Dictionary _alerts = new(); @@ -169,7 +169,7 @@ namespace Content.Shared.Alert { public Dictionary Alerts; - public AlertsComponentState(Dictionary alerts) : base(ContentNetIDs.ALERTS) + public AlertsComponentState(Dictionary alerts) { Alerts = alerts; } diff --git a/Content.Shared/Arcade/SharedSpaceVillainArcadeComponent.cs b/Content.Shared/Arcade/SharedSpaceVillainArcadeComponent.cs index 7fb3d608db..e188d797eb 100644 --- a/Content.Shared/Arcade/SharedSpaceVillainArcadeComponent.cs +++ b/Content.Shared/Arcade/SharedSpaceVillainArcadeComponent.cs @@ -1,15 +1,13 @@ -#nullable enable +#nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; namespace Content.Shared.Arcade { - public class SharedSpaceVillainArcadeComponent : Component + public abstract class SharedSpaceVillainArcadeComponent : Component { public override string Name => "SpaceVillainArcade"; - public override uint? NetID => ContentNetIDs.SPACE_VILLAIN_ARCADE; [Serializable, NetSerializable] public enum Indicators diff --git a/Content.Shared/Atmos/Components/SharedGasAnalyzerComponent.cs b/Content.Shared/Atmos/Components/SharedGasAnalyzerComponent.cs index 0e0b3dab45..73f0a9d125 100644 --- a/Content.Shared/Atmos/Components/SharedGasAnalyzerComponent.cs +++ b/Content.Shared/Atmos/Components/SharedGasAnalyzerComponent.cs @@ -1,15 +1,15 @@ using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Localization; using Robust.Shared.Serialization; namespace Content.Shared.Atmos.Components { + [NetworkedComponent()] public class SharedGasAnalyzerComponent : Component { public override string Name => "GasAnalyzer"; - public override uint? NetID => ContentNetIDs.GAS_ANALYZER; [Serializable, NetSerializable] public enum GasAnalyzerUiKey @@ -77,7 +77,7 @@ namespace Content.Shared.Atmos.Components { public GasAnalyzerDanger Danger; - public GasAnalyzerComponentState(GasAnalyzerDanger danger) : base(ContentNetIDs.GAS_ANALYZER) + public GasAnalyzerComponentState(GasAnalyzerDanger danger) { Danger = danger; } diff --git a/Content.Shared/Body/Components/SharedBodyComponent.cs b/Content.Shared/Body/Components/SharedBodyComponent.cs index a0c67dafeb..115d174477 100644 --- a/Content.Shared/Body/Components/SharedBodyComponent.cs +++ b/Content.Shared/Body/Components/SharedBodyComponent.cs @@ -12,9 +12,9 @@ using Content.Shared.Body.Template; using Content.Shared.Damage; using Content.Shared.Damage.Components; using Content.Shared.Movement.Components; -using Content.Shared.NetIDs; using Content.Shared.Standing; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Players; using Robust.Shared.Prototypes; @@ -26,14 +26,14 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Body.Components { // TODO BODY Damage methods for collections of IDamageableComponents + + [NetworkedComponent()] public abstract class SharedBodyComponent : Component, IBodyPartContainer, ISerializationHooks { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public override string Name => "Body"; - public override uint? NetID => ContentNetIDs.BODY; - [ViewVariables] [DataField("template", required: true)] private string? TemplateId { get; } = default; @@ -711,7 +711,7 @@ namespace Content.Shared.Body.Components public readonly (string slot, EntityUid partId)[] PartIds; - public BodyComponentState((string slot, EntityUid partId)[] partIds) : base(ContentNetIDs.BODY) + public BodyComponentState((string slot, EntityUid partId)[] partIds) { PartIds = partIds; } diff --git a/Content.Shared/Body/Part/SharedBodyPartComponent.cs b/Content.Shared/Body/Part/SharedBodyPartComponent.cs index 81a390553c..a204d1eb86 100644 --- a/Content.Shared/Body/Part/SharedBodyPartComponent.cs +++ b/Content.Shared/Body/Part/SharedBodyPartComponent.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -8,8 +8,8 @@ using Content.Shared.Body.Components; using Content.Shared.Body.Mechanism; using Content.Shared.Body.Part.Property; using Content.Shared.Body.Surgery; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Players; @@ -20,12 +20,11 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Body.Part { + [NetworkedComponent()] public abstract class SharedBodyPartComponent : Component, IBodyPartContainer { public override string Name => "BodyPart"; - public override uint? NetID => ContentNetIDs.BODY_PART; - private SharedBodyComponent? _body; // TODO BODY Remove @@ -384,7 +383,7 @@ namespace Content.Shared.Body.Part public readonly EntityUid[] MechanismIds; - public BodyPartComponentState(EntityUid[] mechanismIds) : base(ContentNetIDs.BODY_PART) + public BodyPartComponentState(EntityUid[] mechanismIds) { MechanismIds = mechanismIds; } diff --git a/Content.Shared/Buckle/Components/SharedBuckleComponent.cs b/Content.Shared/Buckle/Components/SharedBuckleComponent.cs index 528c6eea74..ea50af6ec0 100644 --- a/Content.Shared/Buckle/Components/SharedBuckleComponent.cs +++ b/Content.Shared/Buckle/Components/SharedBuckleComponent.cs @@ -4,20 +4,19 @@ using Content.Shared.ActionBlocker; using Content.Shared.DragDrop; using Content.Shared.EffectBlocker; using Content.Shared.Interaction; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; namespace Content.Shared.Buckle.Components { + [NetworkedComponent()] public abstract class SharedBuckleComponent : Component, IActionBlocker, IEffectBlocker, IDraggable { public sealed override string Name => "Buckle"; - public sealed override uint? NetID => ContentNetIDs.BUCKLE; - /// /// The range from which this entity can buckle to a . /// @@ -64,7 +63,7 @@ namespace Content.Shared.Buckle.Components [Serializable, NetSerializable] public sealed class BuckleComponentState : ComponentState { - public BuckleComponentState(bool buckled, int? drawDepth, EntityUid? lastEntityBuckledTo, bool dontCollide) : base(ContentNetIDs.BUCKLE) + public BuckleComponentState(bool buckled, int? drawDepth, EntityUid? lastEntityBuckledTo, bool dontCollide) { Buckled = buckled; DrawDepth = drawDepth; diff --git a/Content.Shared/Buckle/Components/SharedStrapComponent.cs b/Content.Shared/Buckle/Components/SharedStrapComponent.cs index b9d090ee31..ad68e0b697 100644 --- a/Content.Shared/Buckle/Components/SharedStrapComponent.cs +++ b/Content.Shared/Buckle/Components/SharedStrapComponent.cs @@ -1,9 +1,9 @@ -#nullable enable +#nullable enable using System; using Content.Shared.DragDrop; using Content.Shared.Interaction.Helpers; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Buckle.Components @@ -26,12 +26,11 @@ namespace Content.Shared.Buckle.Components Down } + [NetworkedComponent()] public abstract class SharedStrapComponent : Component, IDragDropOn { public sealed override string Name => "Strap"; - public sealed override uint? NetID => ContentNetIDs.STRAP; - bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs) { if (!eventArgs.Dragged.TryGetComponent(out SharedBuckleComponent? buckleComponent)) return false; @@ -46,7 +45,7 @@ namespace Content.Shared.Buckle.Components [Serializable, NetSerializable] public sealed class StrapComponentState : ComponentState { - public StrapComponentState(StrapPosition position) : base(ContentNetIDs.BUCKLE) + public StrapComponentState(StrapPosition position) { Position = position; } diff --git a/Content.Shared/Camera/SharedCameraRecoilComponent.cs b/Content.Shared/Camera/SharedCameraRecoilComponent.cs index a19fb700dd..7161ded265 100644 --- a/Content.Shared/Camera/SharedCameraRecoilComponent.cs +++ b/Content.Shared/Camera/SharedCameraRecoilComponent.cs @@ -1,18 +1,17 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.Serialization; namespace Content.Shared.Camera { + [NetworkedComponent()] public abstract class SharedCameraRecoilComponent : Component { public sealed override string Name => "CameraRecoil"; - public override uint? NetID => ContentNetIDs.CAMERA_RECOIL; - public abstract void Kick(Vector2 recoil); [Serializable, NetSerializable] diff --git a/Content.Shared/Cargo/Components/SharedCargoOrderDatabaseComponent.cs b/Content.Shared/Cargo/Components/SharedCargoOrderDatabaseComponent.cs index c1331442f8..aa9a1219ce 100644 --- a/Content.Shared/Cargo/Components/SharedCargoOrderDatabaseComponent.cs +++ b/Content.Shared/Cargo/Components/SharedCargoOrderDatabaseComponent.cs @@ -1,16 +1,16 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Cargo.Components { + [NetworkedComponent()] public class SharedCargoOrderDatabaseComponent : Component { public sealed override string Name => "CargoOrderDatabase"; - public sealed override uint? NetID => ContentNetIDs.CARGO_ORDER_DATABASE; } [NetSerializable, Serializable] @@ -18,7 +18,7 @@ namespace Content.Shared.Cargo.Components { public readonly List? Orders; - public CargoOrderDatabaseState(List? orders) : base(ContentNetIDs.CARGO_ORDER_DATABASE) + public CargoOrderDatabaseState(List? orders) { Orders = orders; } diff --git a/Content.Shared/Cargo/Components/SharedGalacticMarketComponent.cs b/Content.Shared/Cargo/Components/SharedGalacticMarketComponent.cs index 70383d0e8a..af319fc76c 100644 --- a/Content.Shared/Cargo/Components/SharedGalacticMarketComponent.cs +++ b/Content.Shared/Cargo/Components/SharedGalacticMarketComponent.cs @@ -1,9 +1,9 @@ -#nullable enable +#nullable enable using System; using System.Collections; using System.Collections.Generic; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; @@ -11,10 +11,10 @@ using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Shared.Cargo.Components { + [NetworkedComponent()] public class SharedGalacticMarketComponent : Component, IEnumerable, ISerializationHooks { public sealed override string Name => "GalacticMarket"; - public sealed override uint? NetID => ContentNetIDs.GALACTIC_MARKET; [DataField("products")] protected List _productIds = new(); @@ -98,7 +98,7 @@ namespace Content.Shared.Cargo.Components public class GalacticMarketState : ComponentState { public List Products; - public GalacticMarketState(List technologies) : base(ContentNetIDs.GALACTIC_MARKET) + public GalacticMarketState(List technologies) { Products = technologies; } diff --git a/Content.Shared/CharacterAppearance/Components/SharedHumanoidAppearanceComponent.cs b/Content.Shared/CharacterAppearance/Components/SharedHumanoidAppearanceComponent.cs index b77093c23e..38da99afed 100644 --- a/Content.Shared/CharacterAppearance/Components/SharedHumanoidAppearanceComponent.cs +++ b/Content.Shared/CharacterAppearance/Components/SharedHumanoidAppearanceComponent.cs @@ -1,10 +1,10 @@ -#nullable enable +#nullable enable using System; -using Content.Shared.NetIDs; using Content.Shared.Preferences; using Robust.Shared.Enums; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components.Localization; +using Robust.Shared.GameStates; using Robust.Shared.Players; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; @@ -12,6 +12,7 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.CharacterAppearance.Components { + [NetworkedComponent()] public abstract class SharedHumanoidAppearanceComponent : Component { private HumanoidCharacterAppearance _appearance = HumanoidCharacterAppearance.Default(); @@ -19,7 +20,6 @@ namespace Content.Shared.CharacterAppearance.Components private Gender _gender; public sealed override string Name => "HumanoidAppearance"; - public sealed override uint? NetID => ContentNetIDs.HUMANOID_APPEARANCE; [DataField("categoriesHair")] [ViewVariables] @@ -105,8 +105,7 @@ namespace Content.Shared.CharacterAppearance.Components [NetSerializable] private sealed class HumanoidAppearanceComponentState : ComponentState { - public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex, Gender gender) : - base(ContentNetIDs.HUMANOID_APPEARANCE) + public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex, Gender gender) { Appearance = appearance; Sex = sex; diff --git a/Content.Shared/CharacterInfo/SharedCharacterInfoComponent.cs b/Content.Shared/CharacterInfo/SharedCharacterInfoComponent.cs index 813720839c..aae606b76f 100644 --- a/Content.Shared/CharacterInfo/SharedCharacterInfoComponent.cs +++ b/Content.Shared/CharacterInfo/SharedCharacterInfoComponent.cs @@ -1,17 +1,17 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; -using Content.Shared.NetIDs; using Content.Shared.Objectives; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.CharacterInfo { + [NetworkedComponent()] public class SharedCharacterInfoComponent : Component { public override string Name => "CharacterInfo"; - public override uint? NetID => ContentNetIDs.CHARACTERINFO; [Serializable, NetSerializable] protected class RequestCharacterInfoMessage : ComponentMessage diff --git a/Content.Shared/Chemistry/Components/SharedHyposprayComponent.cs b/Content.Shared/Chemistry/Components/SharedHyposprayComponent.cs index 5c6606eac5..b87ebff88f 100644 --- a/Content.Shared/Chemistry/Components/SharedHyposprayComponent.cs +++ b/Content.Shared/Chemistry/Components/SharedHyposprayComponent.cs @@ -1,16 +1,16 @@ -#nullable enable +#nullable enable using System; using Content.Shared.Chemistry.Reagent; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Chemistry.Components { + [NetworkedComponent()] public abstract class SharedHyposprayComponent : Component { public sealed override string Name => "Hypospray"; - public sealed override uint? NetID => ContentNetIDs.HYPOSPRAY; [Serializable, NetSerializable] protected sealed class HyposprayComponentState : ComponentState @@ -18,7 +18,7 @@ namespace Content.Shared.Chemistry.Components public ReagentUnit CurVolume { get; } public ReagentUnit MaxVolume { get; } - public HyposprayComponentState(ReagentUnit curVolume, ReagentUnit maxVolume) : base(ContentNetIDs.HYPOSPRAY) + public HyposprayComponentState(ReagentUnit curVolume, ReagentUnit maxVolume) { CurVolume = curVolume; MaxVolume = maxVolume; diff --git a/Content.Shared/Chemistry/Components/SharedInjectorComponent.cs b/Content.Shared/Chemistry/Components/SharedInjectorComponent.cs index 8c2ad4e365..f5adc2852d 100644 --- a/Content.Shared/Chemistry/Components/SharedInjectorComponent.cs +++ b/Content.Shared/Chemistry/Components/SharedInjectorComponent.cs @@ -1,8 +1,8 @@ -#nullable enable +#nullable enable using System; using Content.Shared.Chemistry.Reagent; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Chemistry.Components @@ -10,10 +10,10 @@ namespace Content.Shared.Chemistry.Components /// /// Shared class for injectors & syringes /// + [NetworkedComponent()] public class SharedInjectorComponent : Component { public override string Name => "Injector"; - public sealed override uint? NetID => ContentNetIDs.REAGENT_INJECTOR; /// /// Component data used for net updates. Used by client for item status ui @@ -25,7 +25,7 @@ namespace Content.Shared.Chemistry.Components public ReagentUnit TotalVolume { get; } public InjectorToggleMode CurrentMode { get; } - public InjectorComponentState(ReagentUnit currentVolume, ReagentUnit totalVolume, InjectorToggleMode currentMode) : base(ContentNetIDs.REAGENT_INJECTOR) + public InjectorComponentState(ReagentUnit currentVolume, ReagentUnit totalVolume, InjectorToggleMode currentMode) { CurrentVolume = currentVolume; TotalVolume = totalVolume; diff --git a/Content.Shared/Chemistry/Solution/Components/SharedSolutionContainerComponent.cs b/Content.Shared/Chemistry/Solution/Components/SharedSolutionContainerComponent.cs index 95946865e3..c37a7f4e55 100644 --- a/Content.Shared/Chemistry/Solution/Components/SharedSolutionContainerComponent.cs +++ b/Content.Shared/Chemistry/Solution/Components/SharedSolutionContainerComponent.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using Content.Shared.Chemistry.Reaction; using Content.Shared.Chemistry.Reagent; using Content.Shared.Examine; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Log; @@ -22,13 +22,11 @@ namespace Content.Shared.Chemistry.Solution.Components /// /// Holds a with a limited volume. /// + [NetworkedComponent()] public abstract class SharedSolutionContainerComponent : Component, IExamine, ISolutionInteractionsComponent { public override string Name => "SolutionContainer"; - /// - public sealed override uint? NetID => ContentNetIDs.SOLUTION; - [ViewVariables] [DataField("contents")] public Solution Solution { get; private set; } = new(); @@ -324,7 +322,7 @@ namespace Content.Shared.Chemistry.Solution.Components { public readonly Solution Solution; - public SolutionContainerComponentState(Solution solution) : base(ContentNetIDs.SOLUTION) + public SolutionContainerComponentState(Solution solution) { Solution = solution; } diff --git a/Content.Shared/Climbing/SharedClimbingComponent.cs b/Content.Shared/Climbing/SharedClimbingComponent.cs index c851593d3c..468696d3c9 100644 --- a/Content.Shared/Climbing/SharedClimbingComponent.cs +++ b/Content.Shared/Climbing/SharedClimbingComponent.cs @@ -1,19 +1,19 @@ #nullable enable using System; using Content.Shared.ActionBlocker; -using Content.Shared.NetIDs; using Content.Shared.Physics; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Physics; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Shared.Climbing { + [NetworkedComponent()] public abstract class SharedClimbingComponent : Component, IActionBlocker { public sealed override string Name => "Climbing"; - public sealed override uint? NetID => ContentNetIDs.CLIMBING; protected bool IsOnClimbableThisFrame { @@ -99,7 +99,7 @@ namespace Content.Shared.Climbing [Serializable, NetSerializable] protected sealed class ClimbModeComponentState : ComponentState { - public ClimbModeComponentState(bool climbing, bool isTransitioning) : base(ContentNetIDs.CLIMBING) + public ClimbModeComponentState(bool climbing, bool isTransitioning) { Climbing = climbing; IsTransitioning = isTransitioning; diff --git a/Content.Shared/Clothing/ClothingComponentState.cs b/Content.Shared/Clothing/ClothingComponentState.cs index 4427bf6cb5..71d55be319 100644 --- a/Content.Shared/Clothing/ClothingComponentState.cs +++ b/Content.Shared/Clothing/ClothingComponentState.cs @@ -1,6 +1,5 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -13,7 +12,7 @@ namespace Content.Shared.Clothing public string? EquippedPrefix { get; } - public ClothingComponentState(string? clothingEquippedPrefix, string? equippedPrefix) : base(ContentNetIDs.CLOTHING) + public ClothingComponentState(string? clothingEquippedPrefix, string? equippedPrefix) { ClothingEquippedPrefix = clothingEquippedPrefix; EquippedPrefix = equippedPrefix; diff --git a/Content.Shared/Clothing/SharedMagbootsComponent.cs b/Content.Shared/Clothing/SharedMagbootsComponent.cs index df7bf7a279..7756a4e792 100644 --- a/Content.Shared/Clothing/SharedMagbootsComponent.cs +++ b/Content.Shared/Clothing/SharedMagbootsComponent.cs @@ -1,16 +1,16 @@ -#nullable enable +#nullable enable using System; using Content.Shared.Movement.Components; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Clothing { + [NetworkedComponent()] public abstract class SharedMagbootsComponent : Component, IMoveSpeedModifier { public sealed override string Name => "Magboots"; - public sealed override uint? NetID => ContentNetIDs.MAGBOOTS; public abstract bool On { get; set; } @@ -28,7 +28,7 @@ namespace Content.Shared.Clothing { public bool On { get; } - public MagbootsComponentState(bool @on) : base(ContentNetIDs.MAGBOOTS) + public MagbootsComponentState(bool @on) { On = on; } diff --git a/Content.Shared/CombatMode/SharedCombatModeComponent.cs b/Content.Shared/CombatMode/SharedCombatModeComponent.cs index 11182e1680..54b649ad7b 100644 --- a/Content.Shared/CombatMode/SharedCombatModeComponent.cs +++ b/Content.Shared/CombatMode/SharedCombatModeComponent.cs @@ -1,17 +1,17 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Content.Shared.Targeting; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Players; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Shared.CombatMode { + [NetworkedComponent()] public abstract class SharedCombatModeComponent : Component { - public sealed override uint? NetID => ContentNetIDs.COMBATMODE; public override string Name => "CombatMode"; private bool _isInCombatMode; @@ -78,7 +78,6 @@ namespace Content.Shared.CombatMode public TargetingZone TargetingZone { get; } public CombatModeComponentState(bool isInCombatMode, TargetingZone targetingZone) - : base(ContentNetIDs.COMBATMODE) { IsInCombatMode = isInCombatMode; TargetingZone = targetingZone; diff --git a/Content.Shared/Cooldown/ItemCooldownComponent.cs b/Content.Shared/Cooldown/ItemCooldownComponent.cs index 10a4fe21ee..329d52be51 100644 --- a/Content.Shared/Cooldown/ItemCooldownComponent.cs +++ b/Content.Shared/Cooldown/ItemCooldownComponent.cs @@ -1,7 +1,7 @@ -#nullable enable +#nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Players; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; @@ -12,10 +12,10 @@ namespace Content.Shared.Cooldown /// Stores a visual "cooldown" for items, that gets displayed in the hands GUI. /// [RegisterComponent] + [NetworkedComponent()] public sealed class ItemCooldownComponent : Component { public override string Name => "ItemCooldown"; - public override uint? NetID => ContentNetIDs.ITEMCOOLDOWN; private TimeSpan? _cooldownEnd; private TimeSpan? _cooldownStart; @@ -80,8 +80,7 @@ namespace Content.Shared.Cooldown public TimeSpan? CooldownStart { get; set; } public TimeSpan? CooldownEnd { get; set; } - public ItemCooldownComponentState() : base(ContentNetIDs.ITEMCOOLDOWN) - { + public ItemCooldownComponentState() { } } } diff --git a/Content.Shared/Crayon/SharedCrayonComponent.cs b/Content.Shared/Crayon/SharedCrayonComponent.cs index 129e114fee..525d4fec78 100644 --- a/Content.Shared/Crayon/SharedCrayonComponent.cs +++ b/Content.Shared/Crayon/SharedCrayonComponent.cs @@ -1,8 +1,8 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; @@ -11,10 +11,10 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Crayon { + [NetworkedComponent()] public class SharedCrayonComponent : Component { public override string Name => "Crayon"; - public override uint? NetID => ContentNetIDs.CRAYONS; public string SelectedState { get; set; } = string.Empty; @@ -54,7 +54,7 @@ namespace Content.Shared.Crayon public readonly int Charges; public readonly int Capacity; - public CrayonComponentState(string color, string state, int charges, int capacity) : base(ContentNetIDs.CRAYONS) + public CrayonComponentState(string color, string state, int charges, int capacity) { Color = color; State = state; diff --git a/Content.Shared/Cuffs/Components/SharedCuffableComponent.cs b/Content.Shared/Cuffs/Components/SharedCuffableComponent.cs index 7283b31e8e..f8a7698c09 100644 --- a/Content.Shared/Cuffs/Components/SharedCuffableComponent.cs +++ b/Content.Shared/Cuffs/Components/SharedCuffableComponent.cs @@ -1,19 +1,19 @@ -#nullable enable +#nullable enable using System; using Content.Shared.ActionBlocker; -using Content.Shared.NetIDs; using Content.Shared.Pulling.Components; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Shared.Cuffs.Components { + [NetworkedComponent()] public class SharedCuffableComponent : Component, IActionBlocker { public override string Name => "Cuffable"; - public override uint? NetID => ContentNetIDs.CUFFED; [ComponentDependency] private readonly SharedPullableComponent? _pullable = default!; @@ -42,7 +42,7 @@ namespace Content.Shared.Cuffs.Components public string IconState { get; } public Color Color { get; } - public CuffableComponentState(int numHandsCuffed, bool canStillInteract, string? rsiPath, string iconState, Color color) : base(ContentNetIDs.CUFFED) + public CuffableComponentState(int numHandsCuffed, bool canStillInteract, string? rsiPath, string iconState, Color color) { NumHandsCuffed = numHandsCuffed; CanStillInteract = canStillInteract; diff --git a/Content.Shared/Cuffs/Components/SharedHandcuffComponent.cs b/Content.Shared/Cuffs/Components/SharedHandcuffComponent.cs index 203871e44f..31af149097 100644 --- a/Content.Shared/Cuffs/Components/SharedHandcuffComponent.cs +++ b/Content.Shared/Cuffs/Components/SharedHandcuffComponent.cs @@ -1,22 +1,22 @@ -#nullable enable +#nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Cuffs.Components { + [NetworkedComponent()] public abstract class SharedHandcuffComponent : Component { public override string Name => "Handcuff"; - public override uint? NetID => ContentNetIDs.HANDCUFFS; [Serializable, NetSerializable] protected sealed class HandcuffedComponentState : ComponentState { public string? IconState { get; } - public HandcuffedComponentState(string? iconState) : base(ContentNetIDs.HANDCUFFS) + public HandcuffedComponentState(string? iconState) { IconState = iconState; } diff --git a/Content.Shared/Damage/Components/DamageableComponent.cs b/Content.Shared/Damage/Components/DamageableComponent.cs index 73acfab3ab..a46808ca9d 100644 --- a/Content.Shared/Damage/Components/DamageableComponent.cs +++ b/Content.Shared/Damage/Components/DamageableComponent.cs @@ -5,9 +5,9 @@ using System.Linq; using Content.Shared.Acts; using Content.Shared.Damage.Container; using Content.Shared.Damage.Resistances; -using Content.Shared.NetIDs; using Content.Shared.Radiation; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Players; using Robust.Shared.Prototypes; @@ -23,12 +23,11 @@ namespace Content.Shared.Damage.Components /// [RegisterComponent] [ComponentReference(typeof(IDamageableComponent))] + [NetworkedComponent()] public class DamageableComponent : Component, IDamageableComponent, IRadiationAct, ISerializationHooks { public override string Name => "Damageable"; - public override uint? NetID => ContentNetIDs.DAMAGEABLE; - // TODO define these in yaml? public const string DefaultResistanceSet = "defaultResistances"; public const string DefaultDamageContainer = "metallicDamageContainer"; @@ -411,7 +410,7 @@ namespace Content.Shared.Damage.Components { public readonly Dictionary DamageList; - public DamageableComponentState(Dictionary damageList) : base(ContentNetIDs.DAMAGEABLE) + public DamageableComponentState(Dictionary damageList) { DamageList = damageList; } diff --git a/Content.Shared/DoAfter/SharedDoAfterComponent.cs b/Content.Shared/DoAfter/SharedDoAfterComponent.cs index e128540463..ddea2d747f 100644 --- a/Content.Shared/DoAfter/SharedDoAfterComponent.cs +++ b/Content.Shared/DoAfter/SharedDoAfterComponent.cs @@ -1,18 +1,17 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Serialization; namespace Content.Shared.DoAfter { + [NetworkedComponent()] public abstract class SharedDoAfterComponent : Component { public override string Name => "DoAfter"; - - public override uint? NetID => ContentNetIDs.DO_AFTER; } [Serializable, NetSerializable] @@ -20,7 +19,7 @@ namespace Content.Shared.DoAfter { public List DoAfters { get; } - public DoAfterComponentState(List doAfters) : base(ContentNetIDs.DO_AFTER) + public DoAfterComponentState(List doAfters) { DoAfters = doAfters; } diff --git a/Content.Shared/Doors/SharedDoorComponent.cs b/Content.Shared/Doors/SharedDoorComponent.cs index 14e584f317..6de0068f44 100644 --- a/Content.Shared/Doors/SharedDoorComponent.cs +++ b/Content.Shared/Doors/SharedDoorComponent.cs @@ -1,8 +1,8 @@ #nullable enable using System; using System.Collections.Generic; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Physics; using Robust.Shared.Serialization; @@ -12,10 +12,10 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Doors { + [NetworkedComponent()] public abstract class SharedDoorComponent : Component { public override string Name => "Door"; - public override uint? NetID => ContentNetIDs.DOOR; [ComponentDependency] protected readonly SharedAppearanceComponent? AppearanceComponent = null; @@ -167,7 +167,7 @@ namespace Content.Shared.Doors public readonly List CurrentlyCrushing; public readonly TimeSpan CurTime; - public DoorComponentState(SharedDoorComponent.DoorState doorState, TimeSpan? startTime, List currentlyCrushing, TimeSpan curTime) : base(ContentNetIDs.DOOR) + public DoorComponentState(SharedDoorComponent.DoorState doorState, TimeSpan? startTime, List currentlyCrushing, TimeSpan curTime) { DoorState = doorState; StartTime = startTime; diff --git a/Content.Shared/Flash/SharedFlashableComponent.cs b/Content.Shared/Flash/SharedFlashableComponent.cs index 76420f86dd..702fd6502d 100644 --- a/Content.Shared/Flash/SharedFlashableComponent.cs +++ b/Content.Shared/Flash/SharedFlashableComponent.cs @@ -1,15 +1,15 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Flash { + [NetworkedComponent()] public class SharedFlashableComponent : Component { public override string Name => "Flashable"; - public override uint? NetID => ContentNetIDs.FLASHABLE; } [Serializable, NetSerializable] @@ -18,7 +18,7 @@ namespace Content.Shared.Flash public double Duration { get; } public TimeSpan Time { get; } - public FlashComponentState(double duration, TimeSpan time) : base(ContentNetIDs.FLASHABLE) + public FlashComponentState(double duration, TimeSpan time) { Duration = duration; Time = time; diff --git a/Content.Shared/Friction/TileFrictionModifier.cs b/Content.Shared/Friction/TileFrictionModifier.cs index 922a795d71..dcf2191af0 100644 --- a/Content.Shared/Friction/TileFrictionModifier.cs +++ b/Content.Shared/Friction/TileFrictionModifier.cs @@ -1,6 +1,5 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; using Robust.Shared.Maths; using Robust.Shared.Players; @@ -50,7 +49,7 @@ namespace Content.Shared.Friction { public float Modifier; - public TileFrictionComponentState(float modifier) : base(ContentNetIDs.TILE_FRICTION) + public TileFrictionComponentState(float modifier) { Modifier = modifier; } diff --git a/Content.Shared/Ghost/SharedGhostComponent.cs b/Content.Shared/Ghost/SharedGhostComponent.cs index bc24fe9eca..77806356ac 100644 --- a/Content.Shared/Ghost/SharedGhostComponent.cs +++ b/Content.Shared/Ghost/SharedGhostComponent.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using Content.Shared.ActionBlocker; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Players; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; @@ -10,10 +10,10 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Ghost { + [NetworkedComponent()] public class SharedGhostComponent : Component, IActionBlocker { public override string Name => "Ghost"; - public override uint? NetID => ContentNetIDs.GHOST; /// /// Changed by @@ -61,7 +61,6 @@ namespace Content.Shared.Ghost bool canReturnToBody, HashSet? locationWarps = null, Dictionary? playerWarps = null) - : base(ContentNetIDs.GHOST) { CanReturnToBody = canReturnToBody; LocationWarps = locationWarps; diff --git a/Content.Shared/Gravity/GravityComponent.cs b/Content.Shared/Gravity/GravityComponent.cs index 3dae237516..b200a32b04 100644 --- a/Content.Shared/Gravity/GravityComponent.cs +++ b/Content.Shared/Gravity/GravityComponent.cs @@ -1,6 +1,6 @@ using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Log; using Robust.Shared.Players; using Robust.Shared.Serialization; @@ -9,10 +9,10 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Gravity { [RegisterComponent] + [NetworkedComponent] public sealed class GravityComponent : Component { public override string Name => "Gravity"; - public override uint? NetID => ContentNetIDs.GRAVITY; [ViewVariables(VVAccess.ReadWrite)] public bool Enabled @@ -53,7 +53,7 @@ namespace Content.Shared.Gravity { public bool Enabled { get; } - public GravityComponentState(bool enabled) : base(ContentNetIDs.GRAVITY) + public GravityComponentState(bool enabled) { Enabled = enabled; } diff --git a/Content.Shared/Gravity/SharedGravityGeneratorComponent.cs b/Content.Shared/Gravity/SharedGravityGeneratorComponent.cs index 7706182343..dd5070b2ec 100644 --- a/Content.Shared/Gravity/SharedGravityGeneratorComponent.cs +++ b/Content.Shared/Gravity/SharedGravityGeneratorComponent.cs @@ -1,17 +1,16 @@ -#nullable enable +#nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Gravity { + [NetworkedComponent()] public class SharedGravityGeneratorComponent : Component { public override string Name => "GravityGenerator"; - public override uint? NetID => ContentNetIDs.GRAVITY_GENERATOR; - /// /// Sent to the server to set whether the generator should be on or off /// diff --git a/Content.Shared/Hands/Components/SharedHandsComponent.cs b/Content.Shared/Hands/Components/SharedHandsComponent.cs index fb02eefccc..dbcafe26c1 100644 --- a/Content.Shared/Hands/Components/SharedHandsComponent.cs +++ b/Content.Shared/Hands/Components/SharedHandsComponent.cs @@ -5,9 +5,9 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using Content.Shared.ActionBlocker; using Content.Shared.Interaction; -using Content.Shared.NetIDs; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; @@ -19,12 +19,11 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Hands.Components { + [NetworkedComponent()] public abstract class SharedHandsComponent : Component, ISharedHandsComponent { public sealed override string Name => "Hands"; - public sealed override uint? NetID => ContentNetIDs.HANDS; - public event Action? OnItemChanged; //TODO: Try to replace C# event /// @@ -867,7 +866,7 @@ namespace Content.Shared.Hands.Components public HandState[] Hands { get; } public string? ActiveHand { get; } - public HandsComponentState(HandState[] hands, string? activeHand = null) : base(ContentNetIDs.HANDS) + public HandsComponentState(HandState[] hands, string? activeHand = null) { Hands = hands; ActiveHand = activeHand; diff --git a/Content.Shared/Instruments/SharedInstrumentComponent.cs b/Content.Shared/Instruments/SharedInstrumentComponent.cs index 3f2064e16d..f19c1ff53f 100644 --- a/Content.Shared/Instruments/SharedInstrumentComponent.cs +++ b/Content.Shared/Instruments/SharedInstrumentComponent.cs @@ -1,17 +1,17 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.Audio.Midi; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Shared.Instruments { + [NetworkedComponent()] public class SharedInstrumentComponent : Component { public override string Name => "Instrument"; - public override uint? NetID => ContentNetIDs.INSTRUMENTS; [ViewVariables(VVAccess.ReadWrite)] public virtual byte InstrumentProgram { get; set; } @@ -75,7 +75,7 @@ namespace Content.Shared.Instruments public bool AllowProgramChange { get; } public bool RespectMidiLimits { get; } - public InstrumentState(bool playing, byte instrumentProgram, byte instrumentBank, bool allowPercussion, bool allowProgramChange, bool respectMidiLimits, uint sequencerTick = 0) : base(ContentNetIDs.INSTRUMENTS) + public InstrumentState(bool playing, byte instrumentProgram, byte instrumentBank, bool allowPercussion, bool allowProgramChange, bool respectMidiLimits, uint sequencerTick = 0) { Playing = playing; InstrumentProgram = instrumentProgram; diff --git a/Content.Shared/Inventory/SharedInventoryComponent.cs b/Content.Shared/Inventory/SharedInventoryComponent.cs index 87f824f62d..ec7ba4157c 100644 --- a/Content.Shared/Inventory/SharedInventoryComponent.cs +++ b/Content.Shared/Inventory/SharedInventoryComponent.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; using Content.Shared.Movement.Components; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Reflection; using Robust.Shared.Serialization; @@ -13,13 +13,13 @@ using static Content.Shared.Inventory.EquipmentSlotDefines; namespace Content.Shared.Inventory { + [NetworkedComponent()] public abstract class SharedInventoryComponent : Component, IMoveSpeedModifier { [Dependency] protected readonly IReflectionManager ReflectionManager = default!; [Dependency] protected readonly IDynamicTypeFactory DynamicTypeFactory = default!; public sealed override string Name => "Inventory"; - public sealed override uint? NetID => ContentNetIDs.STORAGE; [ViewVariables] protected Inventory InventoryInstance { get; private set; } = default!; @@ -52,7 +52,7 @@ namespace Content.Shared.Inventory public List> Entities { get; } public KeyValuePair? HoverEntity { get; } - public InventoryComponentState(List> entities, KeyValuePair? hoverEntity = null) : base(ContentNetIDs.STORAGE) + public InventoryComponentState(List> entities, KeyValuePair? hoverEntity = null) { Entities = entities; HoverEntity = hoverEntity; diff --git a/Content.Shared/Item/SharedItemComponent.cs b/Content.Shared/Item/SharedItemComponent.cs index b8af477798..74c4c83cd5 100644 --- a/Content.Shared/Item/SharedItemComponent.cs +++ b/Content.Shared/Item/SharedItemComponent.cs @@ -5,8 +5,8 @@ using Content.Shared.Hands.Components; using Content.Shared.Interaction; using Content.Shared.Interaction.Helpers; using Content.Shared.Inventory; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Players; @@ -19,12 +19,11 @@ namespace Content.Shared.Item /// /// Players can pick up, drop, and put items in bags, and they can be seen in player's hands. /// + [NetworkedComponent()] public abstract class SharedItemComponent : Component, IEquipped, IUnequipped, IInteractHand { public override string Name => "Item"; - public override uint? NetID => ContentNetIDs.ITEM; - /// /// How much big this item is. /// @@ -169,7 +168,7 @@ namespace Content.Shared.Item public Color Color { get; } public string? RsiPath { get; } - public ItemComponentState(int size, string? equippedPrefix, Color color, string? rsiPath) : base(ContentNetIDs.ITEM) + public ItemComponentState(int size, string? equippedPrefix, Color color, string? rsiPath) { Size = size; EquippedPrefix = equippedPrefix; diff --git a/Content.Shared/Kitchen/Components/SharedMicrowaveComponent.cs b/Content.Shared/Kitchen/Components/SharedMicrowaveComponent.cs index fb607f37e8..d23cb794a1 100644 --- a/Content.Shared/Kitchen/Components/SharedMicrowaveComponent.cs +++ b/Content.Shared/Kitchen/Components/SharedMicrowaveComponent.cs @@ -1,18 +1,18 @@ #nullable enable using System; using Content.Shared.Chemistry.Solution; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Kitchen.Components { + [NetworkedComponent()] public class SharedMicrowaveComponent : Component { public override string Name => "Microwave"; - public override uint? NetID => ContentNetIDs.MICROWAVE; [Serializable, NetSerializable] public class MicrowaveStartCookMessage : BoundUserInterfaceMessage diff --git a/Content.Shared/Kitchen/Components/SharedReagentGrinderComponent.cs b/Content.Shared/Kitchen/Components/SharedReagentGrinderComponent.cs index be769407c4..758f6794ed 100644 --- a/Content.Shared/Kitchen/Components/SharedReagentGrinderComponent.cs +++ b/Content.Shared/Kitchen/Components/SharedReagentGrinderComponent.cs @@ -1,7 +1,6 @@ -#nullable enable +#nullable enable using System; using Content.Shared.Chemistry.Solution; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -10,7 +9,6 @@ namespace Content.Shared.Kitchen.Components public abstract class SharedReagentGrinderComponent : Component { public override string Name => "ReagentGrinder"; - public override uint? NetID => ContentNetIDs.REAGENT_GRINDER; [Serializable, NetSerializable] public class ReagentGrinderGrindStartMessage : BoundUserInterfaceMessage diff --git a/Content.Shared/Lathe/SharedLatheComponent.cs b/Content.Shared/Lathe/SharedLatheComponent.cs index 1979048842..d57696bf9f 100644 --- a/Content.Shared/Lathe/SharedLatheComponent.cs +++ b/Content.Shared/Lathe/SharedLatheComponent.cs @@ -1,21 +1,21 @@ #nullable enable using System; using System.Collections.Generic; -using Content.Shared.NetIDs; using Content.Shared.Research.Prototypes; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared.Lathe { + [NetworkedComponent()] public class SharedLatheComponent : Component { [Dependency] protected readonly IPrototypeManager PrototypeManager = default!; public override string Name => "Lathe"; - public override uint? NetID => ContentNetIDs.LATHE; public bool CanProduce(LatheRecipePrototype recipe, int quantity = 1) { diff --git a/Content.Shared/Lathe/SharedLatheDatabaseComponent.cs b/Content.Shared/Lathe/SharedLatheDatabaseComponent.cs index d107c51bf3..5fbe7ef301 100644 --- a/Content.Shared/Lathe/SharedLatheDatabaseComponent.cs +++ b/Content.Shared/Lathe/SharedLatheDatabaseComponent.cs @@ -2,9 +2,9 @@ using System; using System.Collections; using System.Collections.Generic; -using Content.Shared.NetIDs; using Content.Shared.Research.Prototypes; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; @@ -12,10 +12,10 @@ using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Shared.Lathe { + [NetworkedComponent()] public class SharedLatheDatabaseComponent : Component, IEnumerable, ISerializationHooks { public override string Name => "LatheDatabase"; - public override uint? NetID => ContentNetIDs.LATHE_DATABASE; [DataField("recipes")] private List _recipeIds = new(); @@ -127,7 +127,7 @@ namespace Content.Shared.Lathe public class LatheDatabaseState : ComponentState { public readonly List Recipes; - public LatheDatabaseState(List recipes) : base(ContentNetIDs.LATHE_DATABASE) + public LatheDatabaseState(List recipes) { Recipes = recipes; } diff --git a/Content.Shared/Lathe/SharedMaterialStorageComponent.cs b/Content.Shared/Lathe/SharedMaterialStorageComponent.cs index fd74793f1d..ecd996795a 100644 --- a/Content.Shared/Lathe/SharedMaterialStorageComponent.cs +++ b/Content.Shared/Lathe/SharedMaterialStorageComponent.cs @@ -3,17 +3,17 @@ using System; using System.Collections; using System.Collections.Generic; using Content.Shared.Materials; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Shared.Lathe { + [NetworkedComponent()] public class SharedMaterialStorageComponent : Component, IEnumerable> { public override string Name => "MaterialStorage"; - public sealed override uint? NetID => ContentNetIDs.MATERIAL_STORAGE; [ViewVariables] protected virtual Dictionary Storage { get; set; } = new(); @@ -72,7 +72,7 @@ namespace Content.Shared.Lathe public class MaterialStorageState : ComponentState { public readonly Dictionary Storage; - public MaterialStorageState(Dictionary storage) : base(ContentNetIDs.MATERIAL_STORAGE) + public MaterialStorageState(Dictionary storage) { Storage = storage; } diff --git a/Content.Shared/Lathe/SharedProtolatheDatabaseComponent.cs b/Content.Shared/Lathe/SharedProtolatheDatabaseComponent.cs index f6dc665d27..6c42221575 100644 --- a/Content.Shared/Lathe/SharedProtolatheDatabaseComponent.cs +++ b/Content.Shared/Lathe/SharedProtolatheDatabaseComponent.cs @@ -1,9 +1,9 @@ #nullable enable using System; using System.Collections.Generic; -using Content.Shared.NetIDs; using Content.Shared.Research.Prototypes; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; @@ -12,14 +12,13 @@ using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Shared.Lathe { [ComponentReference(typeof(SharedLatheDatabaseComponent))] + [NetworkedComponent()] public class SharedProtolatheDatabaseComponent : SharedLatheDatabaseComponent, ISerializationHooks { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public override string Name => "ProtolatheDatabase"; - public sealed override uint? NetID => ContentNetIDs.PROTOLATHE_DATABASE; - [DataField("protolatherecipes")] private List _recipeIds = new(); /// @@ -41,7 +40,7 @@ namespace Content.Shared.Lathe public class ProtolatheDatabaseState : ComponentState { public readonly List Recipes; - public ProtolatheDatabaseState(List recipes) : base(ContentNetIDs.PROTOLATHE_DATABASE) + public ProtolatheDatabaseState(List recipes) { Recipes = recipes; } diff --git a/Content.Shared/Light/Component/SharedHandheldLightComponent.cs b/Content.Shared/Light/Component/SharedHandheldLightComponent.cs index b8e1393557..6e0d68136f 100644 --- a/Content.Shared/Light/Component/SharedHandheldLightComponent.cs +++ b/Content.Shared/Light/Component/SharedHandheldLightComponent.cs @@ -1,15 +1,15 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Light.Component { + [NetworkedComponent()] public abstract class SharedHandheldLightComponent : Robust.Shared.GameObjects.Component { public sealed override string Name => "HandheldLight"; - public sealed override uint? NetID => ContentNetIDs.HANDHELD_LIGHT; protected abstract bool HasCell { get; } @@ -20,7 +20,7 @@ namespace Content.Shared.Light.Component { public byte? Charge { get; } - public HandheldLightComponentState(byte? charge) : base(ContentNetIDs.HANDHELD_LIGHT) + public HandheldLightComponentState(byte? charge) { Charge = charge; } diff --git a/Content.Shared/MobState/Components/SharedMobStateComponent.cs b/Content.Shared/MobState/Components/SharedMobStateComponent.cs index ffc8112549..c5df49b537 100644 --- a/Content.Shared/MobState/Components/SharedMobStateComponent.cs +++ b/Content.Shared/MobState/Components/SharedMobStateComponent.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -8,8 +8,8 @@ using Content.Shared.Alert; using Content.Shared.Damage; using Content.Shared.Damage.Components; using Content.Shared.MobState.State; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Players; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; @@ -23,12 +23,11 @@ namespace Content.Shared.MobState.Components /// Additionally, it handles sending effects to clients /// (such as blur effect for unconsciousness) and managing the health HUD. /// + [NetworkedComponent()] public abstract class SharedMobStateComponent : Component, IMobStateComponent, IActionBlocker { public override string Name => "MobState"; - public override uint? NetID => ContentNetIDs.MOB_STATE; - /// /// States that this mapped to /// the amount of damage at which they are triggered. @@ -401,7 +400,7 @@ namespace Content.Shared.MobState.Components { public readonly int? CurrentThreshold; - public MobStateComponentState(int? currentThreshold) : base(ContentNetIDs.MOB_STATE) + public MobStateComponentState(int? currentThreshold) { CurrentThreshold = currentThreshold; } diff --git a/Content.Shared/Movement/Components/SharedPlayerInputMoverComponent.cs b/Content.Shared/Movement/Components/SharedPlayerInputMoverComponent.cs index bef136a2d2..33fa733144 100644 --- a/Content.Shared/Movement/Components/SharedPlayerInputMoverComponent.cs +++ b/Content.Shared/Movement/Components/SharedPlayerInputMoverComponent.cs @@ -1,9 +1,9 @@ -#nullable enable +#nullable enable using System; using Content.Shared.CCVar; -using Content.Shared.NetIDs; using Robust.Shared.Configuration; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Maths; using Robust.Shared.Players; @@ -15,6 +15,7 @@ namespace Content.Shared.Movement.Components { [RegisterComponent] [ComponentReference(typeof(IMoverComponent))] + [NetworkedComponent()] public class SharedPlayerInputMoverComponent : Component, IMoverComponent { // This class has to be able to handle server TPS being lower than client FPS. @@ -42,7 +43,6 @@ namespace Content.Shared.Movement.Components [ComponentDependency] private readonly MovementSpeedModifierComponent? _movementSpeed = default!; public override string Name => "PlayerInputMover"; - public override uint? NetID => ContentNetIDs.PLAYER_INPUT_MOVER; private GameTick _lastInputTick; private ushort _lastInputSubTick; @@ -238,8 +238,7 @@ namespace Content.Shared.Movement.Components { public MoveButtons Buttons { get; } - public MoverComponentState(MoveButtons buttons) : base(ContentNetIDs - .PLAYER_INPUT_MOVER) + public MoverComponentState(MoveButtons buttons) { Buttons = buttons; } diff --git a/Content.Shared/Movement/Components/SharedPlayerMobMoverComponent.cs b/Content.Shared/Movement/Components/SharedPlayerMobMoverComponent.cs index 6f51f4f20c..ba0378744f 100644 --- a/Content.Shared/Movement/Components/SharedPlayerMobMoverComponent.cs +++ b/Content.Shared/Movement/Components/SharedPlayerMobMoverComponent.cs @@ -1,7 +1,7 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Players; @@ -16,10 +16,10 @@ namespace Content.Shared.Movement.Components /// [RegisterComponent] [ComponentReference(typeof(IMobMoverComponent))] + [NetworkedComponent()] public class SharedPlayerMobMoverComponent : Component, IMobMoverComponent { public override string Name => "PlayerMobMover"; - public override uint? NetID => ContentNetIDs.PLAYER_MOB_MOVER; private float _stepSoundDistance; [DataField("grabRange")] @@ -112,7 +112,7 @@ namespace Content.Shared.Movement.Components public float PushStrength; public float WeightlessStrength; - public PlayerMobMoverComponentState(float grabRange, float pushStrength, float weightlessStrength) : base(ContentNetIDs.PLAYER_MOB_MOVER) + public PlayerMobMoverComponentState(float grabRange, float pushStrength, float weightlessStrength) { GrabRange = grabRange; PushStrength = pushStrength; diff --git a/Content.Shared/NetIDs/ContentNetIDs.cs b/Content.Shared/NetIDs/ContentNetIDs.cs deleted file mode 100644 index 6de59e53ac..0000000000 --- a/Content.Shared/NetIDs/ContentNetIDs.cs +++ /dev/null @@ -1,108 +0,0 @@ -#nullable enable - -namespace Content.Shared.NetIDs -{ - // Starting from 1000 to avoid crossover with engine. - public static class ContentNetIDs - { - // As a CMO main I hereby declare the hypospray worthy of ID #1000. - public const uint HYPOSPRAY = 1000; - public const uint DESTRUCTIBLE = 1001; - public const uint MAGAZINE_BARREL = 1002; - public const uint HANDS = 1003; - public const uint SOLUTION = 1004; - public const uint STORAGE = 1005; - public const uint INVENTORY = 1006; - public const uint POWER_DEBUG_TOOL = 1007; - public const uint PLAYER_MOB_MOVER = 1008; - public const uint TILE_FRICTION = 1009; - public const uint RANGED_WEAPON = 1010; - public const uint CAMERA_RECOIL = 1011; - public const uint SOUND = 1012; - public const uint ITEM = 1013; - public const uint CLOTHING = 1014; - public const uint ENTITYSTORAGE = 1015; - public const uint LATHE = 1016; - public const uint LATHE_DATABASE = 1017; - public const uint MATERIAL_STORAGE = 1018; - public const uint HAND_TELEPORTER = 1019; - public const uint VENDING_MACHINE = 1020; - public const uint PROTOLATHE_DATABASE = 1021; - public const uint TECHNOLOGY_DATABASE = 1022; - public const uint RESEARCH_CONSOLE = 1023; - public const uint WIRES = 1024; - public const uint COMBATMODE = 1025; - public const uint ALERTS = 1026; - public const uint OVERLAYEFFECTS = 1027; - public const uint STOMACH = 1028; - public const uint ITEMCOOLDOWN = 1029; - public const uint CARGO_ORDER_DATABASE = 1030; - public const uint GALACTIC_MARKET = 1031; - public const uint HUMANOID_APPEARANCE = 1032; - public const uint INSTRUMENTS = 1033; - public const uint WELDER = 1034; - public const uint STACK = 1035; - public const uint HANDHELD_LIGHT = 1036; - public const uint PAPER = 1037; - public const uint REAGENT_INJECTOR = 1038; - public const uint GHOST = 1039; - public const uint MICROWAVE = 1040; - public const uint GRAVITY_GENERATOR = 1041; - public const uint SURGERY = 1042; - public const uint MULTITOOLS = 1043; - public const uint PDA = 1044; - public const uint PATHFINDER_DEBUG = 1045; - public const uint AI_DEBUG = 1046; - public const uint PLAYER_INPUT_MOVER = 1047; - public const uint STUNNABLE = 1048; - public const uint HUNGER = 1049; - public const uint THIRST = 1050; - public const uint FLASHABLE = 1051; - public const uint BUCKLE = 1052; - public const uint PROJECTILE = 1053; - // 1054 - public const uint STRAP = 1055; - public const uint DISPOSABLE = 1056; - public const uint GAS_ANALYZER = 1057; - public const uint DO_AFTER = 1058; - public const uint RADIATION_PULSE = 1059; - public const uint BODY = 1060; - public const uint CLIMBING = 1061; - public const uint BOLTACTION_BARREL = 1062; - public const uint PUMP_BARREL = 1063; - public const uint REVOLVER_BARREL = 1064; - public const uint CUFFED = 1065; - public const uint HANDCUFFS = 1066; - public const uint BATTERY_BARREL = 1067; - public const uint SUSPICION_ROLE = 1068; - public const uint ROTATION = 1069; - public const uint MOB_STATE = 1070; - public const uint SLIP = 1071; - public const uint SPACE_VILLAIN_ARCADE = 1072; - public const uint BLOCKGAME_ARCADE = 1073; - public const uint BODY_PART = 1074; - public const uint CRAYONS = 1075; - public const uint PLACEABLE_SURFACE = 1076; - public const uint STORABLE = 1077; - public const uint PULLABLE = 1078; - public const uint GAS_TANK = 1079; - public const uint SINGULARITY = 1080; - public const uint CHARACTERINFO = 1081; - public const uint REAGENT_GRINDER = 1082; - public const uint ACTIONS = 1083; - public const uint DAMAGEABLE = 1084; - public const uint MAGBOOTS = 1085; - public const uint TAG = 1086; - // Used for clientside fake prediction of doors. - public const uint DOOR = 1087; - public const uint SPAWN_AFTER_INTERACT = 1088; - public const uint DISASSEMBLE_ON_ACTIVATE = 1089; - public const uint LIGHT_REPLACER = 1090; - public const uint SINGULARITY_DISTORTION = 1091; - public const uint GRAVITY = 1092; - public const uint STANDING_STATE = 1093; - - // Net IDs for integration tests. - public const uint PREDICTION_TEST = 10001; - } -} diff --git a/Content.Shared/Nutrition/Components/SharedHungerComponent.cs b/Content.Shared/Nutrition/Components/SharedHungerComponent.cs index 9fddc5aae2..8a46310df8 100644 --- a/Content.Shared/Nutrition/Components/SharedHungerComponent.cs +++ b/Content.Shared/Nutrition/Components/SharedHungerComponent.cs @@ -1,19 +1,18 @@ #nullable enable using System; using Content.Shared.Movement.Components; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Shared.Nutrition.Components { + [NetworkedComponent()] public abstract class SharedHungerComponent : Component, IMoveSpeedModifier { public sealed override string Name => "Hunger"; - public sealed override uint? NetID => ContentNetIDs.HUNGER; - [ViewVariables] public abstract HungerThreshold CurrentHungerThreshold { get; } @@ -46,7 +45,7 @@ namespace Content.Shared.Nutrition.Components { public HungerThreshold CurrentThreshold { get; } - public HungerComponentState(HungerThreshold currentThreshold) : base(ContentNetIDs.HUNGER) + public HungerComponentState(HungerThreshold currentThreshold) { CurrentThreshold = currentThreshold; } diff --git a/Content.Shared/Nutrition/Components/SharedThirstComponent.cs b/Content.Shared/Nutrition/Components/SharedThirstComponent.cs index e3eb0b6382..f852b13879 100644 --- a/Content.Shared/Nutrition/Components/SharedThirstComponent.cs +++ b/Content.Shared/Nutrition/Components/SharedThirstComponent.cs @@ -1,19 +1,18 @@ #nullable enable using System; using Content.Shared.Movement.Components; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Shared.Nutrition.Components { + [NetworkedComponent()] public abstract class SharedThirstComponent : Component, IMoveSpeedModifier { public sealed override string Name => "Thirst"; - public sealed override uint? NetID => ContentNetIDs.THIRST; - [ViewVariables] public abstract ThirstThreshold CurrentThirstThreshold { get; } @@ -45,7 +44,7 @@ namespace Content.Shared.Nutrition.Components { public ThirstThreshold CurrentThreshold { get; } - public ThirstComponentState(ThirstThreshold currentThreshold) : base(ContentNetIDs.THIRST) + public ThirstComponentState(ThirstThreshold currentThreshold) { CurrentThreshold = currentThreshold; } diff --git a/Content.Shared/PDA/SharedPDAComponent.cs b/Content.Shared/PDA/SharedPDAComponent.cs index a9ceb07df1..6050a82b3d 100644 --- a/Content.Shared/PDA/SharedPDAComponent.cs +++ b/Content.Shared/PDA/SharedPDAComponent.cs @@ -1,17 +1,16 @@ -#nullable enable +#nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Shared.PDA { + [NetworkedComponent()] public class SharedPDAComponent : Component { public override string Name => "PDA"; - public override uint? NetID => ContentNetIDs.PDA; - } [Serializable, NetSerializable] @@ -177,7 +176,7 @@ namespace Content.Shared.PDA public UplinkListingData(string listingName,string itemId, int price, UplinkCategory category, - string description) : base(ContentNetIDs.PDA) + string description) { ListingName = listingName; Price = price; diff --git a/Content.Shared/Placeable/SharedPlaceableSurfaceComponent.cs b/Content.Shared/Placeable/SharedPlaceableSurfaceComponent.cs index 58e7d68629..3485151359 100644 --- a/Content.Shared/Placeable/SharedPlaceableSurfaceComponent.cs +++ b/Content.Shared/Placeable/SharedPlaceableSurfaceComponent.cs @@ -1,16 +1,16 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Maths; using Robust.Shared.Serialization; namespace Content.Shared.Placeable { + [NetworkedComponent()] public abstract class SharedPlaceableSurfaceComponent : Component { public override string Name => "PlaceableSurface"; - public override uint? NetID => ContentNetIDs.PLACEABLE_SURFACE; public virtual bool IsPlaceable { get; set; } public virtual bool PlaceCentered { get; set; } public virtual Vector2 PositionOffset { get; set; } @@ -23,7 +23,7 @@ namespace Content.Shared.Placeable public readonly bool PlaceCentered; public readonly Vector2 PositionOffset; - public PlaceableSurfaceComponentState(bool placeable, bool centered, Vector2 offset) : base(ContentNetIDs.PLACEABLE_SURFACE) + public PlaceableSurfaceComponentState(bool placeable, bool centered, Vector2 offset) { IsPlaceable = placeable; PlaceCentered = centered; diff --git a/Content.Shared/Projectiles/SharedProjectileComponent.cs b/Content.Shared/Projectiles/SharedProjectileComponent.cs index 85f1167242..5e9547d5a8 100644 --- a/Content.Shared/Projectiles/SharedProjectileComponent.cs +++ b/Content.Shared/Projectiles/SharedProjectileComponent.cs @@ -1,16 +1,16 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Projectiles { + [NetworkedComponent()] public abstract class SharedProjectileComponent : Component { private bool _ignoreShooter = true; public override string Name => "Projectile"; - public override uint? NetID => ContentNetIDs.PROJECTILE; public EntityUid Shooter { get; protected set; } @@ -29,7 +29,7 @@ namespace Content.Shared.Projectiles [NetSerializable, Serializable] protected class ProjectileComponentState : ComponentState { - public ProjectileComponentState(EntityUid shooter, bool ignoreShooter) : base(ContentNetIDs.PROJECTILE) + public ProjectileComponentState(EntityUid shooter, bool ignoreShooter) { Shooter = shooter; IgnoreShooter = ignoreShooter; diff --git a/Content.Shared/Pulling/Components/SharedPullableComponent.cs b/Content.Shared/Pulling/Components/SharedPullableComponent.cs index d5c7c9e066..032a09f29c 100644 --- a/Content.Shared/Pulling/Components/SharedPullableComponent.cs +++ b/Content.Shared/Pulling/Components/SharedPullableComponent.cs @@ -1,13 +1,13 @@ -#nullable enable +#nullable enable using System; using Content.Shared.ActionBlocker; using Content.Shared.Alert; using Content.Shared.Movement; using Content.Shared.Movement.Components; -using Content.Shared.NetIDs; using Content.Shared.Physics.Pull; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Physics; @@ -17,10 +17,10 @@ using Robust.Shared.Serialization; namespace Content.Shared.Pulling.Components { + [NetworkedComponent()] public abstract class SharedPullableComponent : Component, IRelayMoveInput { public override string Name => "Pullable"; - public override uint? NetID => ContentNetIDs.PULLABLE; [ComponentDependency] private readonly PhysicsComponent? _physics = default!; @@ -381,7 +381,7 @@ namespace Content.Shared.Pulling.Components { public readonly EntityUid? Puller; - public PullableComponentState(EntityUid? puller) : base(ContentNetIDs.PULLABLE) + public PullableComponentState(EntityUid? puller) { Puller = puller; } diff --git a/Content.Shared/Radiation/SharedRadiationStorm.cs b/Content.Shared/Radiation/SharedRadiationStorm.cs index 9c308bdd09..a43e65ae55 100644 --- a/Content.Shared/Radiation/SharedRadiationStorm.cs +++ b/Content.Shared/Radiation/SharedRadiationStorm.cs @@ -1,15 +1,15 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Radiation { + [NetworkedComponent()] public abstract class SharedRadiationPulseComponent : Component { public override string Name => "RadiationPulse"; - public override uint? NetID => ContentNetIDs.RADIATION_PULSE; public virtual float RadsPerSecond { get; set; } @@ -36,7 +36,7 @@ namespace Content.Shared.Radiation public readonly bool Decay; public readonly TimeSpan EndTime; - public RadiationPulseState(float radsPerSecond, float range, bool draw, bool decay, TimeSpan endTime) : base(ContentNetIDs.RADIATION_PULSE) + public RadiationPulseState(float radsPerSecond, float range, bool draw, bool decay, TimeSpan endTime) { RadsPerSecond = radsPerSecond; Range = range; diff --git a/Content.Shared/Research/Components/SharedResearchConsoleComponent.cs b/Content.Shared/Research/Components/SharedResearchConsoleComponent.cs index 5600a6e36a..e449733d32 100644 --- a/Content.Shared/Research/Components/SharedResearchConsoleComponent.cs +++ b/Content.Shared/Research/Components/SharedResearchConsoleComponent.cs @@ -1,15 +1,15 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Research.Components { + [NetworkedComponent()] public class SharedResearchConsoleComponent : Component { public override string Name => "ResearchConsole"; - public override uint? NetID => ContentNetIDs.RESEARCH_CONSOLE; [NetSerializable, Serializable] public enum ResearchConsoleUiKey diff --git a/Content.Shared/Research/Components/SharedTechnologyDatabaseComponent.cs b/Content.Shared/Research/Components/SharedTechnologyDatabaseComponent.cs index 2b860eddb9..3906693026 100644 --- a/Content.Shared/Research/Components/SharedTechnologyDatabaseComponent.cs +++ b/Content.Shared/Research/Components/SharedTechnologyDatabaseComponent.cs @@ -2,9 +2,9 @@ using System; using System.Collections; using System.Collections.Generic; -using Content.Shared.NetIDs; using Content.Shared.Research.Prototypes; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; @@ -12,10 +12,10 @@ using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Shared.Research.Components { + [NetworkedComponent()] public class SharedTechnologyDatabaseComponent : Component, IEnumerable, ISerializationHooks { public override string Name => "TechnologyDatabase"; - public override uint? NetID => ContentNetIDs.TECHNOLOGY_DATABASE; [DataField("technologies")] private List _technologyIds = new(); @@ -114,12 +114,12 @@ namespace Content.Shared.Research.Components public class TechnologyDatabaseState : ComponentState { public List Technologies; - public TechnologyDatabaseState(List technologies) : base(ContentNetIDs.TECHNOLOGY_DATABASE) + public TechnologyDatabaseState(List technologies) { Technologies = technologies; } - public TechnologyDatabaseState(List technologies) : base(ContentNetIDs.TECHNOLOGY_DATABASE) + public TechnologyDatabaseState(List technologies) { Technologies = new List(); foreach (var technology in technologies) diff --git a/Content.Shared/Singularity/Components/SharedSingularityComponent.cs b/Content.Shared/Singularity/Components/SharedSingularityComponent.cs index 2b9b9ebc4e..687a4d1494 100644 --- a/Content.Shared/Singularity/Components/SharedSingularityComponent.cs +++ b/Content.Shared/Singularity/Components/SharedSingularityComponent.cs @@ -1,16 +1,16 @@ using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; namespace Content.Shared.Singularity.Components { + [NetworkedComponent] public abstract class SharedSingularityComponent : Component { public override string Name => "Singularity"; - public override uint? NetID => ContentNetIDs.SINGULARITY; [DataField("deleteFixture")] public string? DeleteFixtureId { get; } = default; @@ -36,7 +36,7 @@ namespace Content.Shared.Singularity.Components { public int Level { get; } - public SingularityComponentState(int level) : base(ContentNetIDs.SINGULARITY) + public SingularityComponentState(int level) { Level = level; } diff --git a/Content.Shared/Singularity/Components/SingularityDistortionComponent.cs b/Content.Shared/Singularity/Components/SingularityDistortionComponent.cs index 46a62ae318..e31cf8d81a 100644 --- a/Content.Shared/Singularity/Components/SingularityDistortionComponent.cs +++ b/Content.Shared/Singularity/Components/SingularityDistortionComponent.cs @@ -1,6 +1,6 @@ -using System; -using Content.Shared.NetIDs; +using System; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Players; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; @@ -9,10 +9,10 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Singularity.Components { [RegisterComponent] + [NetworkedComponent] public class SingularityDistortionComponent : Component { public override string Name => "SingularityDistortion"; - public override uint? NetID => ContentNetIDs.SINGULARITY_DISTORTION; [DataField("intensity")] private float _intensity = 0.25f; @@ -56,7 +56,7 @@ namespace Content.Shared.Singularity.Components [Serializable, NetSerializable] public class SingularityDistortionComponentState : ComponentState { - public SingularityDistortionComponentState(float intensity, float falloff) : base(ContentNetIDs.SINGULARITY_DISTORTION) + public SingularityDistortionComponentState(float intensity, float falloff) { Intensity = intensity; Falloff = falloff; diff --git a/Content.Shared/Slippery/SlipperyComponent.cs b/Content.Shared/Slippery/SlipperyComponent.cs index 12053612ae..3a4b4fb935 100644 --- a/Content.Shared/Slippery/SlipperyComponent.cs +++ b/Content.Shared/Slippery/SlipperyComponent.cs @@ -1,15 +1,15 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; using System.Linq; using Content.Shared.Audio; using Content.Shared.EffectBlocker; using Content.Shared.Module; -using Content.Shared.NetIDs; using Content.Shared.Stunnable; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Maths; using Robust.Shared.Physics; @@ -24,12 +24,12 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Slippery { [RegisterComponent] + [NetworkedComponent()] public class SlipperyComponent : Component, IStartCollide { [Dependency] private IModuleManager _moduleManager = default!; public sealed override string Name => "Slippery"; - public override uint? NetID => ContentNetIDs.SLIP; private float _paralyzeTime = 3f; private float _intersectPercentage = 0.3f; @@ -265,7 +265,7 @@ namespace Content.Shared.Slippery public string SlipSound { get; } public readonly EntityUid[] Slipped; - public SlipperyComponentState(float paralyzeTime, float intersectPercentage, float requiredSlipSpeed, float launchForwardsMultiplier, bool slippery, string slipSound, EntityUid[] slipped) : base(ContentNetIDs.SLIP) + public SlipperyComponentState(float paralyzeTime, float intersectPercentage, float requiredSlipSpeed, float launchForwardsMultiplier, bool slippery, string slipSound, EntityUid[] slipped) { ParalyzeTime = paralyzeTime; IntersectPercentage = intersectPercentage; diff --git a/Content.Shared/Sound/SharedLoopingSoundComponent.cs b/Content.Shared/Sound/SharedLoopingSoundComponent.cs index 71eb6dccfe..7bc427ad7c 100644 --- a/Content.Shared/Sound/SharedLoopingSoundComponent.cs +++ b/Content.Shared/Sound/SharedLoopingSoundComponent.cs @@ -1,17 +1,17 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.Audio; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Shared.Sound { + [NetworkedComponent()] public class SharedLoopingSoundComponent : Component { public override string Name => "LoopingSound"; - public override uint? NetID => ContentNetIDs.SOUND; /// /// Stops all sounds. diff --git a/Content.Shared/Stacks/SharedStackComponent.cs b/Content.Shared/Stacks/SharedStackComponent.cs index 06fc58cf78..7a7153aeb7 100644 --- a/Content.Shared/Stacks/SharedStackComponent.cs +++ b/Content.Shared/Stacks/SharedStackComponent.cs @@ -1,6 +1,6 @@ using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Players; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; @@ -9,10 +9,10 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Stacks { + [NetworkedComponent()] public abstract class SharedStackComponent : Component, ISerializationHooks { public sealed override string Name => "Stack"; - public sealed override uint? NetID => ContentNetIDs.STACK; [ViewVariables(VVAccess.ReadWrite)] [DataField("stackType", required:true, customTypeSerializer:typeof(PrototypeIdSerializer))] @@ -48,7 +48,7 @@ namespace Content.Shared.Stacks public int Count { get; } public int MaxCount { get; } - public StackComponentState(int count, int maxCount) : base(ContentNetIDs.STACK) + public StackComponentState(int count, int maxCount) { Count = count; MaxCount = maxCount; diff --git a/Content.Shared/Standing/StandingStateComponent.cs b/Content.Shared/Standing/StandingStateComponent.cs index 1ed4fcd8c0..743f9d91da 100644 --- a/Content.Shared/Standing/StandingStateComponent.cs +++ b/Content.Shared/Standing/StandingStateComponent.cs @@ -1,7 +1,7 @@ using System; using Content.Shared.EffectBlocker; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Players; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; @@ -10,12 +10,11 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Standing { [RegisterComponent] + [NetworkedComponent] public sealed class StandingStateComponent : Component, IEffectBlocker { public override string Name => "StandingState"; - public override uint? NetID => ContentNetIDs.STANDING_STATE; - [ViewVariables(VVAccess.ReadWrite)] [DataField("downSoundCollection")] public string? DownSoundCollection { get; } = "BodyFall"; @@ -45,7 +44,7 @@ namespace Content.Shared.Standing { public bool Standing { get; } - public StandingComponentState(bool standing) : base(ContentNetIDs.STANDING_STATE) + public StandingComponentState(bool standing) { Standing = standing; } diff --git a/Content.Shared/Storage/SharedStorageComponent.cs b/Content.Shared/Storage/SharedStorageComponent.cs index 52b9b0d2b1..a38a3c1987 100644 --- a/Content.Shared/Storage/SharedStorageComponent.cs +++ b/Content.Shared/Storage/SharedStorageComponent.cs @@ -5,18 +5,18 @@ using System.Linq; using Content.Shared.ActionBlocker; using Content.Shared.DragDrop; using Content.Shared.Interaction.Events; -using Content.Shared.NetIDs; using Content.Shared.Placeable; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Serialization; namespace Content.Shared.Storage { + [NetworkedComponent()] public abstract class SharedStorageComponent : Component, IDraggable { public override string Name => "Storage"; - public override uint? NetID => ContentNetIDs.INVENTORY; public abstract IReadOnlyList? StoredEntities { get; } @@ -65,7 +65,7 @@ namespace Content.Shared.Storage { public readonly EntityUid[] StoredEntities; - public StorageComponentState(EntityUid[] storedEntities) : base(ContentNetIDs.INVENTORY) + public StorageComponentState(EntityUid[] storedEntities) { StoredEntities = storedEntities; } diff --git a/Content.Shared/Stunnable/SharedStunnableComponent.cs b/Content.Shared/Stunnable/SharedStunnableComponent.cs index 2f3e15f657..331dab5e40 100644 --- a/Content.Shared/Stunnable/SharedStunnableComponent.cs +++ b/Content.Shared/Stunnable/SharedStunnableComponent.cs @@ -5,8 +5,8 @@ using Content.Shared.ActionBlocker; using Content.Shared.Alert; using Content.Shared.Interaction; using Content.Shared.Movement.Components; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Players; using Robust.Shared.Serialization; @@ -16,12 +16,12 @@ using Robust.Shared.ViewVariables; namespace Content.Shared.Stunnable { + [NetworkedComponent()] public abstract class SharedStunnableComponent : Component, IMoveSpeedModifier, IActionBlocker, IInteractHand { [Dependency] private readonly IGameTiming _gameTiming = default!; public sealed override string Name => "Stunnable"; - public override uint? NetID => ContentNetIDs.STUNNABLE; public (TimeSpan Start, TimeSpan End)? StunnedTimer { get; protected set; } public (TimeSpan Start, TimeSpan End)? KnockdownTimer { get; protected set; } @@ -368,7 +368,7 @@ namespace Content.Shared.Stunnable public StunnableComponentState( (TimeSpan Start, TimeSpan End)? stunnedTimer, (TimeSpan Start, TimeSpan End)? knockdownTimer, - (TimeSpan Start, TimeSpan End)? slowdownTimer, float walkModifierOverride, float runModifierOverride) : base(ContentNetIDs.STUNNABLE) + (TimeSpan Start, TimeSpan End)? slowdownTimer, float walkModifierOverride, float runModifierOverride) { StunnedTimer = stunnedTimer; KnockdownTimer = knockdownTimer; diff --git a/Content.Shared/Suspicion/SharedSuspicionRoleComponent.cs b/Content.Shared/Suspicion/SharedSuspicionRoleComponent.cs index 07c9a3897f..feb3c1b38e 100644 --- a/Content.Shared/Suspicion/SharedSuspicionRoleComponent.cs +++ b/Content.Shared/Suspicion/SharedSuspicionRoleComponent.cs @@ -1,15 +1,15 @@ -#nullable enable +#nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Suspicion { + [NetworkedComponent()] public abstract class SharedSuspicionRoleComponent : Component { public sealed override string Name => "SuspicionRole"; - public sealed override uint? NetID => ContentNetIDs.SUSPICION_ROLE; } [Serializable, NetSerializable] @@ -19,7 +19,7 @@ namespace Content.Shared.Suspicion public readonly bool? Antagonist; public readonly (string name, EntityUid)[] Allies; - public SuspicionRoleComponentState(string? role, bool? antagonist, (string name, EntityUid)[] allies) : base(ContentNetIDs.SUSPICION_ROLE) + public SuspicionRoleComponentState(string? role, bool? antagonist, (string name, EntityUid)[] allies) { Role = role; Antagonist = antagonist; diff --git a/Content.Shared/Tag/TagComponentState.cs b/Content.Shared/Tag/TagComponentState.cs index d97e1f7d36..7aee653d85 100644 --- a/Content.Shared/Tag/TagComponentState.cs +++ b/Content.Shared/Tag/TagComponentState.cs @@ -1,6 +1,5 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -9,7 +8,7 @@ namespace Content.Shared.Tag [Serializable, NetSerializable] public class TagComponentState : ComponentState { - public TagComponentState(string[] tags) : base(ContentNetIDs.TAG) + public TagComponentState(string[] tags) { Tags = tags; } diff --git a/Content.Shared/Tool/SharedToolComponent.cs b/Content.Shared/Tool/SharedToolComponent.cs index 4025c5ea91..64278c829a 100644 --- a/Content.Shared/Tool/SharedToolComponent.cs +++ b/Content.Shared/Tool/SharedToolComponent.cs @@ -1,6 +1,5 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -47,7 +46,7 @@ namespace Content.Shared.Tool { public ToolQuality Quality { get; } - public MultiToolComponentState(ToolQuality quality) : base(ContentNetIDs.MULTITOOLS) + public MultiToolComponentState(ToolQuality quality) { Quality = quality; } @@ -61,7 +60,7 @@ namespace Content.Shared.Tool public bool Activated { get; } public ToolQuality Quality { get; } - public WelderComponentState(float fuelCapacity, float fuel, bool activated) : base(ContentNetIDs.WELDER) + public WelderComponentState(float fuelCapacity, float fuel, bool activated) { FuelCapacity = fuelCapacity; Fuel = fuel; diff --git a/Content.Shared/VendingMachines/SharedVendingMachineComponent.cs b/Content.Shared/VendingMachines/SharedVendingMachineComponent.cs index 564957a9b9..5394181881 100644 --- a/Content.Shared/VendingMachines/SharedVendingMachineComponent.cs +++ b/Content.Shared/VendingMachines/SharedVendingMachineComponent.cs @@ -1,17 +1,17 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; namespace Content.Shared.VendingMachines { + [NetworkedComponent()] public class SharedVendingMachineComponent : Component { public override string Name => "VendingMachine"; - public override uint? NetID => ContentNetIDs.VENDING_MACHINE; [ViewVariables] public List Inventory = new(); diff --git a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedBatteryBarrelComponent.cs b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedBatteryBarrelComponent.cs index e59d53f8f3..94f12193a9 100644 --- a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedBatteryBarrelComponent.cs +++ b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedBatteryBarrelComponent.cs @@ -1,6 +1,5 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged.Components; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -15,8 +14,7 @@ namespace Content.Shared.Weapons.Ranged.Barrels.Components public BatteryBarrelComponentState( FireRateSelector fireRateSelector, - (int count, int max)? magazine) : - base(ContentNetIDs.BATTERY_BARREL) + (int count, int max)? magazine) { FireRateSelector = fireRateSelector; Magazine = magazine; diff --git a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedBoltActionBarrelComponent.cs b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedBoltActionBarrelComponent.cs index 979e6ede4e..726f31644c 100644 --- a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedBoltActionBarrelComponent.cs +++ b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedBoltActionBarrelComponent.cs @@ -1,6 +1,5 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged.Components; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -19,8 +18,7 @@ namespace Content.Shared.Weapons.Ranged.Barrels.Components (bool chambered, bool spent) chamber, FireRateSelector fireRateSelector, (int count, int max)? magazine, - string? soundGunshot) : - base(ContentNetIDs.BOLTACTION_BARREL) + string? soundGunshot) { Chamber = chamber; FireRateSelector = fireRateSelector; diff --git a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedMagazineBarrelComponent.cs b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedMagazineBarrelComponent.cs index d337a4e4df..71d0713ab5 100644 --- a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedMagazineBarrelComponent.cs +++ b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedMagazineBarrelComponent.cs @@ -1,6 +1,5 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged.Components; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -39,8 +38,7 @@ namespace Content.Shared.Weapons.Ranged.Barrels.Components bool chambered, FireRateSelector fireRateSelector, (int count, int max)? magazine, - string? soundGunshot) : - base(ContentNetIDs.MAGAZINE_BARREL) + string? soundGunshot) { Chambered = chambered; FireRateSelector = fireRateSelector; diff --git a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedPumpBarrelComponent.cs b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedPumpBarrelComponent.cs index 8789661af8..8ee85b7be9 100644 --- a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedPumpBarrelComponent.cs +++ b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedPumpBarrelComponent.cs @@ -1,6 +1,5 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged.Components; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -19,8 +18,7 @@ namespace Content.Shared.Weapons.Ranged.Barrels.Components (bool chambered, bool spent) chamber, FireRateSelector fireRateSelector, (int count, int max)? magazine, - string? soundGunshot) : - base(ContentNetIDs.PUMP_BARREL) + string? soundGunshot) { Chamber = chamber; FireRateSelector = fireRateSelector; diff --git a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedRevolverBarrelComponent.cs b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedRevolverBarrelComponent.cs index 97ff37ead4..a3f4108a0b 100644 --- a/Content.Shared/Weapons/Ranged/Barrels/Components/SharedRevolverBarrelComponent.cs +++ b/Content.Shared/Weapons/Ranged/Barrels/Components/SharedRevolverBarrelComponent.cs @@ -1,6 +1,5 @@ #nullable enable using System; -using Content.Shared.NetIDs; using Content.Shared.Weapons.Ranged.Components; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -19,8 +18,7 @@ namespace Content.Shared.Weapons.Ranged.Barrels.Components int currentSlot, FireRateSelector fireRateSelector, bool?[] bullets, - string? soundGunshot) : - base(ContentNetIDs.REVOLVER_BARREL) + string? soundGunshot) { CurrentSlot = currentSlot; FireRateSelector = fireRateSelector; diff --git a/Content.Shared/Weapons/Ranged/Components/SharedRangedWeaponComponent.cs b/Content.Shared/Weapons/Ranged/Components/SharedRangedWeaponComponent.cs index 4a09320ccc..a3d8d75e18 100644 --- a/Content.Shared/Weapons/Ranged/Components/SharedRangedWeaponComponent.cs +++ b/Content.Shared/Weapons/Ranged/Components/SharedRangedWeaponComponent.cs @@ -1,19 +1,19 @@ -#nullable enable +#nullable enable using System; -using Content.Shared.NetIDs; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Serialization; namespace Content.Shared.Weapons.Ranged.Components { + [NetworkedComponent()] public abstract class SharedRangedWeaponComponent : Component { // Each RangedWeapon should have a RangedWeapon component + // some kind of RangedBarrelComponent (this dictates what ammo is retrieved). public override string Name => "RangedWeapon"; - public override uint? NetID => ContentNetIDs.RANGED_WEAPON; } [Serializable, NetSerializable] @@ -23,7 +23,7 @@ namespace Content.Shared.Weapons.Ranged.Components public RangedWeaponComponentState( FireRateSelector fireRateSelector - ) : base(ContentNetIDs.RANGED_WEAPON) + ) { FireRateSelector = fireRateSelector; }