]> git.deb.at Git - rhonda/impostor.git/commitdiff
Get rid of Rpc02 SyncSettings
authorminiduikboot <mini@duikbo.at>
Wed, 29 Nov 2023 21:14:59 +0000 (22:14 +0100)
committerminiduikboot <mini@duikbo.at>
Wed, 29 Nov 2023 21:14:59 +0000 (22:14 +0100)
This RPC is still sent by clients, but no longer used by clients. As the
server can get the info it wants from LogicOptions instead, remove this
RPC to prevent people from using it accidentally

src/Impostor.Api/Events/Game/IGameOptionsChangedEvent.cs
src/Impostor.Api/Net/Messages/Rpcs/Rpc02SyncSettings.cs [deleted file]
src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs

index 14d7b0c481e64021f1eed7a0bde79e732291caac..007ace91b89d58fde150dc20d9eca0fed237d982 100644 (file)
@@ -1,5 +1,4 @@
 using Impostor.Api.Games;
-using Impostor.Api.Net.Messages.Rpcs;
 
 namespace Impostor.Api.Events
 {
@@ -18,8 +17,7 @@ namespace Impostor.Api.Events
         public enum ChangeReason
         {
             /// <summary>
-            /// The options were changed by the host using
-            /// <see cref="Rpc02SyncSettings"/>.
+            /// The options were changed by the host using LogicOptions deserialization.
             /// </summary>
             /// <remarks>
             /// This event does not change the message sent to other players,
diff --git a/src/Impostor.Api/Net/Messages/Rpcs/Rpc02SyncSettings.cs b/src/Impostor.Api/Net/Messages/Rpcs/Rpc02SyncSettings.cs
deleted file mode 100644 (file)
index 3541e9d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-using Impostor.Api.Innersloth.GameOptions;
-
-namespace Impostor.Api.Net.Messages.Rpcs
-{
-    public static class Rpc02SyncSettings
-    {
-        public static void Serialize(IMessageWriter writer, IGameOptions gameOptionsData)
-        {
-            GameOptionsFactory.Serialize(writer, gameOptionsData);
-        }
-
-        public static void Deserialize(IMessageReader reader, out IGameOptions gameOptionsData)
-        {
-            gameOptionsData = GameOptionsFactory.Deserialize(reader);
-        }
-
-        public static void DeserializeInto(IMessageReader reader, IGameOptions gameOptionsData)
-        {
-            GameOptionsFactory.DeserializeInto(reader, gameOptionsData);
-        }
-    }
-}
index e562fa87e2416775379d84c7e4b86a47add28602..ff71299f68f4bd286deed48097fc17cb09b636be 100644 (file)
@@ -15,7 +15,6 @@ using Impostor.Api.Net.Inner;
 using Impostor.Api.Net.Inner.Objects;
 using Impostor.Api.Net.Messages.Rpcs;
 using Impostor.Api.Utils;
-using Impostor.Server.Events;
 using Impostor.Server.Events.Player;
 using Impostor.Server.Net.Inner.Objects.Components;
 using Impostor.Server.Net.State;
@@ -142,7 +141,7 @@ namespace Impostor.Server.Net.Inner.Objects
                         return false;
                     }
 
-                    Rpc02SyncSettings.DeserializeInto(reader, Game.Options);
+                    // Clients no longer handle this packet since 2022.12.8 but continue to send it
                     break;
                 }