diff --git a/Content.Client/Info/RulesPopup.xaml.cs b/Content.Client/Info/RulesPopup.xaml.cs index d770b83dc23..745c3a8f1f9 100644 --- a/Content.Client/Info/RulesPopup.xaml.cs +++ b/Content.Client/Info/RulesPopup.xaml.cs @@ -22,7 +22,7 @@ public sealed partial class RulesPopup : Control } public event Action? OnQuitPressed; - public event Action? OnAcceptPressed; + public event Action? OnAcceptPressed; public RulesPopup() { @@ -39,7 +39,7 @@ public sealed partial class RulesPopup : Control private void OnAcceptButtonPressed(BaseButton.ButtonEventArgs obj) { - OnAcceptPressed?.Invoke(); + OnAcceptPressed?.Invoke(false); } protected override void FrameUpdate(FrameEventArgs args) diff --git a/Content.Client/UserInterface/Systems/Info/InfoUIController.cs b/Content.Client/UserInterface/Systems/Info/InfoUIController.cs index 692ee26774b..e99de020cbb 100644 --- a/Content.Client/UserInterface/Systems/Info/InfoUIController.cs +++ b/Content.Client/UserInterface/Systems/Info/InfoUIController.cs @@ -37,7 +37,7 @@ public sealed class InfoUIController : UIController, IOnStateExited { - OnAcceptPressed(); + OnAcceptPressed(true); }); } @@ -79,9 +79,10 @@ public sealed class InfoUIController : UIController, IOnStateExited DateTime.UtcNow - TimeSpan.FromDays(60); @@ -24,8 +29,8 @@ public sealed class RulesManager private async void OnConnected(object? sender, NetChannelArgs e) { - var isLocalhost = IPAddress.IsLoopback(e.Channel.RemoteEndPoint.Address) && - _cfg.GetCVar(CCVars.RulesExemptLocal); + var isLocalhost = IPAddress.IsLoopback(e.Channel.RemoteEndPoint.Address) && + _cfg.GetCVar(CCVars.RulesExemptLocal); var lastRead = await _dbManager.GetLastReadRules(e.Channel.UserId); var hasCooldown = lastRead > LastValidReadTime; @@ -43,5 +48,7 @@ public sealed class RulesManager { var date = DateTime.UtcNow; await _dbManager.SetLastReadRules(message.MsgChannel.UserId, date); + if (message.FuckRules && _player.TryGetSessionById(message.MsgChannel.UserId, out var session)) + _adminLog.Add(LogType.Connection, LogImpact.Extreme, $"Player {session} used the fuckrules command."); } } diff --git a/Content.Shared/Info/RulesMessages.cs b/Content.Shared/Info/RulesMessages.cs index 999e5441daf..2436d090ddb 100644 --- a/Content.Shared/Info/RulesMessages.cs +++ b/Content.Shared/Info/RulesMessages.cs @@ -1,4 +1,4 @@ -using Lidgren.Network; +using Lidgren.Network; using Robust.Shared.Network; using Robust.Shared.Serialization; @@ -35,13 +35,21 @@ public sealed class SendRulesInformationMessage : NetMessage /// public sealed class RulesAcceptedMessage : NetMessage { + /// + /// Whether or not the player used the "fuckrules" command to skip the rules window countdown. + /// If true this will create an admin log and a warning the for the admins to see. + /// + public bool FuckRules; + public override MsgGroups MsgGroup => MsgGroups.Command; public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer) { + FuckRules = buffer.ReadBoolean(); } public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer) { + buffer.Write(FuckRules); } }