From fab436938a252a7871f912797f2a6cf816e92590 Mon Sep 17 00:00:00 2001 From: d4vid Date: Sun, 8 Jun 2025 19:46:56 +0200 Subject: [PATCH] Code cleanup --- DLatchPoke/DLatchPoke.csproj | 3 --- DLatchPoke/DLatchPoke/manifest.jecs | 2 +- DLatchPoke/DLatchPoke/src/client/DLatchPokeClient.cs | 4 +--- DLatchPoke/DLatchPoke/src/server/DLatchPokeServer.cs | 10 +--------- .../src/server/network/DLatchPokeRequestHandler.cs | 2 +- 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/DLatchPoke/DLatchPoke.csproj b/DLatchPoke/DLatchPoke.csproj index cf2426a..db0c6f7 100644 --- a/DLatchPoke/DLatchPoke.csproj +++ b/DLatchPoke/DLatchPoke.csproj @@ -69,7 +69,4 @@ - - - diff --git a/DLatchPoke/DLatchPoke/manifest.jecs b/DLatchPoke/DLatchPoke/manifest.jecs index e78bbbc..2da36f9 100644 --- a/DLatchPoke/DLatchPoke/manifest.jecs +++ b/DLatchPoke/DLatchPoke/manifest.jecs @@ -1,7 +1,7 @@ ID: D4VID_DLatchPoke Name: DLatch Poke Author: D4VID -Version: 1.0.0 +Version: 1.0.1 Priority: 0 Dependencies: - EccsLogicWorldAPI diff --git a/DLatchPoke/DLatchPoke/src/client/DLatchPokeClient.cs b/DLatchPoke/DLatchPoke/src/client/DLatchPokeClient.cs index 9a03986..272dac8 100644 --- a/DLatchPoke/DLatchPoke/src/client/DLatchPokeClient.cs +++ b/DLatchPoke/DLatchPoke/src/client/DLatchPokeClient.cs @@ -1,8 +1,6 @@ -using System; -using DLatchPoke.Client.Keybindings; +using DLatchPoke.Client.Keybindings; using DLatchPoke.Client.Network; using DLatchPoke.Shared.Packets.C2S; -using DLatchPoke.Shared.Packets.S2C; using EccsLogicWorldAPI.Client.Injectors; using FancyInput; using LogicAPI.Client; diff --git a/DLatchPoke/DLatchPoke/src/server/DLatchPokeServer.cs b/DLatchPoke/DLatchPoke/src/server/DLatchPokeServer.cs index 40aa6fb..4fe648a 100644 --- a/DLatchPoke/DLatchPoke/src/server/DLatchPokeServer.cs +++ b/DLatchPoke/DLatchPoke/src/server/DLatchPokeServer.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using DLatchPoke.Server.Network; @@ -7,7 +6,6 @@ using EccsLogicWorldAPI.Server; using EccsLogicWorldAPI.Server.Injectors; using EccsLogicWorldAPI.Shared.PacketWrapper; using LogicAPI.Data; -using LogicAPI.Networking; using LogicAPI.Networking.Packets.Initialization; using LogicAPI.Server; using LogicAPI.Server.Components; @@ -31,9 +29,6 @@ namespace DLatchPoke.Server { Logger.Info("DLatchPoke server mod loading"); _networkServer = ServiceGetter.getService(); - if (_networkServer == null) { - throw new Exception("Could not get Service 'NetworkServer'."); - } // Inject client verifier: RawJoinVerifierInjector.addVerifier(this); @@ -53,7 +48,6 @@ namespace DLatchPoke.Server { bool hasMod = ctx.ApprovalPacket.ClientMods.Contains(Manifest.ID); string playerName = ctx.PlayerID.Name; _playerHasMod[playerName] = hasMod; - Logger.Info($"Verifying player {playerName}: hasMod={hasMod}"); } /// @@ -73,8 +67,7 @@ namespace DLatchPoke.Server { /// Gets called from the DLatchPokeRequestHandler. /// Toggle the internal state of the DLatch /// - public void PokeDLatch(Connection sender, ComponentAddress componentAddress) { - Logger.Info("Got Poke DLatch request"); + public void PokeDLatch(ComponentAddress componentAddress) { LogicComponent component = _circuits.LookupComponent(componentAddress); if (component == null) { return; @@ -82,7 +75,6 @@ namespace DLatchPoke.Server { DLatch dLatch = component as DLatch; if (dLatch == null) { // the component is not of type DLatch - Logger.Info("Poke target is not a DLatch"); return; } diff --git a/DLatchPoke/DLatchPoke/src/server/network/DLatchPokeRequestHandler.cs b/DLatchPoke/DLatchPoke/src/server/network/DLatchPokeRequestHandler.cs index abccc2f..d8f9241 100644 --- a/DLatchPoke/DLatchPoke/src/server/network/DLatchPokeRequestHandler.cs +++ b/DLatchPoke/DLatchPoke/src/server/network/DLatchPokeRequestHandler.cs @@ -9,7 +9,7 @@ namespace DLatchPoke.Server.Network { } public override void Handle(DLatchPokeRequest packet, HandlerContext context) { - _dLatchPokeServer.PokeDLatch(context.Sender, packet.ComponentAddress); + _dLatchPokeServer.PokeDLatch(packet.ComponentAddress); } } } \ No newline at end of file