Revert "virtualize all net ids to reduce net traffic"

This reverts commit 027c338c5f.

Formatting fix left in.
This commit is contained in:
Tyler Young
2020-06-08 16:49:05 -04:00
parent e85b839d27
commit c3fd0ef882
25 changed files with 31 additions and 62 deletions

View File

@@ -16,9 +16,7 @@ namespace Content.Shared.GameObjects.Components.Cargo
public class CargoOrderDatabaseState : ComponentState public class CargoOrderDatabaseState : ComponentState
{ {
public readonly List<CargoOrderData> Orders; public readonly List<CargoOrderData> Orders;
public override uint NetID => ContentNetIDs.CARGO_ORDER_DATABASE; public CargoOrderDatabaseState(List<CargoOrderData> orders) : base(ContentNetIDs.CARGO_ORDER_DATABASE)
public CargoOrderDatabaseState(List<CargoOrderData> orders)
{ {
Orders = orders; Orders = orders;
} }

View File

@@ -88,9 +88,7 @@ namespace Content.Shared.GameObjects.Components.Cargo
public class GalacticMarketState : ComponentState public class GalacticMarketState : ComponentState
{ {
public List<string> Products; public List<string> Products;
public override uint NetID => ContentNetIDs.GALACTIC_MARKET; public GalacticMarketState(List<string> technologies) : base(ContentNetIDs.GALACTIC_MARKET)
public GalacticMarketState(List<string> technologies)
{ {
Products = technologies; Products = technologies;
} }

View File

@@ -22,9 +22,8 @@ namespace Content.Shared.GameObjects.Components.Chemistry
public ReagentUnit CurrentVolume { get; } public ReagentUnit CurrentVolume { get; }
public ReagentUnit TotalVolume { get; } public ReagentUnit TotalVolume { get; }
public InjectorToggleMode CurrentMode { get; } public InjectorToggleMode CurrentMode { get; }
public override uint NetID => ContentNetIDs.REAGENT_INJECTOR;
public InjectorComponentState(ReagentUnit currentVolume, ReagentUnit totalVolume, InjectorToggleMode currentMode) public InjectorComponentState(ReagentUnit currentVolume, ReagentUnit totalVolume, InjectorToggleMode currentMode) : base(ContentNetIDs.REAGENT_INJECTOR)
{ {
CurrentVolume = currentVolume; CurrentVolume = currentVolume;
TotalVolume = totalVolume; TotalVolume = totalVolume;

View File

@@ -20,9 +20,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry
[Serializable, NetSerializable] [Serializable, NetSerializable]
public class SolutionComponentState : ComponentState public class SolutionComponentState : ComponentState
{ {
public override uint NetID => ContentNetIDs.SOLUTION; public SolutionComponentState() : base(ContentNetIDs.SOLUTION) { }
public SolutionComponentState() { }
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@@ -16,9 +16,8 @@ namespace Content.Shared.GameObjects
public class DamageComponentState : ComponentState public class DamageComponentState : ComponentState
{ {
public Dictionary<DamageType, int> CurrentDamage = new Dictionary<DamageType, int>(); public Dictionary<DamageType, int> CurrentDamage = new Dictionary<DamageType, int>();
public override uint NetID => ContentNetIDs.DAMAGEABLE;
public DamageComponentState(Dictionary<DamageType, int> damage) public DamageComponentState(Dictionary<DamageType, int> damage) : base(ContentNetIDs.DAMAGEABLE)
{ {
CurrentDamage = damage; CurrentDamage = damage;
} }

View File

@@ -59,9 +59,8 @@ namespace Content.Shared.GameObjects.Components.Instruments
public class InstrumentState : ComponentState public class InstrumentState : ComponentState
{ {
public bool Playing { get; } public bool Playing { get; }
public override uint NetID => ContentNetIDs.INSTRUMENTS;
public InstrumentState(bool playing, uint sequencerTick = 0) public InstrumentState(bool playing, uint sequencerTick = 0) : base(ContentNetIDs.INSTRUMENTS)
{ {
Playing = playing; Playing = playing;
} }

View File

@@ -27,9 +27,8 @@ namespace Content.Shared.GameObjects.Components.Interactable
public class MultiToolComponentState : ComponentState public class MultiToolComponentState : ComponentState
{ {
public ToolQuality Quality { get; } public ToolQuality Quality { get; }
public override uint NetID => ContentNetIDs.MULTITOOLS;
public MultiToolComponentState(ToolQuality quality) public MultiToolComponentState(ToolQuality quality) : base(ContentNetIDs.MULTITOOLS)
{ {
Quality = quality; Quality = quality;
} }
@@ -42,9 +41,8 @@ namespace Content.Shared.GameObjects.Components.Interactable
public float Fuel { get; } public float Fuel { get; }
public bool Activated { get; } public bool Activated { get; }
public ToolQuality Quality { get; } public ToolQuality Quality { get; }
public override uint NetID => ContentNetIDs.WELDER;
public WelderComponentState(float fuelCapacity, float fuel, bool activated) public WelderComponentState(float fuelCapacity, float fuel, bool activated) : base(ContentNetIDs.WELDER)
{ {
FuelCapacity = fuelCapacity; FuelCapacity = fuelCapacity;
Fuel = fuel; Fuel = fuel;

View File

@@ -51,9 +51,8 @@ namespace Content.Shared.GameObjects
protected class InventoryComponentState : ComponentState protected class InventoryComponentState : ComponentState
{ {
public List<KeyValuePair<Slots, EntityUid>> Entities { get; } public List<KeyValuePair<Slots, EntityUid>> Entities { get; }
public override uint NetID => ContentNetIDs.STORAGE;
public InventoryComponentState(List<KeyValuePair<Slots, EntityUid>> entities) public InventoryComponentState(List<KeyValuePair<Slots, EntityUid>> entities) : base(ContentNetIDs.STORAGE)
{ {
Entities = entities; Entities = entities;
} }

View File

@@ -7,9 +7,8 @@ namespace Content.Shared.GameObjects.Components.Items
public class ClothingComponentState : ItemComponentState public class ClothingComponentState : ItemComponentState
{ {
public string ClothingEquippedPrefix { get; set; } public string ClothingEquippedPrefix { get; set; }
public override uint NetID => ContentNetIDs.CLOTHING;
public ClothingComponentState(string clothingEquippedPrefix, string equippedPrefix) : base(equippedPrefix) public ClothingComponentState(string clothingEquippedPrefix, string equippedPrefix) : base(equippedPrefix, ContentNetIDs.CLOTHING)
{ {
ClothingEquippedPrefix = clothingEquippedPrefix; ClothingEquippedPrefix = clothingEquippedPrefix;
} }

View File

@@ -8,12 +8,15 @@ namespace Content.Shared.GameObjects.Components.Items
public class ItemComponentState : ComponentState public class ItemComponentState : ComponentState
{ {
public string EquippedPrefix { get; set; } public string EquippedPrefix { get; set; }
public override uint NetID => ContentNetIDs.ITEM;
public ItemComponentState(string equippedPrefix) public ItemComponentState(string equippedPrefix) : base(ContentNetIDs.ITEM)
{ {
EquippedPrefix = equippedPrefix; EquippedPrefix = equippedPrefix;
} }
protected ItemComponentState(string equippedPrefix, uint netId) : base(netId)
{
EquippedPrefix = equippedPrefix;
}
} }
} }

View File

@@ -74,9 +74,8 @@ namespace Content.Shared.GameObjects.Components.Items
{ {
public TimeSpan? CooldownStart { get; set; } public TimeSpan? CooldownStart { get; set; }
public TimeSpan? CooldownEnd { get; set; } public TimeSpan? CooldownEnd { get; set; }
public override uint NetID => ContentNetIDs.ITEMCOOLDOWN;
public ItemCooldownComponentState() public ItemCooldownComponentState() : base(ContentNetIDs.ITEMCOOLDOWN)
{ {
} }
} }

View File

@@ -17,9 +17,8 @@ namespace Content.Shared.GameObjects
{ {
public readonly Dictionary<string, EntityUid> Hands; public readonly Dictionary<string, EntityUid> Hands;
public readonly string ActiveIndex; public readonly string ActiveIndex;
public override uint NetID => ContentNetIDs.HANDS;
public HandsComponentState(Dictionary<string, EntityUid> hands, string activeIndex) public HandsComponentState(Dictionary<string, EntityUid> hands, string activeIndex) : base(ContentNetIDs.HANDS)
{ {
Hands = hands; Hands = hands;
ActiveIndex = activeIndex; ActiveIndex = activeIndex;

View File

@@ -57,9 +57,9 @@ namespace Content.Shared.GameObjects.Components.Mobs
{ {
public bool IsInCombatMode { get; } public bool IsInCombatMode { get; }
public TargetingZone TargetingZone { get; } public TargetingZone TargetingZone { get; }
public override uint NetID => ContentNetIDs.COMBATMODE;
public CombatModeComponentState(bool isInCombatMode, TargetingZone targetingZone) public CombatModeComponentState(bool isInCombatMode, TargetingZone targetingZone)
: base(ContentNetIDs.COMBATMODE)
{ {
IsInCombatMode = isInCombatMode; IsInCombatMode = isInCombatMode;
TargetingZone = targetingZone; TargetingZone = targetingZone;

View File

@@ -69,9 +69,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
[NetSerializable] [NetSerializable]
private sealed class HumanoidAppearanceComponentState : ComponentState private sealed class HumanoidAppearanceComponentState : ComponentState
{ {
public override uint NetID => ContentNetIDs.HUMANOID_APPEARANCE; public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex) : base(ContentNetIDs.HUMANOID_APPEARANCE)
public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex)
{ {
Appearance = appearance; Appearance = appearance;
Sex = sex; Sex = sex;

View File

@@ -24,9 +24,8 @@ namespace Content.Shared.GameObjects.Components.Mobs
public class OverlayEffectComponentState : ComponentState public class OverlayEffectComponentState : ComponentState
{ {
public ScreenEffects ScreenEffect; public ScreenEffects ScreenEffect;
public override uint NetID => ContentNetIDs.OVERLAYEFFECTS;
public OverlayEffectComponentState(ScreenEffects screenEffect) public OverlayEffectComponentState(ScreenEffects screenEffect) : base(ContentNetIDs.OVERLAYEFFECTS)
{ {
ScreenEffect = screenEffect; ScreenEffect = screenEffect;
} }

View File

@@ -19,9 +19,8 @@ namespace Content.Shared.GameObjects.Components.Mobs
public class StatusEffectComponentState : ComponentState public class StatusEffectComponentState : ComponentState
{ {
public Dictionary<StatusEffect, string> StatusEffects; public Dictionary<StatusEffect, string> StatusEffects;
public override uint NetID => ContentNetIDs.STATUSEFFECTS;
public StatusEffectComponentState(Dictionary<StatusEffect, string> statusEffects) public StatusEffectComponentState(Dictionary<StatusEffect, string> statusEffects) : base(ContentNetIDs.STATUSEFFECTS)
{ {
StatusEffects = statusEffects; StatusEffects = statusEffects;
} }

View File

@@ -14,9 +14,8 @@ namespace Content.Shared.GameObjects.Components.Observer
public class GhostComponentState : ComponentState public class GhostComponentState : ComponentState
{ {
public bool CanReturnToBody { get; } public bool CanReturnToBody { get; }
public override uint NetID => ContentNetIDs.GHOST;
public GhostComponentState(bool canReturnToBody) public GhostComponentState(bool canReturnToBody) : base(ContentNetIDs.GHOST)
{ {
CanReturnToBody = canReturnToBody; CanReturnToBody = canReturnToBody;
} }

View File

@@ -166,11 +166,10 @@ namespace Content.Shared.GameObjects.Components.PDA
public UplinkCategory Category; public UplinkCategory Category;
public string Description; public string Description;
public string ListingName; public string ListingName;
public override uint NetID => ContentNetIDs.PDA;
public UplinkListingData(string listingName,string itemId, public UplinkListingData(string listingName,string itemId,
int price, UplinkCategory category, int price, UplinkCategory category,
string description) string description) : base(ContentNetIDs.PDA)
{ {
ListingName = listingName; ListingName = listingName;
Price = price; Price = price;

View File

@@ -117,9 +117,7 @@ namespace Content.Shared.GameObjects.Components.Research
public class LatheDatabaseState : ComponentState public class LatheDatabaseState : ComponentState
{ {
public readonly List<string> Recipes; public readonly List<string> Recipes;
public override uint NetID => ContentNetIDs.LATHE_DATABASE; public LatheDatabaseState(List<string> recipes) : base(ContentNetIDs.LATHE_DATABASE)
public LatheDatabaseState(List<string> recipes)
{ {
Recipes = recipes; Recipes = recipes;
} }

View File

@@ -69,9 +69,7 @@ namespace Content.Shared.GameObjects.Components.Research
public class MaterialStorageState : ComponentState public class MaterialStorageState : ComponentState
{ {
public readonly Dictionary<string, int> Storage; public readonly Dictionary<string, int> Storage;
public override uint NetID => ContentNetIDs.MATERIAL_STORAGE; public MaterialStorageState(Dictionary<string, int> storage) : base(ContentNetIDs.MATERIAL_STORAGE)
public MaterialStorageState(Dictionary<string, int> storage)
{ {
Storage = storage; Storage = storage;
} }

View File

@@ -63,9 +63,7 @@ namespace Content.Shared.GameObjects.Components.Research
public class ProtolatheDatabaseState : ComponentState public class ProtolatheDatabaseState : ComponentState
{ {
public readonly List<string> Recipes; public readonly List<string> Recipes;
public override uint NetID => ContentNetIDs.PROTOLATHE_DATABASE; public ProtolatheDatabaseState(List<string> recipes) : base(ContentNetIDs.PROTOLATHE_DATABASE)
public ProtolatheDatabaseState(List<string> recipes)
{ {
Recipes = recipes; Recipes = recipes;
} }

View File

@@ -104,14 +104,12 @@ namespace Content.Shared.GameObjects.Components.Research
public class TechnologyDatabaseState : ComponentState public class TechnologyDatabaseState : ComponentState
{ {
public List<string> Technologies; public List<string> Technologies;
public override uint NetID => ContentNetIDs.TECHNOLOGY_DATABASE; public TechnologyDatabaseState(List<string> technologies) : base(ContentNetIDs.TECHNOLOGY_DATABASE)
public TechnologyDatabaseState(List<string> technologies)
{ {
Technologies = technologies; Technologies = technologies;
} }
public TechnologyDatabaseState(List<TechnologyPrototype> technologies) public TechnologyDatabaseState(List<TechnologyPrototype> technologies) : base(ContentNetIDs.TECHNOLOGY_DATABASE)
{ {
Technologies = new List<string>(); Technologies = new List<string>();
foreach (var technology in technologies) foreach (var technology in technologies)

View File

@@ -12,9 +12,7 @@ namespace Content.Shared.GameObjects.Components
[Serializable, NetSerializable] [Serializable, NetSerializable]
protected sealed class HandheldLightComponentState : ComponentState protected sealed class HandheldLightComponentState : ComponentState
{ {
public override uint NetID => ContentNetIDs.HANDHELD_LIGHT; public HandheldLightComponentState(float? charge) : base(ContentNetIDs.HANDHELD_LIGHT)
public HandheldLightComponentState(float? charge)
{ {
Charge = charge; Charge = charge;
} }

View File

@@ -107,9 +107,8 @@ namespace Content.Shared.GameObjects.Components
{ {
public int Count { get; } public int Count { get; }
public int MaxCount { get; } public int MaxCount { get; }
public override uint NetID => ContentNetIDs.STACK;
public StackComponentState(int count, int maxCount) public StackComponentState(int count, int maxCount) : base(ContentNetIDs.STACK)
{ {
Count = count; Count = count;
MaxCount = maxCount; MaxCount = maxCount;

View File

@@ -20,9 +20,7 @@ namespace Content.Shared.GameObjects.Components.Weapons.Ranged
/// </remarks> /// </remarks>
public (int count, int max)? MagazineCount { get; } public (int count, int max)? MagazineCount { get; }
public override uint NetID => ContentNetIDs.BALLISTIC_MAGAZINE_WEAPON; public BallisticMagazineWeaponComponentState(bool chambered, (int count, int max)? magazineCount) : base(ContentNetIDs.BALLISTIC_MAGAZINE_WEAPON)
public BallisticMagazineWeaponComponentState(bool chambered, (int count, int max)? magazineCount)
{ {
Chambered = chambered; Chambered = chambered;
MagazineCount = magazineCount; MagazineCount = magazineCount;