Move PlayerBeforeSpawnEvent and PlayerSpawnCompleteEvent to Shared
This commit is contained in:
@@ -7,12 +7,12 @@ using Content.Server.Spawners.Components;
|
|||||||
using Content.Server.Speech.Components;
|
using Content.Server.Speech.Components;
|
||||||
using Content.Server.Station.Components;
|
using Content.Server.Station.Components;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
|
using Content.Shared.GameTicking;
|
||||||
using Content.Shared.Mind;
|
using Content.Shared.Mind;
|
||||||
using Content.Shared.Players;
|
using Content.Shared.Players;
|
||||||
using Content.Shared.Preferences;
|
using Content.Shared.Preferences;
|
||||||
using Content.Shared.Roles;
|
using Content.Shared.Roles;
|
||||||
using Content.Shared.Roles.Jobs;
|
using Content.Shared.Roles.Jobs;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Map.Components;
|
using Robust.Shared.Map.Components;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
@@ -455,71 +455,4 @@ namespace Content.Server.GameTicking
|
|||||||
|
|
||||||
#endregion
|
#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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
33
Content.Shared/GameTicking/PlayerBeforeSpawnEvent.cs
Normal file
33
Content.Shared/GameTicking/PlayerBeforeSpawnEvent.cs
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
44
Content.Shared/GameTicking/PlayerSpawnCompleteEvent.cs
Normal file
44
Content.Shared/GameTicking/PlayerSpawnCompleteEvent.cs
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user