Implements llGetParcelPrimOwners()

0.6.0-stable
alondria 2008-03-23 18:15:08 +00:00
parent f82227a186
commit 68d016517d
2 changed files with 26 additions and 2 deletions

View File

@ -809,6 +809,20 @@ namespace OpenSim.Region.Environment.Modules.LandManagement
remote_client.OutPacket(pack, ThrottleOutPacketType.Task); remote_client.OutPacket(pack, ThrottleOutPacketType.Task);
} }
public Dictionary<LLUUID, int> getLandObjectOwners()
{
Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>();
foreach (SceneObjectGroup obj in primsOverMe)
{
if (!ownersAndCount.ContainsKey(obj.OwnerID))
{
ownersAndCount.Add(obj.OwnerID, 0);
}
ownersAndCount[obj.OwnerID] += obj.PrimCount;
}
return ownersAndCount;
}
#endregion #endregion
#region Object Returning #region Object Returning

View File

@ -40,6 +40,7 @@ using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.ScriptEngine.Common; using OpenSim.Region.ScriptEngine.Common;
using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase;
using OpenSim.Region.Environment; using OpenSim.Region.Environment;
using OpenSim.Region.Environment.Modules.LandManagement;
//using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; //using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL;
namespace OpenSim.Region.ScriptEngine.Common namespace OpenSim.Region.ScriptEngine.Common
@ -4517,8 +4518,17 @@ namespace OpenSim.Region.ScriptEngine.Common
public LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos) public LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llGetParcelPrimOwners"); LandObject land = (LandObject)World.LandChannel.getLandObject((float)pos.x, (float)pos.y);
return new LSL_Types.list(); LSL_Types.list ret = new LSL_Types.list();
if (land != null)
{
foreach (KeyValuePair<LLUUID, int> d in land.getLandObjectOwners())
{
ret.Add(d.Key.ToString());
ret.Add(d.Value);
}
}
return ret;
} }
public int llGetObjectPrimCount(string object_id) public int llGetObjectPrimCount(string object_id)