|
|
@ -1,4 +1,3 @@
|
|
|
|
using System;
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using DLatchPoke.Server.Network;
|
|
|
|
using DLatchPoke.Server.Network;
|
|
|
@ -7,7 +6,6 @@ using EccsLogicWorldAPI.Server;
|
|
|
|
using EccsLogicWorldAPI.Server.Injectors;
|
|
|
|
using EccsLogicWorldAPI.Server.Injectors;
|
|
|
|
using EccsLogicWorldAPI.Shared.PacketWrapper;
|
|
|
|
using EccsLogicWorldAPI.Shared.PacketWrapper;
|
|
|
|
using LogicAPI.Data;
|
|
|
|
using LogicAPI.Data;
|
|
|
|
using LogicAPI.Networking;
|
|
|
|
|
|
|
|
using LogicAPI.Networking.Packets.Initialization;
|
|
|
|
using LogicAPI.Networking.Packets.Initialization;
|
|
|
|
using LogicAPI.Server;
|
|
|
|
using LogicAPI.Server;
|
|
|
|
using LogicAPI.Server.Components;
|
|
|
|
using LogicAPI.Server.Components;
|
|
|
@ -31,9 +29,6 @@ namespace DLatchPoke.Server {
|
|
|
|
Logger.Info("DLatchPoke server mod loading");
|
|
|
|
Logger.Info("DLatchPoke server mod loading");
|
|
|
|
|
|
|
|
|
|
|
|
_networkServer = ServiceGetter.getService<NetworkServer>();
|
|
|
|
_networkServer = ServiceGetter.getService<NetworkServer>();
|
|
|
|
if (_networkServer == null) {
|
|
|
|
|
|
|
|
throw new Exception("Could not get Service 'NetworkServer'.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Inject client verifier:
|
|
|
|
// Inject client verifier:
|
|
|
|
RawJoinVerifierInjector.addVerifier(this);
|
|
|
|
RawJoinVerifierInjector.addVerifier(this);
|
|
|
@ -53,7 +48,6 @@ namespace DLatchPoke.Server {
|
|
|
|
bool hasMod = ctx.ApprovalPacket.ClientMods.Contains(Manifest.ID);
|
|
|
|
bool hasMod = ctx.ApprovalPacket.ClientMods.Contains(Manifest.ID);
|
|
|
|
string playerName = ctx.PlayerID.Name;
|
|
|
|
string playerName = ctx.PlayerID.Name;
|
|
|
|
_playerHasMod[playerName] = hasMod;
|
|
|
|
_playerHasMod[playerName] = hasMod;
|
|
|
|
Logger.Info($"Verifying player {playerName}: hasMod={hasMod}");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -73,8 +67,7 @@ namespace DLatchPoke.Server {
|
|
|
|
/// Gets called from the DLatchPokeRequestHandler.
|
|
|
|
/// Gets called from the DLatchPokeRequestHandler.
|
|
|
|
/// Toggle the internal state of the DLatch
|
|
|
|
/// Toggle the internal state of the DLatch
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public void PokeDLatch(Connection sender, ComponentAddress componentAddress) {
|
|
|
|
public void PokeDLatch(ComponentAddress componentAddress) {
|
|
|
|
Logger.Info("Got Poke DLatch request");
|
|
|
|
|
|
|
|
LogicComponent component = _circuits.LookupComponent(componentAddress);
|
|
|
|
LogicComponent component = _circuits.LookupComponent(componentAddress);
|
|
|
|
if (component == null) {
|
|
|
|
if (component == null) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -82,7 +75,6 @@ namespace DLatchPoke.Server {
|
|
|
|
|
|
|
|
|
|
|
|
DLatch dLatch = component as DLatch;
|
|
|
|
DLatch dLatch = component as DLatch;
|
|
|
|
if (dLatch == null) { // the component is not of type DLatch
|
|
|
|
if (dLatch == null) { // the component is not of type DLatch
|
|
|
|
Logger.Info("Poke target is not a DLatch");
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|