]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
cleanup RingerSystem (#36731)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sat, 19 Apr 2025 17:11:08 +0000 (19:11 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Apr 2025 17:11:08 +0000 (19:11 +0200)
cleanup ringersystem

Content.Client/PDA/Ringer/RingerSystem.cs
Content.Shared/PDA/SharedRingerSystem.cs

index 6d45a8ce8bd698f5a622a369ce35630a8875a7a4..6e2bb043cae9e93863b339cd16d565484ab0b15b 100644 (file)
@@ -33,24 +33,4 @@ public sealed class RingerSystem : SharedRingerSystem
             bui.Update();
         }
     }
-
-    /// <inheritdoc/>
-    public override bool TryToggleUplink(EntityUid uid, Note[] ringtone, EntityUid? user = null)
-    {
-        if (!TryComp<RingerUplinkComponent>(uid, out var uplink))
-            return false;
-
-        if (!HasComp<StoreComponent>(uid))
-            return false;
-
-        // Special case for client-side prediction:
-        // Since we can't expose the uplink code to clients for security reasons,
-        // we assume if an antagonist is trying to set a ringtone, it's to unlock the uplink.
-        // The server will properly verify the code and correct if needed.
-        if (IsAntagonist(user))
-            return ToggleUplinkInternal((uid, uplink));
-
-        // Non-antagonists never get to toggle the uplink on the client
-        return false;
-    }
 }
index 278ab94307519a53b61ded79dddf867742b00b90..0fa5a570aaed8f81685720d67547abcf309eaa0f 100644 (file)
@@ -145,16 +145,18 @@ public abstract class SharedRingerSystem : EntitySystem
 
     /// <summary>
     /// Attempts to unlock or lock the uplink by checking the provided ringtone against the uplink code.
-    /// On the client side, for antagonists, the code check is skipped to support prediction.
-    /// On the server side, the code is always verified.
+    /// On the client side, it does nothing since the client cannot know the code in advance.
+    /// On the server side, the code is verified.
     /// </summary>
     /// <param name="uid">The entity with the RingerUplinkComponent.</param>
     /// <param name="ringtone">The ringtone to check against the uplink code.</param>
-    /// <param name="user">The entity attempting to toggle the uplink. If the user is an antagonist,
-    /// the ringtone code check will be skipped on the client to allow prediction.</param>
+    /// <param name="user">The entity attempting to toggle the uplink.</param>
     /// <returns>True if the uplink state was toggled, false otherwise.</returns>
     [PublicAPI]
-    public abstract bool TryToggleUplink(EntityUid uid, Note[] ringtone, EntityUid? user = null);
+    public virtual bool TryToggleUplink(EntityUid uid, Note[] ringtone, EntityUid? user = null)
+    {
+        return false;
+    }
 
     #endregion