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:
@@ -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
|
||||
|
||||
/// <summary>
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user