Add admin logs for connecting/disconnecting players (#42363)

* Initial commit

* small tweak

---------

Co-authored-by: ScarKy0 <scarky0@onet.eu>
This commit is contained in:
SlamBamActionman 2026-01-11 22:34:08 +01:00 committed by BarryNorfolk
parent 399a86860d
commit 66ac4f1e42
2 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,6 @@
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.Database;
using Content.Shared.GameTicking;
using Content.Shared.GameWindow;
using Content.Shared.Players;
@ -92,6 +93,7 @@ namespace Content.Server.GameTicking
else
SpawnWaitDb();
_adminLogger.Add(LogType.Connection, LogImpact.Low, $"User {args.Session:Player} attached to {(args.Session.AttachedEntity != null ? ToPrettyString(args.Session.AttachedEntity) : "nothing"):entity} connected to the game.");
break;
}
@ -118,6 +120,8 @@ namespace Content.Server.GameTicking
}
}
_adminLogger.Add(LogType.Connection, LogImpact.Low, $"User {args.Session:Player} attached to {(args.Session.AttachedEntity != null ? ToPrettyString(args.Session.AttachedEntity) : "nothing"):entity} connected to the game.");
break;
}
@ -130,6 +134,8 @@ namespace Content.Server.GameTicking
}
_userDb.ClientDisconnected(session);
_adminLogger.Add(LogType.Connection, LogImpact.Low, $"User {args.Session:Player} attached to {(args.Session.AttachedEntity != null ? ToPrettyString(args.Session.AttachedEntity) : "nothing"):entity} disconnected from the game.");
break;
}
}

View File

@ -482,6 +482,11 @@ public enum LogType
/// </summary>
Instrument = 103,
/// <summary>
/// Events related to players connecting/disconnecting.
/// </summary>
Connection = 104,
/// <summary>
/// Delta V - RMC Pose port
/// </summary>