mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
add list osGetParcelIDs() and key osGetParcelID(), plus a few changes to previus commits
This commit is contained in:
@@ -13972,6 +13972,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (parcel is null)
|
||||
return new LSL_List(0);
|
||||
|
||||
return GetParcelDetails(parcel, param);
|
||||
}
|
||||
|
||||
public LSL_List GetParcelDetails(ILandObject parcel, LSL_List param)
|
||||
{
|
||||
LandData land = parcel.LandData;
|
||||
if (land is null)
|
||||
return new LSL_List(0);
|
||||
@@ -14021,7 +14026,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
ret.Add(new LSL_Integer(land.Flags));
|
||||
break;
|
||||
case "13":
|
||||
ret.Add(new LSL_Integer(World.LSLScriptDanger(m_host, pos) ? 1 : 0));
|
||||
ret.Add(new LSL_Integer(World.LSLScriptDanger(m_host, parcel) ? 1 : 0));
|
||||
break;
|
||||
case "64":
|
||||
ret.Add(new LSL_Integer(land.Dwell));
|
||||
|
||||
@@ -5996,5 +5996,47 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
src.SortInPlace(stride, ascending == 1);
|
||||
}
|
||||
|
||||
public LSL_List osGetParcelDetails(LSL_Key id, LSL_List param)
|
||||
{
|
||||
if (!UUID.TryParse(id, out UUID parcelID))
|
||||
return new LSL_List(0);
|
||||
|
||||
InitLSL();
|
||||
if (m_LSL_Api is null)
|
||||
return new LSL_List(0);
|
||||
|
||||
ILandObject parcel = World.LandChannel.GetLandObject(parcelID);
|
||||
if (parcel is null)
|
||||
return new LSL_List(0);
|
||||
|
||||
return m_LSL_Api.GetParcelDetails(parcel, param);
|
||||
}
|
||||
|
||||
public LSL_List osGetParcelIDs()
|
||||
{
|
||||
//if(!World.Permissions.IsEstateManager(m_host.OwnerID))
|
||||
// return new LSL_List();
|
||||
|
||||
List<ILandObject> parcels = World.LandChannel.AllParcels();
|
||||
if (parcels is null || parcels.Count == 0)
|
||||
return new LSL_List();
|
||||
LSL_List ret = new();
|
||||
foreach (ILandObject obj in parcels)
|
||||
{
|
||||
// some sanity check
|
||||
if(obj.GlobalID.IsZero())
|
||||
continue;
|
||||
if(obj.LandData is null || obj.LandData.Area == 0)
|
||||
continue;
|
||||
ret.Add(new LSL_Key(obj.GlobalID.ToString()));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
public LSL_Key osGetParcelID()
|
||||
{
|
||||
ILandObject parcel = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
|
||||
return parcel is null ? ScriptBaseClass.NULL_KEY : new LSL_Key(parcel.GlobalID.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -598,5 +598,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_Integer osAvatarType(LSL_Key avkey);
|
||||
LSL_Integer osAvatarType(LSL_String sFirstName, LSL_String sLastName);
|
||||
void osListSortInPlace(LSL_List src, LSL_Integer stride, LSL_Integer ascending);
|
||||
|
||||
LSL_List osGetParcelDetails(LSL_Key id, LSL_List param);
|
||||
public LSL_List osGetParcelIDs();
|
||||
public LSL_Key osGetParcelID();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1635,5 +1635,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
m_OSSL_Functions.osListSortInPlace(src, stride, ascending);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public LSL_List osGetParcelDetails(LSL_Key id, LSL_List param)
|
||||
{
|
||||
return m_OSSL_Functions.osGetParcelDetails(id, param);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public LSL_List osGetParcelIDs()
|
||||
{
|
||||
return m_OSSL_Functions.osGetParcelIDs();
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public LSL_Key osGetParcelID()
|
||||
{
|
||||
return m_OSSL_Functions.osGetParcelID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user