mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user