From 68d016517d929a7db156f845fd570cf89f76764f Mon Sep 17 00:00:00 2001 From: alondria Date: Sun, 23 Mar 2008 18:15:08 +0000 Subject: Implements llGetParcelPrimOwners() --- .../Environment/Modules/LandManagement/LandObject.cs | 14 ++++++++++++++ OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 14 ++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs b/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs index 68e8fcf..46ddf38 100644 --- a/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/LandManagement/LandObject.cs @@ -809,6 +809,20 @@ namespace OpenSim.Region.Environment.Modules.LandManagement remote_client.OutPacket(pack, ThrottleOutPacketType.Task); } + public Dictionary getLandObjectOwners() + { + Dictionary ownersAndCount = new Dictionary(); + foreach (SceneObjectGroup obj in primsOverMe) + { + if (!ownersAndCount.ContainsKey(obj.OwnerID)) + { + ownersAndCount.Add(obj.OwnerID, 0); + } + ownersAndCount[obj.OwnerID] += obj.PrimCount; + } + return ownersAndCount; + } + #endregion #region Object Returning diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 9a1b652..029abf6 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -40,6 +40,7 @@ using OpenSim.Region.Environment.Scenes; using OpenSim.Region.ScriptEngine.Common; using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; using OpenSim.Region.Environment; +using OpenSim.Region.Environment.Modules.LandManagement; //using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; namespace OpenSim.Region.ScriptEngine.Common @@ -4517,8 +4518,17 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos) { m_host.AddScriptLPS(1); - NotImplemented("llGetParcelPrimOwners"); - return new LSL_Types.list(); + LandObject land = (LandObject)World.LandChannel.getLandObject((float)pos.x, (float)pos.y); + LSL_Types.list ret = new LSL_Types.list(); + if (land != null) + { + foreach (KeyValuePair d in land.getLandObjectOwners()) + { + ret.Add(d.Key.ToString()); + ret.Add(d.Value); + } + } + return ret; } public int llGetObjectPrimCount(string object_id) -- cgit v1.1