pvs content (#5484)
Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
This commit is contained in:
@@ -99,7 +99,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
|||||||
Assert.True(buckle.Buckled);
|
Assert.True(buckle.Buckled);
|
||||||
|
|
||||||
var player = IoCManager.Resolve<IPlayerManager>().Sessions.Single();
|
var player = IoCManager.Resolve<IPlayerManager>().Sessions.Single();
|
||||||
Assert.True(((BuckleComponentState) buckle.GetComponentState(player)).Buckled);
|
Assert.True(((BuckleComponentState) buckle.GetComponentState()).Buckled);
|
||||||
Assert.False(actionBlocker.CanMove(human.Uid));
|
Assert.False(actionBlocker.CanMove(human.Uid));
|
||||||
Assert.False(actionBlocker.CanChangeDirection(human.Uid));
|
Assert.False(actionBlocker.CanChangeDirection(human.Uid));
|
||||||
Assert.False(standingState.Down(human.Uid));
|
Assert.False(standingState.Down(human.Uid));
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ namespace Content.IntegrationTests.Tests.Networking
|
|||||||
Foo = pred.Foo;
|
Foo = pred.Foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new PredictionComponentState(Foo);
|
return new PredictionComponentState(Foo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Content.Server.Atmos.Components
|
|||||||
Owner.TryGetComponent(out _appearance);
|
Owner.TryGetComponent(out _appearance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new GasAnalyzerComponentState(_pressureDanger);
|
return new GasAnalyzerComponentState(_pressureDanger);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ namespace Content.Server.Buckle.Components
|
|||||||
base.Shutdown();
|
base.Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
int? drawDepth = null;
|
int? drawDepth = null;
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ namespace Content.Server.Buckle.Components
|
|||||||
_occupiedSize = 0;
|
_occupiedSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new StrapComponentState(Position);
|
return new StrapComponentState(Position);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace Content.Server.Cargo.Components
|
|||||||
Database = EntitySystem.Get<CargoConsoleSystem>().StationOrderDatabase;
|
Database = EntitySystem.Get<CargoConsoleSystem>().StationOrderDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
if (!ConnectedToDatabase)
|
if (!ConnectedToDatabase)
|
||||||
return new CargoOrderDatabaseState(null);
|
return new CargoOrderDatabaseState(null);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace Content.Server.Cargo.Components
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class GalacticMarketComponent : SharedGalacticMarketComponent
|
public class GalacticMarketComponent : SharedGalacticMarketComponent
|
||||||
{
|
{
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new GalacticMarketState(GetProductIdList());
|
return new GalacticMarketState(GetProductIdList());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ namespace Content.Server.Chemistry.Components
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
var solutionSys = Owner.EntityManager.EntitySysManager.GetEntitySystem<SolutionContainerSystem>();
|
var solutionSys = Owner.EntityManager.EntitySysManager.GetEntitySystem<SolutionContainerSystem>();
|
||||||
return solutionSys.TryGetSolution(Owner.Uid, SolutionName, out var solution)
|
return solutionSys.TryGetSolution(Owner.Uid, SolutionName, out var solution)
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ namespace Content.Server.Chemistry.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
Owner.EntityManager.EntitySysManager.GetEntitySystem<SolutionContainerSystem>()
|
Owner.EntityManager.EntitySysManager.GetEntitySystem<SolutionContainerSystem>()
|
||||||
.TryGetSolution(Owner.Uid, SolutionName, out var solution);
|
.TryGetSolution(Owner.Uid, SolutionName, out var solution);
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace Content.Server.Climbing.Components
|
|||||||
IsClimbing = false;
|
IsClimbing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new ClimbModeComponentState(_isClimbing, OwnerIsTransitioning);
|
return new ClimbModeComponentState(_isClimbing, OwnerIsTransitioning);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace Content.Server.Clothing.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new ClothingComponentState(ClothingEquippedPrefix, EquippedPrefix);
|
return new ClothingComponentState(ClothingEquippedPrefix, EquippedPrefix);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ namespace Content.Server.Clothing.Components
|
|||||||
Toggle(eventArgs.User);
|
Toggle(eventArgs.User);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new MagbootsComponentState(On);
|
return new MagbootsComponentState(On);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ namespace Content.Server.Crayon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new CrayonComponentState(_color, SelectedState, Charges, Capacity);
|
return new CrayonComponentState(_color, SelectedState, Charges, Capacity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace Content.Server.Cuffs.Components
|
|||||||
Owner.EnsureComponentWarn<HandsComponent>();
|
Owner.EnsureComponentWarn<HandsComponent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
// there are 2 approaches i can think of to handle the handcuff overlay on players
|
// there are 2 approaches i can think of to handle the handcuff overlay on players
|
||||||
// 1 - make the current RSI the handcuff type that's currently active. all handcuffs on the player will appear the same.
|
// 1 - make the current RSI the handcuff type that's currently active. all handcuffs on the player will appear the same.
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace Content.Server.Cuffs.Components
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private bool _cuffing;
|
private bool _cuffing;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new HandcuffedComponentState(Broken ? BrokenState : string.Empty);
|
return new HandcuffedComponentState(Broken ? BrokenState : string.Empty);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Content.Server.DoAfter
|
|||||||
// we'll just send them the index. Doesn't matter if it wraps around.
|
// we'll just send them the index. Doesn't matter if it wraps around.
|
||||||
private byte _runningIndex;
|
private byte _runningIndex;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
var toAdd = new List<ClientDoAfter>();
|
var toAdd = new List<ClientDoAfter>();
|
||||||
|
|
||||||
|
|||||||
@@ -769,7 +769,7 @@ namespace Content.Server.Doors.Components
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new DoorComponentState(State, StateChangeStartTime, CurrentlyCrushing, GameTiming.CurTime);
|
return new DoorComponentState(State, StateChangeStartTime, CurrentlyCrushing, GameTiming.CurTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ namespace Content.Server.Inventory.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
var list = new List<KeyValuePair<Slots, EntityUid>>();
|
var list = new List<KeyValuePair<Slots, EntityUid>>();
|
||||||
foreach (var (slot, container) in _slotContainers)
|
foreach (var (slot, container) in _slotContainers)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Content.Server.Lathe.Components
|
|||||||
[DataField("static")]
|
[DataField("static")]
|
||||||
public bool Static { get; private set; } = false;
|
public bool Static { get; private set; } = false;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new LatheDatabaseState(GetRecipeIdList());
|
return new LatheDatabaseState(GetRecipeIdList());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Content.Server.Lathe.Components
|
|||||||
[DataField("StorageLimit")]
|
[DataField("StorageLimit")]
|
||||||
private int _storageLimit = -1;
|
private int _storageLimit = -1;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new MaterialStorageState(Storage);
|
return new MaterialStorageState(Storage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace Content.Server.Lathe.Components
|
|||||||
|
|
||||||
public override string Name => "ProtolatheDatabase";
|
public override string Name => "ProtolatheDatabase";
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new ProtolatheDatabaseState(GetRecipeIdList());
|
return new ProtolatheDatabaseState(GetRecipeIdList());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ namespace Content.Server.Light.Components
|
|||||||
return (byte?) ContentHelpers.RoundToNearestLevels(currentCharge / Cell.MaxCharge * 255, 255, StatusLevels);
|
return (byte?) ContentHelpers.RoundToNearestLevels(currentCharge / Cell.MaxCharge * 255, 255, StatusLevels);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new HandheldLightComponentState(GetLevel());
|
return new HandheldLightComponentState(GetLevel());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ namespace Content.Server.Nutrition.Components
|
|||||||
UpdateCurrentThreshold();
|
UpdateCurrentThreshold();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new HungerComponentState(_currentHungerThreshold);
|
return new HungerComponentState(_currentHungerThreshold);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ namespace Content.Server.Nutrition.Components
|
|||||||
UpdateCurrentThreshold();
|
UpdateCurrentThreshold();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new ThirstComponentState(_currentThirstThreshold);
|
return new ThirstComponentState(_currentThirstThreshold);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Content.Server.Projectiles.Components
|
|||||||
Dirty();
|
Dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new ProjectileComponentState(Shooter, IgnoreShooter);
|
return new ProjectileComponentState(Shooter, IgnoreShooter);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ namespace Content.Server.Radiation
|
|||||||
Dirty();
|
Dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new RadiationPulseState(_radsPerSecond, _range, Draw, Decay, _endTime);
|
return new RadiationPulseState(_radsPerSecond, _range, Draw, Decay, _endTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Content.Server.Research.Components
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class TechnologyDatabaseComponent : SharedTechnologyDatabaseComponent
|
public class TechnologyDatabaseComponent : SharedTechnologyDatabaseComponent
|
||||||
{
|
{
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new TechnologyDatabaseState(_technologies);
|
return new TechnologyDatabaseState(_technologies);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace Content.Server.Singularity.Components
|
|||||||
[DataField("singularityFormingSound")] private SoundSpecifier _singularityFormingSound = new SoundPathSpecifier("/Audio/Effects/singularity_form.ogg");
|
[DataField("singularityFormingSound")] private SoundSpecifier _singularityFormingSound = new SoundPathSpecifier("/Audio/Effects/singularity_form.ogg");
|
||||||
[DataField("singularityCollapsingSound")] private SoundSpecifier _singularityCollapsingSound = new SoundPathSpecifier("/Audio/Effects/singularity_collapse.ogg");
|
[DataField("singularityCollapsingSound")] private SoundSpecifier _singularityCollapsingSound = new SoundPathSpecifier("/Audio/Effects/singularity_collapse.ogg");
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new SingularityComponentState(Level);
|
return new SingularityComponentState(Level);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ namespace Content.Server.Suspicion
|
|||||||
message.AddMarkup(tooltip);
|
message.AddMarkup(tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
if (Role == null)
|
if (Role == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
UpdateAppearance();
|
UpdateAppearance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
(int, int)? count = (ShotsLeft, Capacity);
|
(int, int)? count = (ShotsLeft, Capacity);
|
||||||
var chamberedExists = _chamberContainer.ContainedEntity != null;
|
var chamberedExists = _chamberContainer.ContainedEntity != null;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
UpdateAppearance();
|
UpdateAppearance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
(int, int)? count = (ShotsLeft, Capacity);
|
(int, int)? count = (ShotsLeft, Capacity);
|
||||||
var chamberedExists = _chamberContainer.ContainedEntity != null;
|
var chamberedExists = _chamberContainer.ContainedEntity != null;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
_ammoSlots = new IEntity[_serializedCapacity];
|
_ammoSlots = new IEntity[_serializedCapacity];
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
var slotsSpent = new bool?[Capacity];
|
var slotsSpent = new bool?[Capacity];
|
||||||
for (var i = 0; i < Capacity; i++)
|
for (var i = 0; i < Capacity; i++)
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
[DataField("soundPowerCellEject", required: true)]
|
[DataField("soundPowerCellEject", required: true)]
|
||||||
private SoundSpecifier _soundPowerCellEject = default!;
|
private SoundSpecifier _soundPowerCellEject = default!;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
(int, int)? count = (ShotsLeft, Capacity);
|
(int, int)? count = (ShotsLeft, Capacity);
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
(int, int)? count = null;
|
(int, int)? count = null;
|
||||||
var magazine = MagazineContainer.ContainedEntity;
|
var magazine = MagazineContainer.ContainedEntity;
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ namespace Content.Server.Weapon.Ranged
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new RangedWeaponComponentState(FireRateSelector);
|
return new RangedWeaponComponentState(FireRateSelector);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace Content.Shared.Actions.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new ActionComponentState(_actions, _itemActions);
|
return new ActionComponentState(_actions, _itemActions);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace Content.Shared.Alert
|
|||||||
_alerts = state.Alerts;
|
_alerts = state.Alerts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new AlertsComponentState(_alerts);
|
return new AlertsComponentState(_alerts);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ namespace Content.Shared.Body.Components
|
|||||||
return SlotParts.ElementAt(index);
|
return SlotParts.ElementAt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
var parts = new (string slot, EntityUid partId)[SlotParts.Count];
|
var parts = new (string slot, EntityUid partId)[SlotParts.Count];
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace Content.Shared.Body.Components
|
|||||||
Dirty();
|
Dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
var mechanismIds = new EntityUid[_mechanisms.Count];
|
var mechanismIds = new EntityUid[_mechanisms.Count];
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Content.Shared.Chemistry.Components
|
|||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public TimeSpan ModifierTimer { get; set; } = TimeSpan.Zero;
|
public TimeSpan ModifierTimer { get; set; } = TimeSpan.Zero;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new MovespeedModifierMetabolismComponentState(WalkSpeedModifier, SprintSpeedModifier, ModifierTimer);
|
return new MovespeedModifierMetabolismComponentState(WalkSpeedModifier, SprintSpeedModifier, ModifierTimer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace Content.Shared.CombatMode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new CombatModeComponentState(IsInCombatMode, ActiveZone);
|
return new CombatModeComponentState(IsInCombatMode, ActiveZone);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace Content.Shared.Cooldown
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new ItemCooldownComponentState
|
return new ItemCooldownComponentState
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace Content.Shared.Disposal.Components
|
|||||||
Pressurizing
|
Pressurizing
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new DisposalUnitComponentState(RecentlyEjected);
|
return new DisposalUnitComponentState(RecentlyEjected);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Content.Shared.Emoting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new EmotingComponentState(Enabled);
|
return new EmotingComponentState(Enabled);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,14 +10,18 @@ namespace Content.Shared.Flash
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<SharedFlashableComponent, ComponentGetState>(OnFlashableGetState);
|
SubscribeLocalEvent<SharedFlashableComponent, ComponentGetState>(OnFlashableGetState);
|
||||||
|
SubscribeLocalEvent<SharedFlashableComponent, ComponentGetStateAttemptEvent>(OnGetStateAttempt);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnGetStateAttempt(EntityUid uid, SharedFlashableComponent component, ComponentGetStateAttemptEvent args)
|
||||||
|
{
|
||||||
|
// Only send state to the player attached to the entity.
|
||||||
|
if (args.Player.AttachedEntityUid != uid)
|
||||||
|
args.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnFlashableGetState(EntityUid uid, SharedFlashableComponent component, ref ComponentGetState args)
|
private void OnFlashableGetState(EntityUid uid, SharedFlashableComponent component, ref ComponentGetState args)
|
||||||
{
|
{
|
||||||
// Only send state to the player attached to the entity.
|
|
||||||
if (args.Player.AttachedEntityUid != uid)
|
|
||||||
return;
|
|
||||||
|
|
||||||
args.State = new FlashableComponentState(component.Duration, component.LastFlash);
|
args.State = new FlashableComponentState(component.Duration, component.LastFlash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Content.Shared.Friction
|
|||||||
[DataField("modifier")]
|
[DataField("modifier")]
|
||||||
private float _modifier = 1.0f;
|
private float _modifier = 1.0f;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession session)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new TileFrictionComponentState(_modifier);
|
return new TileFrictionComponentState(_modifier);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Content.Shared.Ghost
|
|||||||
[DataField("canReturnToBody")]
|
[DataField("canReturnToBody")]
|
||||||
private bool _canReturnToBody;
|
private bool _canReturnToBody;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new GhostComponentState(CanReturnToBody, CanGhostInteract);
|
return new GhostComponentState(CanReturnToBody, CanGhostInteract);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace Content.Shared.Gravity
|
|||||||
|
|
||||||
private bool _enabled;
|
private bool _enabled;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new GravityComponentState(_enabled);
|
return new GravityComponentState(_enabled);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Content.Shared.Hands.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new VirtualItemComponentState(BlockingEntity);
|
return new VirtualItemComponentState(BlockingEntity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace Content.Shared.Hands.Components
|
|||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
public float ThrowRange { get; set; } = 8f;
|
public float ThrowRange { get; set; } = 8f;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
var hands = new HandState[Hands.Count];
|
var hands = new HandState[Hands.Count];
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace Content.Shared.Item
|
|||||||
[DataField("sprite")]
|
[DataField("sprite")]
|
||||||
private string? _rsiPath;
|
private string? _rsiPath;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new ItemComponentState(Size, EquippedPrefix, Color, RsiPath);
|
return new ItemComponentState(Size, EquippedPrefix, Color, RsiPath);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace Content.Shared.MobState.Components
|
|||||||
base.OnRemove();
|
base.OnRemove();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new MobStateComponentState(CurrentThreshold);
|
return new MobStateComponentState(CurrentThreshold);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ namespace Content.Shared.Movement.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new MoverComponentState(_heldMoveButtons);
|
return new MoverComponentState(_heldMoveButtons);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ namespace Content.Shared.Movement.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession session)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new PlayerMobMoverComponentState(_grabRange, _pushStrength, _weightlessStrength);
|
return new PlayerMobMoverComponentState(_grabRange, _pushStrength, _weightlessStrength);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Content.Shared.Placeable
|
|||||||
[DataField("positionOffset")]
|
[DataField("positionOffset")]
|
||||||
public Vector2 PositionOffset { get; set; }
|
public Vector2 PositionOffset { get; set; }
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession session)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new PlaceableSurfaceComponentState(IsPlaceable,PlaceCentered, PositionOffset);
|
return new PlaceableSurfaceComponentState(IsPlaceable,PlaceCentered, PositionOffset);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Content.Shared.Pulling.Components
|
|||||||
|
|
||||||
public EntityCoordinates? MovingTo { get; set; }
|
public EntityCoordinates? MovingTo { get; set; }
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new PullableComponentState(Puller?.Uid);
|
return new PullableComponentState(Puller?.Uid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Content.Shared.Shuttles.Components
|
|||||||
Console = shuttleConsoleComponent;
|
Console = shuttleConsoleComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new PilotComponentState(Console?.OwnerUid);
|
return new PilotComponentState(Console?.OwnerUid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Content.Shared.Singularity.Components
|
|||||||
set => this.SetAndDirtyIfChanged(ref _falloff, value);
|
set => this.SetAndDirtyIfChanged(ref _falloff, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new SingularityDistortionComponentState(Intensity, Falloff);
|
return new SingularityDistortionComponentState(Intensity, Falloff);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace Content.Shared.Slippery
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new SlipperyComponentState(ParalyzeTime, IntersectPercentage, RequiredSlipSpeed, LaunchForwardsMultiplier, Slippery, SlipSound.GetSound(), Slipped.ToArray());
|
return new SlipperyComponentState(ParalyzeTime, IntersectPercentage, RequiredSlipSpeed, LaunchForwardsMultiplier, Slippery, SlipSound.GetSound(), Slipped.ToArray());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Content.Shared.Standing
|
|||||||
[DataField("standing")]
|
[DataField("standing")]
|
||||||
public bool Standing { get; set; } = true;
|
public bool Standing { get; set; } = true;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new StandingComponentState(Standing);
|
return new StandingComponentState(Standing);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Content.Shared.SubFloor
|
|||||||
[DataField("requireAnchored")]
|
[DataField("requireAnchored")]
|
||||||
public bool RequireAnchored { get; set; } = true;
|
public bool RequireAnchored { get; set; } = true;
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
return new SubFloorHideComponentState(Enabled, RequireAnchored);
|
return new SubFloorHideComponentState(Enabled, RequireAnchored);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Content.Shared.Tag
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
public override ComponentState GetComponentState()
|
||||||
{
|
{
|
||||||
var tags = new string[_tags.Count];
|
var tags = new string[_tags.Count];
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
|||||||
@@ -52,18 +52,18 @@ namespace Content.Tests.Server.GameObjects.Components.Mobs
|
|||||||
Assert.That(alertManager.TryGet(AlertType.HighPressure, out var highpressure));
|
Assert.That(alertManager.TryGet(AlertType.HighPressure, out var highpressure));
|
||||||
|
|
||||||
alertsComponent.ShowAlert(AlertType.LowPressure);
|
alertsComponent.ShowAlert(AlertType.LowPressure);
|
||||||
var alertState = alertsComponent.GetComponentState(null) as AlertsComponentState;
|
var alertState = alertsComponent.GetComponentState() as AlertsComponentState;
|
||||||
Assert.NotNull(alertState);
|
Assert.NotNull(alertState);
|
||||||
Assert.That(alertState.Alerts.Count, Is.EqualTo(1));
|
Assert.That(alertState.Alerts.Count, Is.EqualTo(1));
|
||||||
Assert.That(alertState.Alerts.ContainsKey(lowpressure.AlertKey));
|
Assert.That(alertState.Alerts.ContainsKey(lowpressure.AlertKey));
|
||||||
|
|
||||||
alertsComponent.ShowAlert(AlertType.HighPressure);
|
alertsComponent.ShowAlert(AlertType.HighPressure);
|
||||||
alertState = alertsComponent.GetComponentState(null) as AlertsComponentState;
|
alertState = alertsComponent.GetComponentState() as AlertsComponentState;
|
||||||
Assert.That(alertState.Alerts.Count, Is.EqualTo(1));
|
Assert.That(alertState.Alerts.Count, Is.EqualTo(1));
|
||||||
Assert.That(alertState.Alerts.ContainsKey(highpressure.AlertKey));
|
Assert.That(alertState.Alerts.ContainsKey(highpressure.AlertKey));
|
||||||
|
|
||||||
alertsComponent.ClearAlertCategory(AlertCategory.Pressure);
|
alertsComponent.ClearAlertCategory(AlertCategory.Pressure);
|
||||||
alertState = alertsComponent.GetComponentState(null) as AlertsComponentState;
|
alertState = alertsComponent.GetComponentState() as AlertsComponentState;
|
||||||
Assert.That(alertState.Alerts.Count, Is.EqualTo(0));
|
Assert.That(alertState.Alerts.Count, Is.EqualTo(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user