Files
tbd-station-14/Content.Shared/Administration/PlayerInfo.cs
Pieter-Jan Briers 73df3b1593 Stop network serializing prototypes (#38602)
* Stop network serializing prototypes

Send the damn proto ID instead.

* Fix sandbox violation
2025-06-26 19:27:23 -04:00

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();
}
}