Remove Static Component NetIds (#4247)

* Remove the unnecessary NetID property from ComponentState.

* Remove Component.NetworkSynchronizeExistence.

* Removed Component.NetID.

* Adds component netID automatic generation.

* Removed NetIdAttribute from serverside components with no corresponding clientside registration.

* Completely remove static NetIds.

* Renamed NetIDAttribute to NetworkedComponentAttribute.

* Add GenerateNetIds calls to client and server entry points.
Add test to make sure auto generated NetIds are identical.

* Component changes when rebasing that I am too lazy to rewrite into the branch.

Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
Acruid
2021-07-12 01:32:10 -07:00
committed by GitHub
parent baeabfd936
commit 59e5cc5e3c
103 changed files with 334 additions and 429 deletions

View File

@@ -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;
}