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 GitHub
parent 716e5ace87
commit 9338834b1b
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;
@@ -91,6 +92,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;
}
@@ -117,6 +119,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;
}
@@ -129,6 +133,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

@@ -478,4 +478,9 @@ public enum LogType
/// Events relating to midi playback.
/// </summary>
Instrument = 103,
/// <summary>
/// Events related to players connecting/disconnecting.
/// </summary>
Connection = 104,
}