2022-10-16 10:26:29 +13:00
|
|
|
using Robust.Shared.Network;
|
2021-11-10 13:26:25 +01:00
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2024-08-15 20:26:57 +02:00
|
|
|
namespace Content.Shared.Administration;
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public sealed record PlayerInfo(
|
|
|
|
|
string Username,
|
|
|
|
|
string CharacterName,
|
|
|
|
|
string IdentityName,
|
|
|
|
|
string StartingJob,
|
|
|
|
|
bool Antag,
|
|
|
|
|
NetEntity? NetEntity,
|
|
|
|
|
NetUserId SessionId,
|
|
|
|
|
bool Connected,
|
|
|
|
|
bool ActiveThisRound,
|
|
|
|
|
TimeSpan? OverallPlaytime)
|
2021-11-10 13:26:25 +01:00
|
|
|
{
|
2024-08-15 20:26:57 +02:00
|
|
|
private string? _playtimeString;
|
2023-10-14 14:56:06 -07:00
|
|
|
|
2024-08-15 20:26:57 +02:00
|
|
|
public bool IsPinned { get; set; }
|
2024-07-30 20:28:32 +12:00
|
|
|
|
2024-08-15 20:26:57 +02:00
|
|
|
public string PlaytimeString => _playtimeString ??=
|
|
|
|
|
OverallPlaytime?.ToString("%d':'hh':'mm") ?? Loc.GetString("generic-unknown-title");
|
2024-02-20 10:13:48 +01:00
|
|
|
|
2024-08-15 20:26:57 +02:00
|
|
|
public bool Equals(PlayerInfo? other)
|
|
|
|
|
{
|
|
|
|
|
return other?.SessionId == SessionId;
|
|
|
|
|
}
|
2024-02-20 10:13:48 +01:00
|
|
|
|
2024-08-15 20:26:57 +02:00
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return SessionId.GetHashCode();
|
2023-10-14 01:55:40 -07:00
|
|
|
}
|
2021-11-10 13:26:25 +01:00
|
|
|
}
|