From 64a98c736848de6099254f23483058668273c1a5 Mon Sep 17 00:00:00 2001 From: gareth Date: Mon, 14 May 2007 03:13:47 +0000 Subject: Finished off adding the new management API to gridserver Updated VersionInfo.cs finally Updated prebuild and rebuilt nant build files Completed Management agent basics --- ExportBot/Commands/PacketLogCommand.cs | 84 ---------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 ExportBot/Commands/PacketLogCommand.cs (limited to 'ExportBot/Commands/PacketLogCommand.cs') diff --git a/ExportBot/Commands/PacketLogCommand.cs b/ExportBot/Commands/PacketLogCommand.cs deleted file mode 100644 index 827b147..0000000 --- a/ExportBot/Commands/PacketLogCommand.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Xml; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class PacketLogCommand : Command - { - List Packets = new List(); - bool Done = false; - int Count = 0; - int Total = 0; - - public PacketLogCommand(TestClient testClient) - { - Name = "packetlog"; - Description = "Logs a given number of packets to an xml file. Usage: packetlog 10 tenpackets.xml"; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - if (args.Length != 2) - return "Usage: packetlog 10 tenpackets.xml"; - - XmlWriter writer; - NetworkManager.PacketCallback callback = new NetworkManager.PacketCallback(OnPacket); - - Packets.Clear(); - Done = false; - Count = 0; - - try - { - Total = Int32.Parse(args[0]); - writer = XmlWriter.Create(args[1]); - - Client.Network.RegisterCallback(PacketType.Default, callback); - } - catch (Exception e) - { - return "Usage: packetlog 10 tenpackets.xml (" + e + ")"; - } - - while (!Done) - { - System.Threading.Thread.Sleep(100); - } - - Client.Network.UnregisterCallback(PacketType.Default, callback); - - try - { - Helpers.PacketListToXml(Packets, writer); - } - catch (Exception e) - { - return "Serialization failed: " + e.ToString(); - } - - writer.Close(); - Packets.Clear(); - - return "Exported " + Count + " packets to " + args[1]; - } - - private void OnPacket(Packet packet, Simulator simulator) - { - lock (Packets) - { - if (Count >= Total) - { - Done = true; - } - else - { - Packets.Add(packet); - Count++; - } - } - } - } -} -- cgit v1.1