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,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
|
||||
/// <summary>
|
||||
/// Players can pick up, drop, and put items in bags, and they can be seen in player's hands.
|
||||
/// </summary>
|
||||
[NetworkedComponent()]
|
||||
public abstract class SharedItemComponent : Component, IEquipped, IUnequipped, IInteractHand
|
||||
{
|
||||
public override string Name => "Item";
|
||||
|
||||
public override uint? NetID => ContentNetIDs.ITEM;
|
||||
|
||||
/// <summary>
|
||||
/// How much big this item is.
|
||||
/// </summary>
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user