diff --git a/NebulaModel/Packets/Factory/Belt/BeltReverseRequest.cs b/NebulaModel/Packets/Factory/Belt/BeltReverseRequestPacket.cs similarity index 62% rename from NebulaModel/Packets/Factory/Belt/BeltReverseRequest.cs rename to NebulaModel/Packets/Factory/Belt/BeltReverseRequestPacket.cs index bad5247c6..d77f157d4 100644 --- a/NebulaModel/Packets/Factory/Belt/BeltReverseRequest.cs +++ b/NebulaModel/Packets/Factory/Belt/BeltReverseRequestPacket.cs @@ -1,10 +1,10 @@ namespace NebulaModel.Packets.Factory.Belt; -public class BeltReverseRequest +public class BeltReverseRequestPacket { - public BeltReverseRequest() { } + public BeltReverseRequestPacket() { } - public BeltReverseRequest(int beltId, int planetId, int authorId) + public BeltReverseRequestPacket(int beltId, int planetId, int authorId) { BeltId = beltId; PlanetId = planetId; diff --git a/NebulaNetwork/PacketProcessors/Factory/Belt/BeltReverseProcessor.cs b/NebulaNetwork/PacketProcessors/Factory/Belt/BeltReverseProcessor.cs index 493f8237e..29f2f77b4 100644 --- a/NebulaNetwork/PacketProcessors/Factory/Belt/BeltReverseProcessor.cs +++ b/NebulaNetwork/PacketProcessors/Factory/Belt/BeltReverseProcessor.cs @@ -13,9 +13,9 @@ namespace NebulaNetwork.PacketProcessors.Factory.Belt; [RegisterPacketProcessor] -internal class BeltReverseProcessor : BasePacketProcessor +internal class BeltReverseProcessor : BasePacketProcessor { - public override void ProcessPacket(BeltReverseRequest packet, INebulaConnection conn) + public override void ProcessPacket(BeltReverseRequestPacket packet, INebulaConnection conn) { var factory = GameMain.galaxy.PlanetById(packet.PlanetId).factory; if (factory == null) @@ -34,6 +34,11 @@ public override void ProcessPacket(BeltReverseRequest packet, INebulaConnection NebulaModAPI.MultiplayerSession.Factories.EventFactory = factory; NebulaModAPI.MultiplayerSession.Factories.TargetPlanet = packet.PlanetId; NebulaModAPI.MultiplayerSession.Factories.PacketAuthor = packet.AuthorId; + if (IsHost) + { + // Load planet model + NebulaModAPI.MultiplayerSession.Factories.AddPlanetTimer(packet.PlanetId); + } var beltWindow = UIRoot.instance.uiGame.beltWindow; try diff --git a/NebulaPatcher/Patches/Dynamic/UIBeltWindow_Patch.cs b/NebulaPatcher/Patches/Dynamic/UIBeltWindow_Patch.cs index 4980bf942..87b4a9a74 100644 --- a/NebulaPatcher/Patches/Dynamic/UIBeltWindow_Patch.cs +++ b/NebulaPatcher/Patches/Dynamic/UIBeltWindow_Patch.cs @@ -19,7 +19,7 @@ public static bool OnReverseButtonClick_Prefix(UIBeltWindow __instance) if (Multiplayer.Session.Factories.IsIncomingRequest.Value) return true; // Notify others about belt direction reverse - var packet = new BeltReverseRequest(__instance.beltId, __instance.factory.planetId, Multiplayer.Session.LocalPlayer.Id); + var packet = new BeltReverseRequestPacket(__instance.beltId, __instance.factory.planetId, Multiplayer.Session.LocalPlayer.Id); if (Multiplayer.Session.IsServer) { var starId = __instance.factory.planetId / 100;