add osGetPrimCount([key primKey]) and osGetSittingAvatarsCount([key primkey]) that just do want name says unlike ll mess, absent primKey argument means current linkset

This commit is contained in:
UbitUmarov
2023-06-14 22:45:37 +01:00
parent 97b9f64e6d
commit 2849e57920
3 changed files with 63 additions and 0 deletions

View File

@@ -6153,5 +6153,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return result;
}
public LSL_Integer osGetPrimCount()
{
return m_host.ParentGroup.PrimCount;
}
public LSL_Integer osGetPrimCount(LSL_Key object_id)
{
if (!UUID.TryParse(object_id, out UUID id) || id.IsZero())
return 0;
SceneObjectPart part = World.GetSceneObjectPart(id);
if (part is null)
return 0;
return part.ParentGroup.PrimCount;
}
public LSL_Integer osGetSittingAvatarsCount()
{
return m_host.ParentGroup.GetSittingAvatarsCount();
}
public LSL_Integer osGetSittingAvatarsCount(LSL_Key object_id)
{
if (!UUID.TryParse(object_id, out UUID id) || id.IsZero())
return 0;
SceneObjectPart part = World.GetSceneObjectPart(id);
if (part is null)
return 0;
return part.ParentGroup.GetSittingAvatarsCount();
}
}
}

View File

@@ -605,5 +605,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_List osGetParcelIDs();
LSL_Key osGetParcelID();
LSL_List osOldList2ListStrided(LSL_List src, int start, int end, int stride);
LSL_Integer osGetPrimCount();
LSL_Integer osGetPrimCount(LSL_Key object_id);
LSL_Integer osGetSittingAvatarsCount();
LSL_Integer osGetSittingAvatarsCount(LSL_Key object_id);
}
}

View File

@@ -1676,5 +1676,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_OSSL_Functions.osOldList2ListStrided(src, start, end, stride);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Integer osGetPrimCount()
{
return m_OSSL_Functions.osGetPrimCount();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Integer osGetPrimCount(LSL_Key object_id)
{
return m_OSSL_Functions.osGetPrimCount(object_id);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
LSL_Integer osGetSittingAvatarsCount()
{
return m_OSSL_Functions.osGetSittingAvatarsCount();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
LSL_Integer osGetSittingAvatarsCount(LSL_Key object_id)
{
return m_OSSL_Functions.osGetSittingAvatarsCount(object_id);
}
}
}