Delta-v/Content.Shared/Administration/PlayerInfo.cs

44 lines
1.0 KiB
C#

using Content.Shared.Mind;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Administration;
[Serializable, NetSerializable]
public sealed record PlayerInfo(
string Username,
string CharacterName,
string IdentityName,
string StartingJob,
bool Antag,
ProtoId<RoleTypePrototype>? RoleProto,
LocId? Subtype,
int SortWeight,
NetEntity? NetEntity,
NetUserId SessionId,
bool Connected,
bool ActiveThisRound,
TimeSpan? OverallPlaytime,
bool Ghost, // DeltaV - Add Ghost
bool Watchlisted // DeltaV - Add Watchlisted
)
{
private string? _playtimeString;
public bool IsPinned { get; set; }
public string PlaytimeString => _playtimeString ??=
OverallPlaytime?.ToString("%d':'hh':'mm") ?? Loc.GetString("generic-unknown-title");
public bool Equals(PlayerInfo? other)
{
return other?.SessionId == SessionId;
}
public override int GetHashCode()
{
return SessionId.GetHashCode();
}
}