* Removed the poorly done GetType function from _Packets_.cs
* Housecleaning in FriendsManager * Make sure LLSDString is never holding a null pointer * Changes to Login.cs to prepare for the LLSD switch (it is not happening yet!) * Fixed LLSD export for prims to export light/flex/sculpt data as well, importing that back in is still a TODO git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1540 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -1,18 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
|
||||
namespace libsecondlife.TestClient
|
||||
{
|
||||
public class PacketLogCommand : Command
|
||||
{
|
||||
List<Packet> Packets = new List<Packet>();
|
||||
bool Done = false;
|
||||
int Count = 0;
|
||||
int Total = 0;
|
||||
|
||||
public PacketLogCommand(TestClient testClient)
|
||||
{
|
||||
Name = "packetlog";
|
||||
@@ -24,61 +16,7 @@ namespace libsecondlife.TestClient
|
||||
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
|
||||
{
|
||||
return "This command is currently under construction";
|
||||
}
|
||||
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++;
|
||||
}
|
||||
}
|
||||
return "This function is currently unimplemented";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user