Code cleanup

master preview-444
d4vid 3 months ago
parent 9dc4d733f4
commit fab436938a

@ -69,7 +69,4 @@
<ItemGroup>
<ProjectReference Include="..\EccsLogicWorldAPI\EccsLogicWorldAPI.csproj"/>
</ItemGroup>
<ItemGroup>
<Folder Include="src\shared\" />
</ItemGroup>
</Project>

@ -1,7 +1,7 @@
ID: D4VID_DLatchPoke
Name: DLatch Poke
Author: D4VID
Version: 1.0.0
Version: 1.0.1
Priority: 0
Dependencies:
- EccsLogicWorldAPI

@ -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;

@ -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<NetworkServer>();
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}");
}
/// <summary>
@ -73,8 +67,7 @@ namespace DLatchPoke.Server {
/// Gets called from the DLatchPokeRequestHandler.
/// Toggle the internal state of the DLatch
/// </summary>
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;
}

@ -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);
}
}
}
Loading…
Cancel
Save