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