1
0

PlayerSpawnCompleteEvent.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Content.Shared.Preferences;
  2. using JetBrains.Annotations;
  3. using Robust.Shared.Player;
  4. namespace Content.Shared.GameTicking;
  5. /// <summary>
  6. /// Event raised both directed and broadcast when a player has been spawned by the GameTicker.
  7. /// You can use this to handle people late-joining, or to handle people being spawned at round start.
  8. /// Can be used to give random players a role, modify their equipment, etc.
  9. /// </summary>
  10. [PublicAPI]
  11. public sealed class PlayerSpawnCompleteEvent : EntityEventArgs
  12. {
  13. public EntityUid Mob { get; }
  14. public ICommonSession Player { get; }
  15. public string? JobId { get; }
  16. public bool LateJoin { get; }
  17. public bool Silent { get; }
  18. public EntityUid Station { get; }
  19. public HumanoidCharacterProfile Profile { get; }
  20. // Ex. If this is the 27th person to join, this will be 27.
  21. public int JoinOrder { get; }
  22. public PlayerSpawnCompleteEvent(EntityUid mob,
  23. ICommonSession player,
  24. string? jobId,
  25. bool lateJoin,
  26. bool silent,
  27. int joinOrder,
  28. EntityUid station,
  29. HumanoidCharacterProfile profile)
  30. {
  31. Mob = mob;
  32. Player = player;
  33. JobId = jobId;
  34. LateJoin = lateJoin;
  35. Silent = silent;
  36. Station = station;
  37. Profile = profile;
  38. JoinOrder = joinOrder;
  39. }
  40. }