From 0896edf06c819080870e63e9744fd8f6e140b84c Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Thu, 27 Jun 2024 16:57:55 +0200 Subject: [PATCH 1/6] Remove placing items on tabletop boards. (#29513) This feature should never have been merged, it can be trivially abused to break the entire server. It's behind a CVar because honestly that's the easiest way to 1984 the feature. --- Content.Server/Tabletop/TabletopSystem.cs | 6 ++++++ Content.Shared/CCVar/CCVars.cs | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/Content.Server/Tabletop/TabletopSystem.cs b/Content.Server/Tabletop/TabletopSystem.cs index caa319a0b7..f152648e21 100644 --- a/Content.Server/Tabletop/TabletopSystem.cs +++ b/Content.Server/Tabletop/TabletopSystem.cs @@ -1,5 +1,6 @@ using Content.Server.Popups; using Content.Server.Tabletop.Components; +using Content.Shared.CCVar; using Content.Shared.Hands.Components; using Content.Shared.Interaction; using Content.Shared.Item; @@ -9,6 +10,7 @@ using Content.Shared.Verbs; using JetBrains.Annotations; using Robust.Server.GameObjects; +using Robust.Shared.Configuration; using Robust.Shared.Enums; using Robust.Shared.Map; using Robust.Shared.Player; @@ -23,6 +25,7 @@ public sealed partial class TabletopSystem : SharedTabletopSystem [Dependency] private readonly EyeSystem _eye = default!; [Dependency] private readonly ViewSubscriberSystem _viewSubscriberSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; public override void Initialize() { @@ -73,6 +76,9 @@ private void OnTabletopRequestTakeOut(TabletopRequestTakeOut msg, EntitySessionE private void OnInteractUsing(EntityUid uid, TabletopGameComponent component, InteractUsingEvent args) { + if (!_cfg.GetCVar(CCVars.GameTabletopPlace)) + return; + if (!EntityManager.TryGetComponent(args.User, out HandsComponent? hands)) return; diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index ef3615f103..a0e9157e92 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -440,6 +440,16 @@ public static readonly CVarDef public static readonly CVarDef RoundEndPVSOverrides = CVarDef.Create("game.round_end_pvs_overrides", true, CVar.SERVERONLY); + /// + /// If true, players can place objects onto tabletop games like chess boards. + /// + /// + /// This feature is currently highly abusable and can easily be used to crash the server, + /// so it's off by default. + /// + public static readonly CVarDef GameTabletopPlace = + CVarDef.Create("game.tabletop_place", false, CVar.SERVERONLY); + /* * Discord */ From 45cc19f3152f1f340d56af3edeba1fb4724fc0fa Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Thu, 27 Jun 2024 16:58:42 +0200 Subject: [PATCH 2/6] Add InteractUsing admin logs. (#29514) Apparently we did not have these. --- Content.Shared.Database/LogType.cs | 5 +++++ .../Interaction/SharedInteractionSystem.cs | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Content.Shared.Database/LogType.cs b/Content.Shared.Database/LogType.cs index 33a5d30c6a..eb2b8e1f6f 100644 --- a/Content.Shared.Database/LogType.cs +++ b/Content.Shared.Database/LogType.cs @@ -105,4 +105,9 @@ public enum LogType /// This is a default value used by PlayerRateLimitManager, though users can use different log types. /// RateLimited = 91, + + /// + /// A player did an item-use interaction of an item they were holding onto another object. + /// + InteractUsing = 92, } diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 1e4c49211f..48076ca360 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -486,6 +486,21 @@ public void InteractHand(EntityUid user, EntityUid target) public void InteractUsingRanged(EntityUid user, EntityUid used, EntityUid? target, EntityCoordinates clickLocation, bool inRangeUnobstructed) { + if (target != null) + { + _adminLogger.Add( + LogType.InteractUsing, + LogImpact.Low, + $"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target} using {ToPrettyString(used):used}"); + } + else + { + _adminLogger.Add( + LogType.InteractUsing, + LogImpact.Low, + $"{ToPrettyString(user):user} interacted with *nothing* using {ToPrettyString(used):used}"); + } + if (RangedInteractDoBefore(user, used, target, clickLocation, inRangeUnobstructed)) return; @@ -926,6 +941,11 @@ public void InteractUsing( if (checkCanUse && !_actionBlockerSystem.CanUseHeldEntity(user, used)) return; + _adminLogger.Add( + LogType.InteractUsing, + LogImpact.Low, + $"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target} using {ToPrettyString(used):used}"); + if (RangedInteractDoBefore(user, used, target, clickLocation, true)) return; From ced15b793424027e61c6976a62d7e1466388e3c2 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Thu, 27 Jun 2024 16:58:51 +0200 Subject: [PATCH 3/6] Fix coords monitor in replays (#29512) The F3 coords manager is blocked if you're not an admin. This check happened even when playing a replay, where you actually aren't. There's now a check to make sure you are actually server-connected-to-game before running the logic. Also moved it to a manager because this *shouldn't be a bloody entity system in the first place*. --- ...gMonitorSystem.cs => DebugMonitorManager.cs} | 17 +++++++++++------ Content.Client/Entry/EntryPoint.cs | 11 +++++++++++ Content.Client/IoC/ClientContentIoC.cs | 2 ++ 3 files changed, 24 insertions(+), 6 deletions(-) rename Content.Client/DebugMon/{DebugMonitorSystem.cs => DebugMonitorManager.cs} (51%) diff --git a/Content.Client/DebugMon/DebugMonitorSystem.cs b/Content.Client/DebugMon/DebugMonitorManager.cs similarity index 51% rename from Content.Client/DebugMon/DebugMonitorSystem.cs rename to Content.Client/DebugMon/DebugMonitorManager.cs index fb5cd4f51a..7e1dca0d6f 100644 --- a/Content.Client/DebugMon/DebugMonitorSystem.cs +++ b/Content.Client/DebugMon/DebugMonitorManager.cs @@ -1,23 +1,28 @@ -using Content.Client.Administration.Managers; +using Content.Client.Administration.Managers; using Content.Shared.CCVar; +using Robust.Client; using Robust.Client.UserInterface; using Robust.Shared.Configuration; - namespace Content.Client.DebugMon; /// -/// This handles preventing certain debug monitors from appearing. +/// This handles preventing certain debug monitors from being usable by non-admins. /// -public sealed class DebugMonitorSystem : EntitySystem +internal sealed class DebugMonitorManager { [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IClientAdminManager _admin = default!; [Dependency] private readonly IUserInterfaceManager _userInterface = default!; + [Dependency] private readonly IBaseClient _baseClient = default!; - public override void FrameUpdate(float frameTime) + public void FrameUpdate() { - if (!_admin.IsActive() && _cfg.GetCVar(CCVars.DebugCoordinatesAdminOnly)) + if (_baseClient.RunLevel == ClientRunLevel.InGame + && !_admin.IsActive() + && _cfg.GetCVar(CCVars.DebugCoordinatesAdminOnly)) + { _userInterface.DebugMonitors.SetMonitor(DebugMonitor.Coords, false); + } } } diff --git a/Content.Client/Entry/EntryPoint.cs b/Content.Client/Entry/EntryPoint.cs index dd7e781f0b..6caefb9a7e 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -1,6 +1,7 @@ using Content.Client.Administration.Managers; using Content.Client.Changelog; using Content.Client.Chat.Managers; +using Content.Client.DebugMon; using Content.Client.Eui; using Content.Client.Fullscreen; using Content.Client.GhostKick; @@ -33,6 +34,7 @@ using Robust.Shared.ContentPack; using Robust.Shared.Prototypes; using Robust.Shared.Replays; +using Robust.Shared.Timing; namespace Content.Client.Entry { @@ -68,6 +70,7 @@ public sealed class EntryPoint : GameClient [Dependency] private readonly IReplayLoadManager _replayLoad = default!; [Dependency] private readonly ILogManager _logManager = default!; [Dependency] private readonly ContentReplayPlaybackManager _replayMan = default!; + [Dependency] private readonly DebugMonitorManager _debugMonitorManager = default!; public override void Init() { @@ -205,5 +208,13 @@ private void SwitchToDefaultState(bool disconnected = false) _stateManager.RequestStateChange(); } } + + public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs) + { + if (level == ModUpdateLevel.FramePreEngine) + { + _debugMonitorManager.FrameUpdate(); + } + } } } diff --git a/Content.Client/IoC/ClientContentIoC.cs b/Content.Client/IoC/ClientContentIoC.cs index d1c595ae9b..328cf41d0d 100644 --- a/Content.Client/IoC/ClientContentIoC.cs +++ b/Content.Client/IoC/ClientContentIoC.cs @@ -2,6 +2,7 @@ using Content.Client.Changelog; using Content.Client.Chat.Managers; using Content.Client.Clickable; +using Content.Client.DebugMon; using Content.Client.Eui; using Content.Client.GhostKick; using Content.Client.Launcher; @@ -48,6 +49,7 @@ public static void Register() collection.Register(); collection.Register(); collection.Register(); + collection.Register(); } } } From 331c0fe3260db682cba5ffbefc2772e584efa7e5 Mon Sep 17 00:00:00 2001 From: PJBot Date: Thu, 27 Jun 2024 14:59:02 +0000 Subject: [PATCH 4/6] Automatic changelog update --- Resources/Changelog/Changelog.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 8d6ce1e457..dbe5c849f1 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,12 +1,4 @@ Entries: -- author: Killerqu00 - changes: - - message: Quartermasters can now skip a single bounty in the list once every 15 - minutes. - type: Add - id: 6325 - time: '2024-04-09T22:18:07.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/26537 - author: SkaldetSkaeg changes: - message: The Flippo lighter is now quieter and has a delay on use. @@ -3831,3 +3823,11 @@ id: 6824 time: '2024-06-27T02:08:57.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/29499 +- author: PJB3005 + changes: + - message: You can no longer place items onto tabletop games. The feature could + be easily abused to crash the server. + type: Remove + id: 6825 + time: '2024-06-27T14:57:55.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/29513 From 64192b35069ef0099ff3b42c2a56f3626c42b132 Mon Sep 17 00:00:00 2001 From: KonstantinAngelov <168754339+KonstantinAngelov@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:11:33 +0300 Subject: [PATCH 5/6] CookBook name,id and description changed to not be "meta" (#29467) * CookBook name,id and description changed * Id isues with CookBook fixed * Maps not added --- Resources/Prototypes/Catalog/Fills/Books/bookshelf.yml | 2 +- Resources/Prototypes/Catalog/Fills/Crates/service.yml | 2 +- Resources/Prototypes/Entities/Objects/Misc/books.yml | 6 +++--- Resources/migration.yml | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Resources/Prototypes/Catalog/Fills/Books/bookshelf.yml b/Resources/Prototypes/Catalog/Fills/Books/bookshelf.yml index b52e853008..09c7e165bf 100644 --- a/Resources/Prototypes/Catalog/Fills/Books/bookshelf.yml +++ b/Resources/Prototypes/Catalog/Fills/Books/bookshelf.yml @@ -15,7 +15,7 @@ orGroup: BookPool - id: BookBartendersManual orGroup: BookPool - - id: BookChefGaming + - id: BookHowToCookForFortySpaceman orGroup: BookPool - id: BookLeafLoversSecret orGroup: BookPool diff --git a/Resources/Prototypes/Catalog/Fills/Crates/service.yml b/Resources/Prototypes/Catalog/Fills/Crates/service.yml index 1876de6a53..f4c47cfe9e 100644 --- a/Resources/Prototypes/Catalog/Fills/Crates/service.yml +++ b/Resources/Prototypes/Catalog/Fills/Crates/service.yml @@ -173,7 +173,7 @@ - id: BookSpaceEncyclopedia - id: BookTheBookOfControl - id: BookBartendersManual - - id: BookChefGaming + - id: BookHowToCookForFortySpaceman - id: BookLeafLoversSecret - id: BookEngineersHandbook - id: BookScientistsGuidebook diff --git a/Resources/Prototypes/Entities/Objects/Misc/books.yml b/Resources/Prototypes/Entities/Objects/Misc/books.yml index 3fc90048dd..fd4cac781b 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/books.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/books.yml @@ -110,10 +110,10 @@ - Bartender - type: entity - id: BookChefGaming + id: BookHowToCookForFortySpaceman parent: BaseItem - name: chef gaming - description: A book about cooking written by a gamer chef. + name: How To Cook For Forty Spacemen + description: A book about cooking written by a space chef. components: - type: Sprite sprite: Objects/Misc/books.rsi diff --git a/Resources/migration.yml b/Resources/migration.yml index 6602fc1791..ef0a5f46b7 100644 --- a/Resources/migration.yml +++ b/Resources/migration.yml @@ -354,3 +354,7 @@ ClothingOuterCoatInspector: ClothingOuterCoatDetectiveLoadout # 2024-06-23 FloorTileItemReinforced: PartRodMetal1 + + +#2024-06-25 +BookChefGaming: BookHowToCookForFortySpaceman From 2ed32be51455f0dcf189d105ec7992fd252f2ae5 Mon Sep 17 00:00:00 2001 From: PJBot Date: Thu, 27 Jun 2024 15:12:39 +0000 Subject: [PATCH 6/6] Automatic changelog update --- Resources/Changelog/Changelog.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index dbe5c849f1..69de6e7a90 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,11 +1,4 @@ Entries: -- author: SkaldetSkaeg - changes: - - message: The Flippo lighter is now quieter and has a delay on use. - type: Tweak - id: 6326 - time: '2024-04-09T22:20:57.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/26846 - author: notquitehadouken changes: - message: Gave botanists droppers for easier chemical moving. @@ -3831,3 +3824,10 @@ id: 6825 time: '2024-06-27T14:57:55.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/29513 +- author: KonstantinAngelov + changes: + - message: Chef's Cookbook has a more IC name. + type: Tweak + id: 6826 + time: '2024-06-27T15:11:33.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/29467