]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add admin logs for connecting/disconnecting players (#42363)
authorSlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Sun, 11 Jan 2026 21:34:08 +0000 (22:34 +0100)
committerGitHub <noreply@github.com>
Sun, 11 Jan 2026 21:34:08 +0000 (21:34 +0000)
* Initial commit

* small tweak

---------

Co-authored-by: ScarKy0 <scarky0@onet.eu>
Content.Server/GameTicking/GameTicker.Player.cs
Content.Shared.Database/LogType.cs

index 63821d9251cd82fcf58fac344e93adc180f9bec1..b5c9d790af9bbea624322b0f99e1a4d86d18bbb4 100644 (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;
                 }
             }
index d905cc03aede83b1962713e17c0dbb9d4818fd1e..c3687ec1697647cc0799bd38035174b6c233d4d7 100644 (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,
 }