]> git.deb.at Git - rhonda/impostor.git/commitdiff
Allow spawning in the Dleks map
authorminiduikboot <mini@duikbo.at>
Wed, 24 Jan 2024 19:45:21 +0000 (20:45 +0100)
committerminiduikboot <mini@duikbo.at>
Wed, 24 Jan 2024 19:45:21 +0000 (20:45 +0100)
Now with 100% less crash cascades on spawn attempts and it even includes
working map data!

src/Impostor.Api/Innersloth/Maps/MapData.cs
src/Impostor.Api/Net/Inner/Objects/ShipStatus/IInnerDleksShipStatus.cs [new file with mode: 0644]
src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerDleksShipStatus.cs [new file with mode: 0644]
src/Impostor.Server/Net/State/Game.Data.cs

index 4b6e4eec85178f2f3ed7c8d2d9eff2cfeb26c658..6e3b831fd602a1e5ba42c8956718db5f117833fe 100644 (file)
@@ -14,6 +14,7 @@ public abstract class MapData
         [MapTypes.Skeld] = new SkeldData(),
         [MapTypes.MiraHQ] = new MiraData(),
         [MapTypes.Polus] = new PolusData(),
+        [MapTypes.Dleks] = new AprilData(),
         [MapTypes.Airship] = new AirshipData(),
         [MapTypes.Fungle] = new FungleData(),
     }.AsReadOnly();
diff --git a/src/Impostor.Api/Net/Inner/Objects/ShipStatus/IInnerDleksShipStatus.cs b/src/Impostor.Api/Net/Inner/Objects/ShipStatus/IInnerDleksShipStatus.cs
new file mode 100644 (file)
index 0000000..773cf46
--- /dev/null
@@ -0,0 +1,6 @@
+namespace Impostor.Api.Net.Inner.Objects.ShipStatus
+{
+    public interface IInnerDleksShipStatus : IInnerShipStatus
+    {
+    }
+}
diff --git a/src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerDleksShipStatus.cs b/src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerDleksShipStatus.cs
new file mode 100644 (file)
index 0000000..e0cb727
--- /dev/null
@@ -0,0 +1,28 @@
+using System.Collections.Generic;
+using Impostor.Api.Innersloth;
+using Impostor.Api.Net.Custom;
+using Impostor.Api.Net.Inner.Objects.ShipStatus;
+using Impostor.Server.Net.Inner.Objects.Systems;
+using Impostor.Server.Net.Inner.Objects.Systems.ShipStatus;
+using Impostor.Server.Net.State;
+
+namespace Impostor.Server.Net.Inner.Objects.ShipStatus
+{
+    internal class InnerDleksShipStatus : InnerShipStatus, IInnerDleksShipStatus
+    {
+        public InnerDleksShipStatus(ICustomMessageManager<ICustomRpc> customMessageManager, Game game) : base(customMessageManager, game, MapTypes.Dleks)
+        {
+        }
+
+        protected override void AddSystems(Dictionary<SystemTypes, ISystemType> systems)
+        {
+            base.AddSystems(systems);
+
+            systems.Add(SystemTypes.Doors, new AutoDoorsSystemType(Doors));
+            systems.Add(SystemTypes.Comms, new HudOverrideSystemType());
+            systems.Add(SystemTypes.Security, new SecurityCameraSystemType());
+            systems.Add(SystemTypes.Reactor, new ReactorSystemType());
+            systems.Add(SystemTypes.LifeSupp, new LifeSuppSystemType());
+        }
+    }
+}
index 2761893d40defb61f7044c4d6484f2e535f55c9d..b458eb39f0882d470ce1948242724c579abbacbd 100644 (file)
@@ -39,7 +39,7 @@ namespace Impostor.Server.Net.State
             [4] = typeof(InnerPlayerControl),
             [5] = typeof(InnerMiraShipStatus),
             [6] = typeof(InnerPolusShipStatus),
-            [7] = typeof(InnerShipStatus),
+            [7] = typeof(InnerDleksShipStatus),
             [8] = typeof(InnerAirshipStatus),
             [9] = typeof(InnerHideAndSeekManager),
             [10] = typeof(InnerNormalGameManager),