diff --git a/libsecondlife/ParcelManager.cs b/libsecondlife/ParcelManager.cs
index ba3889a4..4f3aae21 100644
--- a/libsecondlife/ParcelManager.cs
+++ b/libsecondlife/ParcelManager.cs
@@ -769,6 +769,24 @@ namespace libsecondlife
/// Simulator to request parcels from (must be connected)
public void RequestAllSimParcels(Simulator simulator)
{
+ RequestAllSimParcels(simulator, false);
+ }
+
+ ///
+ /// Request all simulator parcel properties (used for populating the Simulator.Parcels
+ /// dictionary)
+ ///
+ /// Simulator to request parcels from (must be connected)
+ /// If set to true, will force a full refresh
+ public void RequestAllSimParcels(Simulator simulator, bool refresh)
+ {
+
+ if (refresh)
+ {
+ lock (simulator.ParcelMap)
+ simulator.ParcelMap = new int[64,64];
+ }
+
Thread th = new Thread(delegate()
{
int y, x;
@@ -782,7 +800,7 @@ namespace libsecondlife
(y + 1) * 4.0f, (x + 1) * 4.0f,
y * 4.0f, x * 4.0f, 0, false);
// Pause for 50 ms after every request to avoid flooding the sim
- System.Threading.Thread.Sleep(50);
+ System.Threading.Thread.Sleep(200);
}
}
}
diff --git a/libsecondlife/examples/TestClient/Commands/Land/ParcelInfoCommand.cs b/libsecondlife/examples/TestClient/Commands/Land/ParcelInfoCommand.cs
index cc41a717..5f02722f 100644
--- a/libsecondlife/examples/TestClient/Commands/Land/ParcelInfoCommand.cs
+++ b/libsecondlife/examples/TestClient/Commands/Land/ParcelInfoCommand.cs
@@ -10,7 +10,6 @@ namespace libsecondlife.TestClient
public class ParcelInfoCommand : Command
{
private AutoResetEvent ParcelsDownloaded = new AutoResetEvent(false);
- private int ParcelCount = 0;
public ParcelInfoCommand(TestClient testClient)
{
@@ -30,25 +29,31 @@ namespace libsecondlife.TestClient
ParcelManager.SimParcelsDownloaded del = delegate(Simulator simulator, InternalDictionary simParcels, int[,] parcelMap)
{
- ParcelCount = simParcels.Count;
-
- simParcels.ForEach(delegate(Parcel parcel)
- {
- sb.AppendFormat("Parcels[{0}]: Name: \"{1}\", Description: \"{2}\" ACL Count: {3}" + System.Environment.NewLine,
- parcel.LocalID, parcel.Name, parcel.Desc, parcel.AccessList.Count);
- });
ParcelsDownloaded.Set();
-
};
ParcelsDownloaded.Reset();
Client.Parcels.OnSimParcelsDownloaded += del;
Client.Parcels.RequestAllSimParcels(Client.Network.CurrentSim);
+ if (Client.Network.CurrentSim.IsParcelMapFull())
+ ParcelsDownloaded.Set();
+
if (ParcelsDownloaded.WaitOne(20000, false) && Client.Network.Connected)
+ {
+ sb.AppendFormat("Downloaded {0} Parcels in {1}",
+ Client.Network.CurrentSim.Parcels.Count, Client.Network.CurrentSim.Name);
+
+ Client.Network.CurrentSim.Parcels.ForEach(delegate(Parcel parcel)
+ {
+ sb.AppendFormat("Parcels[{0}]: Name: \"{1}\", Description: \"{2}\" ACL Count: {3}" + System.Environment.NewLine,
+ parcel.LocalID, parcel.Name, parcel.Desc, parcel.AccessList.Count);
+ });
+
result = sb.ToString();
+ }
else
- result = "Failed to retrieve information on all the simulator parcels";
+ result = "Failed to retrieve information on all the simulator parcels";
Client.Parcels.OnSimParcelsDownloaded -= del;
return result;