From dbdeb40d46dc500179edc773a2caa14b1579bcc6 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 28 Apr 2008 22:21:42 +0000
Subject: * Lash up mantis 1064 - nre thrown in
LandObject.sendLandObjectOwners() * From reading the code, the cause must be
that a 'show objects on my parcel' is performed when there are objects
belonging to more than 32 people * I'm not sure why there is a hardcoded 32
limit but I'm leaving it in place for now. I don't regard this mantis as
resolved.
---
.../Modules/LandManagement/LandObject.cs | 49 ++++++++++++++++------
1 file changed, 36 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Region/Environment/Modules/LandManagement')
diff --git a/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs b/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs
index 6e87a1c..da42c21 100644
--- a/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs
@@ -772,19 +772,28 @@ namespace OpenSim.Region.Environment.Modules.LandManagement
}
}
+ ///
+ /// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes
+ /// aggreagete details such as the number of prims.
+ ///
+ ///
+ ///
+ /// A
+ ///
public void sendLandObjectOwners(IClientAPI remote_client)
{
- Dictionary ownersAndCount = new Dictionary();
- ParcelObjectOwnersReplyPacket pack = (ParcelObjectOwnersReplyPacket) PacketPool.Instance.GetPacket(PacketType.ParcelObjectOwnersReply);
+ Dictionary primCount = new Dictionary();
+ ParcelObjectOwnersReplyPacket pack
+ = (ParcelObjectOwnersReplyPacket) PacketPool.Instance.GetPacket(PacketType.ParcelObjectOwnersReply);
// TODO: don't create new blocks if recycling an old packet
foreach (SceneObjectGroup obj in primsOverMe)
{
try
{
- if (!ownersAndCount.ContainsKey(obj.OwnerID))
+ if (!primCount.ContainsKey(obj.OwnerID))
{
- ownersAndCount.Add(obj.OwnerID, 0);
+ primCount.Add(obj.OwnerID, 0);
}
}
catch (NullReferenceException)
@@ -793,36 +802,50 @@ namespace OpenSim.Region.Environment.Modules.LandManagement
}
try
{
- ownersAndCount[obj.OwnerID] += obj.PrimCount;
+ primCount[obj.OwnerID] += obj.PrimCount;
}
catch (KeyNotFoundException)
{
m_log.Error("[LAND]: Unable to match a prim with it's owner.");
}
}
- if (ownersAndCount.Count > 0)
+
+ int notifyCount = primCount.Count;
+
+ if (notifyCount > 0)
{
- ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[32];
-
- if (ownersAndCount.Count < 32)
+ if (notifyCount > 32)
{
- dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[ownersAndCount.Count];
+ m_log.InfoFormat(
+ "[LAND]: More than {0} avatars own prims on this parcel. Only sending back details of first {0}"
+ + " - a developer might want to investigate whether this is a hard limit", 32);
+
+ notifyCount = 32;
}
-
+
+ ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock
+ = new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount];
int num = 0;
- foreach (LLUUID owner in ownersAndCount.Keys)
+ foreach (LLUUID owner in primCount.Keys)
{
dataBlock[num] = new ParcelObjectOwnersReplyPacket.DataBlock();
- dataBlock[num].Count = ownersAndCount[owner];
+ dataBlock[num].Count = primCount[owner];
dataBlock[num].IsGroupOwned = false; //TODO: fix me when group support is added
dataBlock[num].OnlineStatus = true; //TODO: fix me later
dataBlock[num].OwnerID = owner;
num++;
+
+ if (num >= notifyCount)
+ {
+ break;
+ }
}
+
pack.Data = dataBlock;
}
+
remote_client.OutPacket(pack, ThrottleOutPacketType.Task);
}
--
cgit v1.1