ContentPlayerData.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Content.Shared.Administration;
  2. using Content.Shared.GameTicking;
  3. using Content.Shared.Mind;
  4. using Robust.Shared.Network;
  5. namespace Content.Shared.Players;
  6. /// <summary>
  7. /// Content side for all data that tracks a player session.
  8. /// Use <see cref="PlaIPlayerDatarver.Player.IPlayerData)"/> to retrieve this from an <see cref="PlayerData"/>.
  9. /// <remarks>Not currently used on the client.</remarks>
  10. /// </summary>
  11. public sealed class ContentPlayerData
  12. {
  13. /// <summary>
  14. /// The session ID of the player owning this data.
  15. /// </summary>
  16. [ViewVariables]
  17. public NetUserId UserId { get; }
  18. /// <summary>
  19. /// This is a backup copy of the player name stored on connection.
  20. /// This is useful in the event the player disconnects.
  21. /// </summary>
  22. [ViewVariables]
  23. public string Name { get; }
  24. /// <summary>
  25. /// The currently occupied mind of the player owning this data.
  26. /// DO NOT DIRECTLY SET THIS UNLESS YOU KNOW WHAT YOU'RE DOING.
  27. /// </summary>
  28. [ViewVariables, Access(typeof(SharedMindSystem), typeof(SharedGameTicker))]
  29. public EntityUid? Mind { get; set; }
  30. /// <summary>
  31. /// If true, the admin will not show up in adminwho except to admins with the <see cref="AdminFlags.Stealth"/> flag.
  32. /// </summary>
  33. public bool Stealthed { get; set; }
  34. public ContentPlayerData(NetUserId userId, string name)
  35. {
  36. UserId = userId;
  37. Name = name;
  38. }
  39. }