diff --git a/assignments/src/MV3500Cohort2021JulySeptember/projects/AllenReynolds/KineticFirewallSimulationProgramAllenReynolds.java b/assignments/src/MV3500Cohort2021JulySeptember/projects/AllenReynolds/KineticFirewallSimulationProgramAllenReynolds.java index 1daf2242f1956189a40b2f330f863a90dd38bdd8..93f0aa75bca37de4197c80e439bad106fd3aa8fb 100644 --- a/assignments/src/MV3500Cohort2021JulySeptember/projects/AllenReynolds/KineticFirewallSimulationProgramAllenReynolds.java +++ b/assignments/src/MV3500Cohort2021JulySeptember/projects/AllenReynolds/KineticFirewallSimulationProgramAllenReynolds.java @@ -7,7 +7,7 @@ * and tracing its source before destroying it - updated September 12, 2021 to ensure * correct file pushed to Gitlab. * - * @author snapp + * @author snapp and runem aka jallen and kreynolds */ package MV3500Cohort2021JulySeptember.projects.AllenReynolds; @@ -215,18 +215,22 @@ public class KineticFirewallSimulationProgramAllenReynolds { entityStatePdu_3.getEntityLocation().setX(entityStatePdu_3.getEntityLocation().getX() - 1.0); // 1m per timestep // decide whether to fire, and then update the firePdu. Hmmm, you might want a target to shoot at! - Double range = entityStatePdu_2.getEntityLocation().getX(); - System.out.println("range: " + range + " hops from our Network DMZ!"); + Double range2 = entityStatePdu_2.getEntityLocation().getX(); + Double range3 = entityStatePdu_3.getEntityLocation().getX(); + System.out.println(entityStatePdu_2.getForceId() + " range: " + range2 + " hops from our Network DMZ!"); + System.out.println(entityStatePdu_3.getForceId() + " range: " + range3 + " hops from our Network DMZ!"); - if (range <= 5) { // Range 5 + if (range2 <= 5) { // Range 5 if (!fireBool) { sendSinglePdu(MalPacketDetectedComment); - sendSinglePdu(FriendPacketDetectedComment); + System.out.println("Firewall Detects Malware from " + + entityStatePdu_2.getEntityType().getCountry() + + "... Engage Traceroute"); } fireBool = true; System.out.println("Entity#" + firePdu.getFiringEntityID().getEntityID() - + " is firing " + + " is firing traceroute type " + firePdu.getDescriptor().getMunitionType().getDomain() + "." + firePdu.getDescriptor().getMunitionType().getCountry() @@ -237,7 +241,8 @@ public class KineticFirewallSimulationProgramAllenReynolds { + "." + firePdu.getDescriptor().getMunitionType().getSpecific() + "." - + " at Entity#" + firePdu.getTargetEntityID().getEntityID()); + + " at Entity#" + firePdu.getTargetEntityID().getEntityID() + + " from " + entityStatePdu_2.getEntityType().getCountry()); if (firePdu.getTargetEntityID().getEntityID() == 6666) { MalPacketPingsReceived += 1; @@ -256,6 +261,13 @@ public class KineticFirewallSimulationProgramAllenReynolds { } } } + + if (range3 <= 5) { // Range 5 + sendSinglePdu(FriendPacketDetectedComment); + System.out.println("Firewall Detects Friendly Packet from " + + entityStatePdu_3.getEntityType().getCountry() + + "... Allowing safe passage through the Firewall"); + } // etc. etc. your code goes here for your simulation of interest // something happens between my simulation entities, la de da de da...