]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove placing items on tabletop boards. (#29513)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Thu, 27 Jun 2024 14:57:55 +0000 (16:57 +0200)
committerGitHub <noreply@github.com>
Thu, 27 Jun 2024 14:57:55 +0000 (16:57 +0200)
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
Content.Shared/CCVar/CCVars.cs

index caa319a0b71829dadb02ae258b12e3538eb0d5da..f152648e21434a1058de4f411bbe20911e835f52 100644 (file)
@@ -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.Tabletop.Events;
 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 @@ namespace Content.Server.Tabletop
         [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 @@ namespace Content.Server.Tabletop
 
         private void OnInteractUsing(EntityUid uid, TabletopGameComponent component, InteractUsingEvent args)
         {
+            if (!_cfg.GetCVar(CCVars.GameTabletopPlace))
+                return;
+
             if (!EntityManager.TryGetComponent(args.User, out HandsComponent? hands))
                 return;
 
index ef3615f103b9a6107d448c5c74e6f65b14e743ce..a0e9157e922d9c1388ed11004ff23a4458ecd88f 100644 (file)
@@ -440,6 +440,16 @@ namespace Content.Shared.CCVar
         public static readonly CVarDef<bool> RoundEndPVSOverrides =
             CVarDef.Create("game.round_end_pvs_overrides", true, CVar.SERVERONLY);
 
+        /// <summary>
+        /// If true, players can place objects onto tabletop games like chess boards.
+        /// </summary>
+        /// <remarks>
+        /// This feature is currently highly abusable and can easily be used to crash the server,
+        /// so it's off by default.
+        /// </remarks>
+        public static readonly CVarDef<bool> GameTabletopPlace =
+            CVarDef.Create("game.tabletop_place", false, CVar.SERVERONLY);
+
         /*
          * Discord
          */