]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Move PlayerBeforeSpawnEvent and PlayerSpawnCompleteEvent to Shared
authorDrSmugleaf <drsmugleaf@gmail.com>
Wed, 20 Nov 2024 05:15:15 +0000 (21:15 -0800)
committerDrSmugleaf <drsmugleaf@gmail.com>
Wed, 20 Nov 2024 05:15:15 +0000 (21:15 -0800)
Content.Server/GameTicking/GameTicker.Spawning.cs
Content.Shared/GameTicking/PlayerBeforeSpawnEvent.cs [new file with mode: 0644]
Content.Shared/GameTicking/PlayerSpawnCompleteEvent.cs [new file with mode: 0644]

index 9c8b04770fd909b84b160fff582ef55434de319d..4bda391ae27280f0146136a3d22ec0ac6a22527b 100644 (file)
@@ -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
     }
-
-    /// <summary>
-    ///     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.
-    /// </summary>
-    [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;
-        }
-    }
-
-    /// <summary>
-    ///     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.
-    /// </summary>
-    [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.Shared/GameTicking/PlayerBeforeSpawnEvent.cs b/Content.Shared/GameTicking/PlayerBeforeSpawnEvent.cs
new file mode 100644 (file)
index 0000000..48623ec
--- /dev/null
@@ -0,0 +1,33 @@
+using Content.Shared.Preferences;
+using JetBrains.Annotations;
+using Robust.Shared.Player;
+
+namespace Content.Shared.GameTicking;
+
+/// <summary>
+///     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.
+/// </summary>
+[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 (file)
index 0000000..034b76b
--- /dev/null
@@ -0,0 +1,44 @@
+using Content.Shared.Preferences;
+using JetBrains.Annotations;
+using Robust.Shared.Player;
+
+namespace Content.Shared.GameTicking;
+
+/// <summary>
+///     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.
+/// </summary>
+[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;
+    }
+}