1
0

PlayerBeforeSpawnEvent.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using Content.Shared.Preferences;
  2. using JetBrains.Annotations;
  3. using Robust.Shared.Player;
  4. namespace Content.Shared.GameTicking;
  5. /// <summary>
  6. /// Event raised broadcast before a player is spawned by the GameTicker.
  7. /// You can use this event to spawn a player off-station on late-join but also at round start.
  8. /// When this event is handled, the GameTicker will not perform its own player-spawning logic.
  9. /// </summary>
  10. [PublicAPI]
  11. public sealed class PlayerBeforeSpawnEvent : HandledEntityEventArgs
  12. {
  13. public ICommonSession Player { get; }
  14. public HumanoidCharacterProfile Profile { get; }
  15. public string? JobId { get; }
  16. public bool LateJoin { get; }
  17. public EntityUid Station { get; }
  18. public PlayerBeforeSpawnEvent(ICommonSession player,
  19. HumanoidCharacterProfile profile,
  20. string? jobId,
  21. bool lateJoin,
  22. EntityUid station)
  23. {
  24. Player = player;
  25. Profile = profile;
  26. JobId = jobId;
  27. LateJoin = lateJoin;
  28. Station = station;
  29. }
  30. }