Players with unknown playtimes now are tagged as new players, take 2 (#35648)
* your commit? our commit. * skreee * show joined players before lobby players; comments * comments * playerinfo retains playtime data after disconnect * new connection status symbols
This commit is contained in:
@@ -222,6 +222,7 @@ public sealed class AdminSystem : EntitySystem
|
||||
var entityName = string.Empty;
|
||||
var identityName = string.Empty;
|
||||
|
||||
// Visible (identity) name can be different from real name
|
||||
if (session?.AttachedEntity != null)
|
||||
{
|
||||
entityName = EntityManager.GetComponent<MetaDataComponent>(session.AttachedEntity.Value).EntityName;
|
||||
@@ -230,6 +231,7 @@ public sealed class AdminSystem : EntitySystem
|
||||
|
||||
var antag = false;
|
||||
|
||||
// Starting role, antagonist status and role type
|
||||
RoleTypePrototype roleType = new();
|
||||
var startingRole = string.Empty;
|
||||
if (_minds.TryGetMind(session, out var mindId, out var mindComp))
|
||||
@@ -243,8 +245,13 @@ public sealed class AdminSystem : EntitySystem
|
||||
startingRole = _jobs.MindTryGetJobName(mindId);
|
||||
}
|
||||
|
||||
// Connection status and playtime
|
||||
var connected = session != null && session.Status is SessionStatus.Connected or SessionStatus.InGame;
|
||||
TimeSpan? overallPlaytime = null;
|
||||
|
||||
// Start with the last available playtime data
|
||||
var cachedInfo = GetCachedPlayerInfo(data.UserId);
|
||||
var overallPlaytime = cachedInfo?.OverallPlaytime;
|
||||
// Overwrite with current playtime data, unless it's null (such as if the player just disconnected)
|
||||
if (session != null &&
|
||||
_playTime.TryGetTrackerTimes(session, out var playTimes) &&
|
||||
playTimes.TryGetValue(PlayTimeTrackingShared.TrackerOverall, out var playTime))
|
||||
|
||||
Reference in New Issue
Block a user