diff --git a/EduNetworkBuilder/ActionClass.cs b/EduNetworkBuilder/ActionClass.cs index 1cb1caf..0868196 100644 --- a/EduNetworkBuilder/ActionClass.cs +++ b/EduNetworkBuilder/ActionClass.cs @@ -204,7 +204,7 @@ namespace EduNetworkBuilder myNet.MarkAsLinked(sourceNL.Dst, sourceNL.GetUniqueIdentifier); myNet.AddItem(ChangedComponent); } - if(NB.DebugActions) { Console.WriteLine("Changing a component: " + source); } + if(NB.DebugActions) { Console.WriteLine("Changing a component: " + source.hostname); } break; case NBAction.changelocation: if (source != null) @@ -227,7 +227,7 @@ namespace EduNetworkBuilder myNet.RemoveLinksToNic(nicID); } myNet.RemoveComponent(source); - if (NB.DebugActions) { Console.WriteLine("Deleting a device: " + source); } + if (NB.DebugActions) { Console.WriteLine("Deleting a device: " + source.hostname); } } else if(sourceC != null && sourceC is NetworkLink) { if (myNet.ItemIsCritical(sourceC.hostname)) @@ -235,7 +235,7 @@ namespace EduNetworkBuilder NetworkLink SourceL = (NetworkLink)sourceC; SourceL.Destroy(); //Mark both ends as being deleted myNet.RemoveComponent(SourceL); //Get rid of this link - if (NB.DebugActions) { Console.WriteLine("Deleting a link: " + source); } + if (NB.DebugActions) { Console.WriteLine("Deleting a link: " + source.hostname); } } break; case NBAction.newdevice: @@ -255,47 +255,47 @@ namespace EduNetworkBuilder if (CanDo) { ChangedComponent = (NetworkDevice)myNet.AddItem(newItemType, Location); - if (NB.DebugActions) { Console.WriteLine("Adding a Device: " + source); } + if (NB.DebugActions) { Console.WriteLine("Adding a Device: " + source.hostname); } } else { NB.SetBuilderWindowStatis(NB.Translate("NB_TreePlacementError")); - if (NB.DebugActions) { Console.WriteLine("Unable to add device: " + source); } + if (NB.DebugActions) { Console.WriteLine("Unable to add device: " + source.hostname); } } break; case NBAction.dhcp: if (source != null) { source.DHCPRequestFromHere(); - if (NB.DebugActions) { Console.WriteLine("Requesting DHCP: " + source); } + if (NB.DebugActions) { Console.WriteLine("Requesting DHCP: " + source.hostname); } } break; case NBAction.arp: if (source != null) { source.AskArpFromHere(Destination); - if (NB.DebugActions) { Console.WriteLine("Requesting DHCP: " + source); } + if (NB.DebugActions) { Console.WriteLine("Requesting DHCP: " + source.hostname); } } break; case NBAction.cleararp: if (source != null) { source.ClearArps(); - if (NB.DebugActions) { Console.WriteLine("Clearing ARP: " + source); } + if (NB.DebugActions) { Console.WriteLine("Clearing ARP: " + source.hostname); } } break; case NBAction.ping: if (source != null) { source.PingFromHere(Destination); - if (NB.DebugActions) { Console.WriteLine("Pinging " + Destination + " from " + source); } + if (NB.DebugActions) { Console.WriteLine("Pinging " + Destination.GetIPString + " from " + source.hostname); } } break; case NBAction.traceroute: if (source != null) { source.TracerouteFromHere(Destination); - if (NB.DebugActions) { Console.WriteLine("Traceroute: " + Destination+ " from " + source); } + if (NB.DebugActions) { Console.WriteLine("Traceroute: " + Destination.GetIPString + " from " + source.hostname); } } break; case NBAction.replace: @@ -309,7 +309,7 @@ namespace EduNetworkBuilder myNet.RegisterDeviceReset(source.hostname); //replacing something powers it off myNet.RegisterDeviceReplaced(source.hostname); //replace it. - if (NB.DebugActions) { Console.WriteLine("Replacing device: " + source); } + if (NB.DebugActions) { Console.WriteLine("Replacing device: " + source.hostname); } } else if (sourceC is NetworkLink) { @@ -322,22 +322,22 @@ namespace EduNetworkBuilder myNet.RemoveComponent(sourceNL); NetworkLink nNL = new NetworkLink(sourceID, destID, LinkType.normal); myNet.AddItem(nNL); - if (NB.DebugActions) { Console.WriteLine("Replacing link: " + source); } + if (NB.DebugActions) { Console.WriteLine("Replacing link: " + source.hostname); } } } break; case NBAction.replaceUPS: myNet.RegisterUPSAdded(source.hostname); - if (NB.DebugActions) { Console.WriteLine("Replacing UPS on: " + source); } + if (NB.DebugActions) { Console.WriteLine("Replacing UPS on: " + source.hostname); } break; case NBAction.poweroff: source.PowerOff = true; myNet.RegisterDeviceReset(source.hostname); - if (NB.DebugActions) { Console.WriteLine("Powering off: " + source); } + if (NB.DebugActions) { Console.WriteLine("Powering off: " + source.hostname); } break; case NBAction.poweron: source.PowerOff = false; - if (NB.DebugActions) { Console.WriteLine("Powering on: " + source); } + if (NB.DebugActions) { Console.WriteLine("Powering on: " + source.hostname); } //We might see about exploding the device here. break; }