From 570d4b3c91f1db4d60137c4eb7a06286846a1873 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Tue, 1 Sep 2015 16:27:17 -0500 Subject: [PATCH] wrepeater changes --- EduNetworkBuilder/Network.cs | 11 ++++++++--- EduNetworkBuilder/NetworkDevice.cs | 4 ++-- EduNetworkBuilder/Packet.cs | 19 +++++++++++-------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/EduNetworkBuilder/Network.cs b/EduNetworkBuilder/Network.cs index e3149e3..9c190e3 100644 --- a/EduNetworkBuilder/Network.cs +++ b/EduNetworkBuilder/Network.cs @@ -177,9 +177,9 @@ namespace EduNetworkBuilder break; } } - DoAllVerifyLinks(); - DoAllAutoJoin(); } + DoAllVerifyLinks(); + DoAllAutoJoin(); if (NetMessage.GetText() != "" && !AlreadyDisplayedMessage) { //We have a message loaded on this network. Display it @@ -429,7 +429,12 @@ namespace EduNetworkBuilder public void RemoveComponent(NetworkComponent tItem) { - NetComponents.Remove(tItem); + for (int i = NetComponents.Count -1; i >= 0; i--) + { + if (NetComponents[i] == tItem) + NetComponents.RemoveAt(i); +// NetComponents.Remove(tItem); + } tItem.Destroy(); _isDirty = true; } diff --git a/EduNetworkBuilder/NetworkDevice.cs b/EduNetworkBuilder/NetworkDevice.cs index 5f37118..3051094 100644 --- a/EduNetworkBuilder/NetworkDevice.cs +++ b/EduNetworkBuilder/NetworkDevice.cs @@ -95,8 +95,8 @@ namespace EduNetworkBuilder NICs.Clear(); tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.lo); NICs.Add(tnic); - tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.management_interface); - NICs.Add(tnic); + //tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.management_interface); + //NICs.Add(tnic); --we use the wlan interface tnic = new NetworkCard(NICs.Count(), GetUniqueIdentifier, hostname, NicType.wlan); //Add a wireless nic NICs.Add(tnic); tnic = new NetworkCard(NICs.Count(), GetUniqueIdentifier, hostname, NicType.wport); //Add a wireless port diff --git a/EduNetworkBuilder/Packet.cs b/EduNetworkBuilder/Packet.cs index c6fcab4..fc9c882 100644 --- a/EduNetworkBuilder/Packet.cs +++ b/EduNetworkBuilder/Packet.cs @@ -367,16 +367,19 @@ namespace EduNetworkBuilder Tracking.Status = "Packet failed to reach IP: " + destIP.GetIPString; MyStatus = PacketStatus.finished_failed; } - if(MyType == PacketType.ping_answer && MyStatus == PacketStatus.finished_failed) - { - myNet.NoteActionDone(NetTestType.FailedPing, destIP.GetIPString, sourceIP.GetIPString); - } - if (MyType == PacketType.ping_request && MyStatus == PacketStatus.finished_failed) - { - myNet.NoteActionDone(NetTestType.FailedPing, sourceIP.GetIPString, destIP.GetIPString); - } if (MyStatus != PacketStatus.finished) myNet.AddMessage(Tracking); //We only store finished_failed, and finished_ok + if (sourceIP != null && destIP != null) + { + if (MyType == PacketType.ping_answer && MyStatus == PacketStatus.finished_failed) + { + myNet.NoteActionDone(NetTestType.FailedPing, destIP.GetIPString, sourceIP.GetIPString); + } + if (MyType == PacketType.ping_request && MyStatus == PacketStatus.finished_failed) + { + myNet.NoteActionDone(NetTestType.FailedPing, sourceIP.GetIPString, destIP.GetIPString); + } + } } }