diff --git a/Content.Server/Bed/Cryostorage/CryostorageSystem.cs b/Content.Server/Bed/Cryostorage/CryostorageSystem.cs index 345f51783c..21f43c3195 100644 --- a/Content.Server/Bed/Cryostorage/CryostorageSystem.cs +++ b/Content.Server/Bed/Cryostorage/CryostorageSystem.cs @@ -1,6 +1,6 @@ +using System.Globalization; using Content.Server.Chat.Managers; using Content.Server.Chat.Systems; -using Content.Server.GameTicking; using Content.Server.Ghost; using Content.Server.Hands.Systems; using Content.Server.Inventory; @@ -14,6 +14,7 @@ using Content.Shared.Bed.Cryostorage; using Content.Shared.Chat; using Content.Shared.Climbing.Systems; using Content.Shared.Database; +using Content.Shared.GameTicking; using Content.Shared.Hands.Components; using Content.Shared.Mind.Components; using Content.Shared.StationRecords; @@ -26,7 +27,6 @@ using Robust.Shared.Containers; using Robust.Shared.Enums; using Robust.Shared.Network; using Robust.Shared.Player; -using System.Globalization; namespace Content.Server.Bed.Cryostorage; diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs index 9c8b04770f..4bda391ae2 100644 --- a/Content.Server/GameTicking/GameTicker.Spawning.cs +++ b/Content.Server/GameTicking/GameTicker.Spawning.cs @@ -7,12 +7,12 @@ using Content.Server.Spawners.Components; using Content.Server.Speech.Components; using Content.Server.Station.Components; using Content.Shared.Database; +using Content.Shared.GameTicking; using Content.Shared.Mind; using Content.Shared.Players; using Content.Shared.Preferences; using Content.Shared.Roles; using Content.Shared.Roles.Jobs; -using JetBrains.Annotations; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Network; @@ -455,71 +455,4 @@ namespace Content.Server.GameTicking #endregion } - - /// - /// Event raised broadcast before a player is spawned by the GameTicker. - /// You can use this event to spawn a player off-station on late-join but also at round start. - /// When this event is handled, the GameTicker will not perform its own player-spawning logic. - /// - [PublicAPI] - public sealed class PlayerBeforeSpawnEvent : HandledEntityEventArgs - { - public ICommonSession Player { get; } - public HumanoidCharacterProfile Profile { get; } - public string? JobId { get; } - public bool LateJoin { get; } - public EntityUid Station { get; } - - public PlayerBeforeSpawnEvent(ICommonSession player, - HumanoidCharacterProfile profile, - string? jobId, - bool lateJoin, - EntityUid station) - { - Player = player; - Profile = profile; - JobId = jobId; - LateJoin = lateJoin; - Station = station; - } - } - - /// - /// Event raised both directed and broadcast when a player has been spawned by the GameTicker. - /// You can use this to handle people late-joining, or to handle people being spawned at round start. - /// Can be used to give random players a role, modify their equipment, etc. - /// - [PublicAPI] - public sealed class PlayerSpawnCompleteEvent : EntityEventArgs - { - public EntityUid Mob { get; } - public ICommonSession Player { get; } - public string? JobId { get; } - public bool LateJoin { get; } - public bool Silent { get; } - public EntityUid Station { get; } - public HumanoidCharacterProfile Profile { get; } - - // Ex. If this is the 27th person to join, this will be 27. - public int JoinOrder { get; } - - public PlayerSpawnCompleteEvent(EntityUid mob, - ICommonSession player, - string? jobId, - bool lateJoin, - bool silent, - int joinOrder, - EntityUid station, - HumanoidCharacterProfile profile) - { - Mob = mob; - Player = player; - JobId = jobId; - LateJoin = lateJoin; - Silent = silent; - Station = station; - Profile = profile; - JoinOrder = joinOrder; - } - } } diff --git a/Content.Server/GameTicking/Rules/DeathMatchRuleSystem.cs b/Content.Server/GameTicking/Rules/DeathMatchRuleSystem.cs index 557e44f095..2e97a72f3b 100644 --- a/Content.Server/GameTicking/Rules/DeathMatchRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/DeathMatchRuleSystem.cs @@ -6,6 +6,7 @@ using Content.Server.Mind; using Content.Server.Points; using Content.Server.RoundEnd; using Content.Server.Station.Systems; +using Content.Shared.GameTicking; using Content.Shared.GameTicking.Components; using Content.Shared.Points; using Content.Shared.Storage; diff --git a/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs b/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs index f56b16432e..51974d7036 100644 --- a/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs +++ b/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs @@ -4,7 +4,6 @@ using Content.Server.DeviceNetwork; using Content.Server.DeviceNetwork.Components; using Content.Server.DeviceNetwork.Systems; using Content.Server.Emp; -using Content.Server.GameTicking; using Content.Server.Medical.CrewMonitoring; using Content.Server.Popups; using Content.Server.Station.Systems; @@ -14,8 +13,10 @@ using Content.Shared.Damage; using Content.Shared.DeviceNetwork; using Content.Shared.DoAfter; using Content.Shared.Examine; +using Content.Shared.GameTicking; using Content.Shared.Interaction; using Content.Shared.Medical.SuitSensor; +using Content.Shared.Mobs; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Verbs; @@ -383,7 +384,7 @@ public sealed class SuitSensorSystem : EntitySystem // Get mob total damage crit threshold int? totalDamageThreshold = null; - if (_mobThresholdSystem.TryGetThresholdForState(sensor.User.Value, Shared.Mobs.MobState.Critical, out var critThreshold)) + if (_mobThresholdSystem.TryGetThresholdForState(sensor.User.Value, MobState.Critical, out var critThreshold)) totalDamageThreshold = critThreshold.Value.Int(); // finally, form suit sensor status diff --git a/Content.Server/Shuttles/Systems/ArrivalsSystem.cs b/Content.Server/Shuttles/Systems/ArrivalsSystem.cs index 46d2cd69b9..1f972d9675 100644 --- a/Content.Server/Shuttles/Systems/ArrivalsSystem.cs +++ b/Content.Server/Shuttles/Systems/ArrivalsSystem.cs @@ -19,10 +19,10 @@ using Content.Shared.Administration; using Content.Shared.CCVar; using Content.Shared.Damage.Components; using Content.Shared.DeviceNetwork; +using Content.Shared.GameTicking; using Content.Shared.Mobs.Components; using Content.Shared.Movement.Components; using Content.Shared.Parallax.Biomes; -using Content.Shared.Preferences; using Content.Shared.Salvage; using Content.Shared.Shuttles.Components; using Content.Shared.Tiles; diff --git a/Content.Server/Silicons/Laws/SiliconLawSystem.cs b/Content.Server/Silicons/Laws/SiliconLawSystem.cs index 9a361132a5..db78cc0ac7 100644 --- a/Content.Server/Silicons/Laws/SiliconLawSystem.cs +++ b/Content.Server/Silicons/Laws/SiliconLawSystem.cs @@ -1,7 +1,6 @@ using System.Linq; using Content.Server.Administration; using Content.Server.Chat.Managers; -using Content.Server.GameTicking; using Content.Server.Radio.Components; using Content.Server.Roles; using Content.Server.Station.Systems; @@ -9,6 +8,7 @@ using Content.Shared.Administration; using Content.Shared.Chat; using Content.Shared.Emag.Components; using Content.Shared.Emag.Systems; +using Content.Shared.GameTicking; using Content.Shared.Mind; using Content.Shared.Mind.Components; using Content.Shared.Roles; @@ -17,12 +17,11 @@ using Content.Shared.Silicons.Laws.Components; using Content.Shared.Stunnable; using Content.Shared.Wires; using Robust.Server.GameObjects; +using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Toolshed; -using Robust.Shared.Audio; -using Robust.Shared.GameObjects; namespace Content.Server.Silicons.Laws; diff --git a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs index e941e65c41..6dbc58f4d3 100644 --- a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs +++ b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs @@ -1,9 +1,8 @@ using System.Diagnostics.CodeAnalysis; -using System.IO; using Content.Server.Access.Systems; using Content.Server.Forensics; -using Content.Server.GameTicking; using Content.Shared.Access.Components; +using Content.Shared.GameTicking; using Content.Shared.Inventory; using Content.Shared.PDA; using Content.Shared.Preferences; diff --git a/Content.Server/Traits/TraitSystem.cs b/Content.Server/Traits/TraitSystem.cs index e19f736f06..38cbc1859c 100644 --- a/Content.Server/Traits/TraitSystem.cs +++ b/Content.Server/Traits/TraitSystem.cs @@ -1,11 +1,10 @@ -using Content.Server.GameTicking; +using Content.Shared.GameTicking; using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; using Content.Shared.Roles; using Content.Shared.Traits; using Content.Shared.Whitelist; using Robust.Shared.Prototypes; -using Robust.Shared.Serialization.Manager; namespace Content.Server.Traits; diff --git a/Content.Shared/GameTicking/PlayerBeforeSpawnEvent.cs b/Content.Shared/GameTicking/PlayerBeforeSpawnEvent.cs new file mode 100644 index 0000000000..48623ecf8e --- /dev/null +++ b/Content.Shared/GameTicking/PlayerBeforeSpawnEvent.cs @@ -0,0 +1,33 @@ +using Content.Shared.Preferences; +using JetBrains.Annotations; +using Robust.Shared.Player; + +namespace Content.Shared.GameTicking; + +/// +/// Event raised broadcast before a player is spawned by the GameTicker. +/// You can use this event to spawn a player off-station on late-join but also at round start. +/// When this event is handled, the GameTicker will not perform its own player-spawning logic. +/// +[PublicAPI] +public sealed class PlayerBeforeSpawnEvent : HandledEntityEventArgs +{ + public ICommonSession Player { get; } + public HumanoidCharacterProfile Profile { get; } + public string? JobId { get; } + public bool LateJoin { get; } + public EntityUid Station { get; } + + public PlayerBeforeSpawnEvent(ICommonSession player, + HumanoidCharacterProfile profile, + string? jobId, + bool lateJoin, + EntityUid station) + { + Player = player; + Profile = profile; + JobId = jobId; + LateJoin = lateJoin; + Station = station; + } +} diff --git a/Content.Shared/GameTicking/PlayerSpawnCompleteEvent.cs b/Content.Shared/GameTicking/PlayerSpawnCompleteEvent.cs new file mode 100644 index 0000000000..034b76beeb --- /dev/null +++ b/Content.Shared/GameTicking/PlayerSpawnCompleteEvent.cs @@ -0,0 +1,44 @@ +using Content.Shared.Preferences; +using JetBrains.Annotations; +using Robust.Shared.Player; + +namespace Content.Shared.GameTicking; + +/// +/// Event raised both directed and broadcast when a player has been spawned by the GameTicker. +/// You can use this to handle people late-joining, or to handle people being spawned at round start. +/// Can be used to give random players a role, modify their equipment, etc. +/// +[PublicAPI] +public sealed class PlayerSpawnCompleteEvent : EntityEventArgs +{ + public EntityUid Mob { get; } + public ICommonSession Player { get; } + public string? JobId { get; } + public bool LateJoin { get; } + public bool Silent { get; } + public EntityUid Station { get; } + public HumanoidCharacterProfile Profile { get; } + + // Ex. If this is the 27th person to join, this will be 27. + public int JoinOrder { get; } + + public PlayerSpawnCompleteEvent(EntityUid mob, + ICommonSession player, + string? jobId, + bool lateJoin, + bool silent, + int joinOrder, + EntityUid station, + HumanoidCharacterProfile profile) + { + Mob = mob; + Player = player; + JobId = jobId; + LateJoin = lateJoin; + Silent = silent; + Station = station; + Profile = profile; + JoinOrder = joinOrder; + } +}