* Stop network serializing prototypes Send the damn proto ID instead. * Fix sandbox violation
41 lines
977 B
C#
41 lines
977 B
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)
|
|
{
|
|
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();
|
|
}
|
|
}
|