mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
This commit is contained in:
@@ -3298,7 +3298,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
/// <summary>
|
||||
/// Attach the object containing this script to the avatar that owns it.
|
||||
/// </summary>
|
||||
/// <param name='attachment'>The attachment point (e.g. ATTACH_CHEST)</param>
|
||||
/// <param name='attachmentPoint'>
|
||||
/// The attachment point (e.g. <see cref="OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass.ATTACH_CHEST">ATTACH_CHEST</see>)
|
||||
/// </param>
|
||||
/// <returns>true if the attach suceeded, false if it did not</returns>
|
||||
public bool AttachToAvatar(int attachmentPoint)
|
||||
{
|
||||
@@ -3729,21 +3731,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
else
|
||||
{
|
||||
bool sitting = false;
|
||||
if (m_host.SitTargetAvatar == agentID)
|
||||
{
|
||||
sitting = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (SceneObjectPart p in m_host.ParentGroup.Parts)
|
||||
{
|
||||
if (p.SitTargetAvatar == agentID)
|
||||
sitting = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (sitting)
|
||||
if (m_host.ParentGroup.GetSittingAvatars().Contains(agentID))
|
||||
{
|
||||
// When agent is sitting, certain permissions are implicit if requested from sitting agent
|
||||
implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION |
|
||||
@@ -3785,7 +3773,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
|
||||
if (npcModule != null && npcModule.IsNPC(agentID, World))
|
||||
{
|
||||
if (agentID == m_host.ParentGroup.OwnerID || npcModule.GetOwner(agentID) == m_host.ParentGroup.OwnerID)
|
||||
if (npcModule.CheckPermissions(agentID, m_host.OwnerID))
|
||||
{
|
||||
lock (m_host.TaskInventory)
|
||||
{
|
||||
@@ -4160,62 +4148,56 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public LSL_String llGetLinkName(int linknum)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
// simplest case, this prims link number
|
||||
if (linknum == m_host.LinkNum || linknum == ScriptBaseClass.LINK_THIS)
|
||||
return m_host.Name;
|
||||
|
||||
// parse for sitting avatare-names
|
||||
List<String> nametable = new List<String>();
|
||||
World.ForEachRootScenePresence(delegate(ScenePresence presence)
|
||||
if (linknum < 0)
|
||||
{
|
||||
SceneObjectPart sitPart = presence.ParentPart;
|
||||
if (sitPart != null && m_host.ParentGroup.ContainsPart(sitPart.LocalId))
|
||||
nametable.Add(presence.ControllingClient.Name);
|
||||
});
|
||||
|
||||
int totalprims = m_host.ParentGroup.PrimCount + nametable.Count;
|
||||
if (totalprims > m_host.ParentGroup.PrimCount)
|
||||
{
|
||||
// sitting Avatar-Name with negativ linknum / SinglePrim
|
||||
if (linknum < 0 && m_host.ParentGroup.PrimCount == 1 && nametable.Count == 1)
|
||||
return nametable[0];
|
||||
// Prim-Name / SinglePrim Sitting Avatar
|
||||
if (linknum == 1 && m_host.ParentGroup.PrimCount == 1 && nametable.Count == 1)
|
||||
return m_host.Name;
|
||||
// LinkNumber > of Real PrimSet = AvatarName
|
||||
if (linknum > m_host.ParentGroup.PrimCount && linknum <= totalprims)
|
||||
return nametable[totalprims - linknum];
|
||||
}
|
||||
|
||||
// Single prim
|
||||
if (m_host.LinkNum == 0)
|
||||
{
|
||||
if (linknum == 0 || linknum == ScriptBaseClass.LINK_ROOT)
|
||||
if (linknum == ScriptBaseClass.LINK_THIS)
|
||||
return m_host.Name;
|
||||
else
|
||||
return UUID.Zero.ToString();
|
||||
return ScriptBaseClass.NULL_KEY;
|
||||
}
|
||||
|
||||
// Link set
|
||||
SceneObjectPart part = null;
|
||||
if (m_host.LinkNum == 1) // this is the Root prim
|
||||
int actualPrimCount = m_host.ParentGroup.PrimCount;
|
||||
List<UUID> sittingAvatarIds = m_host.ParentGroup.GetSittingAvatars();
|
||||
int adjustedPrimCount = actualPrimCount + sittingAvatarIds.Count;
|
||||
|
||||
// Special case for a single prim. In this case the linknum is zero. However, this will not match a single
|
||||
// prim that has any avatars sat upon it (in which case the root prim is link 1).
|
||||
if (linknum == 0)
|
||||
{
|
||||
if (linknum < 0)
|
||||
part = m_host.ParentGroup.GetLinkNumPart(2);
|
||||
else
|
||||
part = m_host.ParentGroup.GetLinkNumPart(linknum);
|
||||
if (actualPrimCount == 1 && sittingAvatarIds.Count == 0)
|
||||
return m_host.Name;
|
||||
|
||||
return ScriptBaseClass.NULL_KEY;
|
||||
}
|
||||
else // this is a child prim
|
||||
// Special case to handle a single prim with sitting avatars. GetLinkPart() would only match zero but
|
||||
// here we must match 1 (ScriptBaseClass.LINK_ROOT).
|
||||
else if (linknum == 1 && actualPrimCount == 1)
|
||||
{
|
||||
if (linknum < 2)
|
||||
part = m_host.ParentGroup.GetLinkNumPart(1);
|
||||
if (sittingAvatarIds.Count > 0)
|
||||
return m_host.ParentGroup.RootPart.Name;
|
||||
else
|
||||
part = m_host.ParentGroup.GetLinkNumPart(linknum);
|
||||
return ScriptBaseClass.NULL_KEY;
|
||||
}
|
||||
else if (linknum <= adjustedPrimCount)
|
||||
{
|
||||
if (linknum <= actualPrimCount)
|
||||
{
|
||||
return m_host.ParentGroup.GetLinkNumPart(linknum).Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
ScenePresence sp = World.GetScenePresence(sittingAvatarIds[linknum - actualPrimCount - 1]);
|
||||
if (sp != null)
|
||||
return sp.Name;
|
||||
else
|
||||
return ScriptBaseClass.NULL_KEY;
|
||||
}
|
||||
}
|
||||
if (part != null)
|
||||
return part.Name;
|
||||
else
|
||||
return UUID.Zero.ToString();
|
||||
{
|
||||
return ScriptBaseClass.NULL_KEY;
|
||||
}
|
||||
}
|
||||
|
||||
public LSL_Integer llGetInventoryNumber(int type)
|
||||
@@ -5828,9 +5810,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Insert the list identified by <src> into the
|
||||
/// list designated by <dest> such that the first
|
||||
/// new element has the index specified by <index>
|
||||
/// Insert the list identified by <paramref name="src"/> into the
|
||||
/// list designated by <paramref name="dest"/> such that the first
|
||||
/// new element has the index specified by <paramref name="index"/>
|
||||
/// </summary>
|
||||
|
||||
public LSL_List llListInsertList(LSL_List dest, LSL_List src, int index)
|
||||
@@ -6663,6 +6645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
ps.BurstSpeedMax = 1.0f;
|
||||
ps.BurstRate = 0.1f;
|
||||
ps.PartMaxAge = 10.0f;
|
||||
ps.BurstPartCount = 1;
|
||||
return ps;
|
||||
}
|
||||
|
||||
@@ -6684,10 +6667,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
SetParticleSystem(m_host, rules);
|
||||
}
|
||||
|
||||
private void SetParticleSystem(SceneObjectPart part, LSL_List rules)
|
||||
private void SetParticleSystem(SceneObjectPart part, LSL_List rules)
|
||||
{
|
||||
|
||||
|
||||
if (rules.Length == 0)
|
||||
{
|
||||
part.RemoveParticleSystem();
|
||||
@@ -13232,7 +13213,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
/// Get a notecard line.
|
||||
/// </summary>
|
||||
/// <param name="assetID"></param>
|
||||
/// <param name="line">Lines start at index 0</param>
|
||||
/// <param name="lineNumber">Lines start at index 0</param>
|
||||
/// <returns></returns>
|
||||
public static string GetLine(UUID assetID, int lineNumber)
|
||||
{
|
||||
@@ -13261,9 +13242,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
/// Get a notecard line.
|
||||
/// </summary>
|
||||
/// <param name="assetID"></param>
|
||||
/// <param name="line">Lines start at index 0</param>
|
||||
/// <param name="maxLength">Maximum length of the returned line. Longer lines will be truncated</para>
|
||||
/// <returns></returns>
|
||||
/// <param name="lineNumber">Lines start at index 0</param>
|
||||
/// <param name="maxLength">
|
||||
/// Maximum length of the returned line.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// If the line length is longer than <paramref name="maxLength"/>,
|
||||
/// the return string will be truncated.
|
||||
/// </returns>
|
||||
public static string GetLine(UUID assetID, int lineNumber, int maxLength)
|
||||
{
|
||||
string line = GetLine(assetID, lineNumber);
|
||||
|
||||
@@ -1214,12 +1214,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
sunHour += 24.0;
|
||||
|
||||
World.RegionInfo.RegionSettings.UseEstateSun = useEstateSun;
|
||||
World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30
|
||||
World.RegionInfo.RegionSettings.FixedSun = sunFixed;
|
||||
World.RegionInfo.RegionSettings.SunPosition = sunHour + 6; // LL Region Sun Hour is 6 to 30
|
||||
World.RegionInfo.RegionSettings.FixedSun = sunFixed;
|
||||
World.RegionInfo.RegionSettings.Save();
|
||||
|
||||
World.EventManager.TriggerEstateToolsSunUpdate(
|
||||
World.RegionInfo.RegionHandle, sunFixed, useEstateSun, (float)sunHour);
|
||||
World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1244,8 +1243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
World.RegionInfo.EstateSettings.FixedSun = sunFixed;
|
||||
World.RegionInfo.EstateSettings.Save();
|
||||
|
||||
World.EventManager.TriggerEstateToolsSunUpdate(
|
||||
World.RegionInfo.RegionHandle, sunFixed, World.RegionInfo.RegionSettings.UseEstateSun, (float)sunHour);
|
||||
World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user