From d640f90d8848d5fec049fc96d6076ba08ff0437a Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Wed, 24 Jan 2024 20:45:21 +0100 Subject: [PATCH] Allow spawning in the Dleks map Now with 100% less crash cascades on spawn attempts and it even includes working map data! --- src/Impostor.Api/Innersloth/Maps/MapData.cs | 1 + .../ShipStatus/IInnerDleksShipStatus.cs | 6 ++++ .../ShipStatus/InnerDleksShipStatus.cs | 28 +++++++++++++++++++ src/Impostor.Server/Net/State/Game.Data.cs | 2 +- 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/Impostor.Api/Net/Inner/Objects/ShipStatus/IInnerDleksShipStatus.cs create mode 100644 src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerDleksShipStatus.cs diff --git a/src/Impostor.Api/Innersloth/Maps/MapData.cs b/src/Impostor.Api/Innersloth/Maps/MapData.cs index 4b6e4ee..6e3b831 100644 --- a/src/Impostor.Api/Innersloth/Maps/MapData.cs +++ b/src/Impostor.Api/Innersloth/Maps/MapData.cs @@ -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 index 0000000..773cf46 --- /dev/null +++ b/src/Impostor.Api/Net/Inner/Objects/ShipStatus/IInnerDleksShipStatus.cs @@ -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 index 0000000..e0cb727 --- /dev/null +++ b/src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerDleksShipStatus.cs @@ -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 customMessageManager, Game game) : base(customMessageManager, game, MapTypes.Dleks) + { + } + + protected override void AddSystems(Dictionary 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()); + } + } +} diff --git a/src/Impostor.Server/Net/State/Game.Data.cs b/src/Impostor.Server/Net/State/Game.Data.cs index 2761893..b458eb3 100644 --- a/src/Impostor.Server/Net/State/Game.Data.cs +++ b/src/Impostor.Server/Net/State/Game.Data.cs @@ -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), -- 2.39.5