mirror of
https://github.com/opensim/opensim.git
synced 2026-07-20 06:35:39 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
This commit is contained in:
@@ -7550,10 +7550,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
shapeBlock.PathScaleX = 100;
|
||||
shapeBlock.PathScaleY = 150;
|
||||
|
||||
if ((type & (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER) == 0 &&
|
||||
(type & (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE) == 0 &&
|
||||
(type & (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE) == 0 &&
|
||||
(type & (int)ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS) == 0)
|
||||
int flag = type & (ScriptBaseClass.PRIM_SCULPT_FLAG_INVERT | ScriptBaseClass.PRIM_SCULPT_FLAG_MIRROR);
|
||||
|
||||
if (type != (ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER | flag) &&
|
||||
type != (ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE | flag) &&
|
||||
type != (ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE | flag) &&
|
||||
type != (ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS | flag))
|
||||
{
|
||||
// default
|
||||
type = type | (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE;
|
||||
@@ -8841,23 +8843,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
ScriptSleep(1000);
|
||||
return GetPrimMediaParams(m_host, face, rules);
|
||||
}
|
||||
|
||||
public LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
ScriptSleep(1000);
|
||||
if (link == ScriptBaseClass.LINK_ROOT)
|
||||
return GetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules);
|
||||
else if (link == ScriptBaseClass.LINK_THIS)
|
||||
return GetPrimMediaParams(m_host, face, rules);
|
||||
else
|
||||
{
|
||||
SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
|
||||
if (null != part)
|
||||
return GetPrimMediaParams(part, face, rules);
|
||||
}
|
||||
|
||||
return new LSL_List();
|
||||
}
|
||||
|
||||
private LSL_List GetPrimMediaParams(SceneObjectPart part, int face, LSL_List rules)
|
||||
{
|
||||
// LSL Spec http://wiki.secondlife.com/wiki/LlGetPrimMediaParams says to fail silently if face is invalid
|
||||
// TODO: Need to correctly handle case where a face has no media (which gives back an empty list).
|
||||
// Assuming silently fail means give back an empty list. Ideally, need to check this.
|
||||
if (face < 0 || face > m_host.GetNumberOfSides() - 1)
|
||||
if (face < 0 || face > part.GetNumberOfSides() - 1)
|
||||
return new LSL_List();
|
||||
|
||||
return GetPrimMediaParams(face, rules);
|
||||
}
|
||||
|
||||
private LSL_List GetPrimMediaParams(int face, LSL_List rules)
|
||||
{
|
||||
IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
|
||||
if (null == module)
|
||||
throw new Exception("Media on a prim functions not available");
|
||||
return new LSL_List();
|
||||
|
||||
MediaEntry me = module.GetMediaEntry(m_host, face);
|
||||
MediaEntry me = module.GetMediaEntry(part, face);
|
||||
|
||||
// As per http://wiki.secondlife.com/wiki/LlGetPrimMediaParams
|
||||
if (null == me)
|
||||
@@ -8939,33 +8958,52 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
|
||||
res.Add(new LSL_Integer((int)me.ControlPermissions));
|
||||
break;
|
||||
|
||||
default: return ScriptBaseClass.LSL_STATUS_MALFORMED_PARAMS;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules)
|
||||
public LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
ScriptSleep(1000);
|
||||
return SetPrimMediaParams(m_host, face, rules);
|
||||
}
|
||||
|
||||
public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
ScriptSleep(1000);
|
||||
if (link == ScriptBaseClass.LINK_ROOT)
|
||||
return SetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules);
|
||||
else if (link == ScriptBaseClass.LINK_THIS)
|
||||
return SetPrimMediaParams(m_host, face, rules);
|
||||
else
|
||||
{
|
||||
SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
|
||||
if (null != part)
|
||||
return SetPrimMediaParams(part, face, rules);
|
||||
}
|
||||
|
||||
return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
|
||||
}
|
||||
|
||||
private LSL_Integer SetPrimMediaParams(SceneObjectPart part, LSL_Integer face, LSL_List rules)
|
||||
{
|
||||
// LSL Spec http://wiki.secondlife.com/wiki/LlSetPrimMediaParams says to fail silently if face is invalid
|
||||
// Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this.
|
||||
// Don't perform the media check directly
|
||||
if (face < 0 || face > m_host.GetNumberOfSides() - 1)
|
||||
return ScriptBaseClass.LSL_STATUS_OK;
|
||||
if (face < 0 || face > part.GetNumberOfSides() - 1)
|
||||
return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
|
||||
|
||||
return SetPrimMediaParams(face, rules);
|
||||
}
|
||||
|
||||
private LSL_Integer SetPrimMediaParams(int face, LSL_List rules)
|
||||
{
|
||||
IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
|
||||
if (null == module)
|
||||
throw new Exception("Media on a prim functions not available");
|
||||
return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED;
|
||||
|
||||
MediaEntry me = module.GetMediaEntry(m_host, face);
|
||||
MediaEntry me = module.GetMediaEntry(part, face);
|
||||
if (null == me)
|
||||
me = new MediaEntry();
|
||||
|
||||
@@ -9044,10 +9082,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
|
||||
me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
|
||||
break;
|
||||
|
||||
default: return ScriptBaseClass.LSL_STATUS_MALFORMED_PARAMS;
|
||||
}
|
||||
}
|
||||
|
||||
module.SetMediaEntry(m_host, face, me);
|
||||
module.SetMediaEntry(part, face, me);
|
||||
|
||||
return ScriptBaseClass.LSL_STATUS_OK;
|
||||
}
|
||||
@@ -9056,18 +9096,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
ScriptSleep(1000);
|
||||
return ClearPrimMedia(m_host, face);
|
||||
}
|
||||
|
||||
public LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
ScriptSleep(1000);
|
||||
if (link == ScriptBaseClass.LINK_ROOT)
|
||||
return ClearPrimMedia(m_host.ParentGroup.RootPart, face);
|
||||
else if (link == ScriptBaseClass.LINK_THIS)
|
||||
return ClearPrimMedia(m_host, face);
|
||||
else
|
||||
{
|
||||
SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
|
||||
if (null != part)
|
||||
return ClearPrimMedia(part, face);
|
||||
}
|
||||
|
||||
return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
|
||||
}
|
||||
|
||||
private LSL_Integer ClearPrimMedia(SceneObjectPart part, LSL_Integer face)
|
||||
{
|
||||
// LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid
|
||||
// Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this.
|
||||
// FIXME: Don't perform the media check directly
|
||||
if (face < 0 || face > m_host.GetNumberOfSides() - 1)
|
||||
return ScriptBaseClass.LSL_STATUS_OK;
|
||||
if (face < 0 || face > part.GetNumberOfSides() - 1)
|
||||
return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
|
||||
|
||||
IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
|
||||
if (null == module)
|
||||
throw new Exception("Media on a prim functions not available");
|
||||
return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED;
|
||||
|
||||
module.ClearMediaEntry(m_host, face);
|
||||
module.ClearMediaEntry(part, face);
|
||||
|
||||
return ScriptBaseClass.LSL_STATUS_OK;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options);
|
||||
LSL_Integer llCeil(double f);
|
||||
void llClearCameraParams();
|
||||
LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face);
|
||||
LSL_Integer llClearPrimMedia(LSL_Integer face);
|
||||
void llCloseRemoteDataChannel(string channel);
|
||||
LSL_Float llCloud(LSL_Vector offset);
|
||||
@@ -140,7 +141,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_String llGetLinkName(int linknum);
|
||||
LSL_Integer llGetLinkNumber();
|
||||
LSL_Integer llGetLinkNumberOfSides(int link);
|
||||
LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules);
|
||||
LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules);
|
||||
LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules);
|
||||
LSL_Integer llGetListEntryType(LSL_List src, int index);
|
||||
LSL_Integer llGetListLength(LSL_List src);
|
||||
LSL_Vector llGetLocalPos();
|
||||
@@ -337,6 +339,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
void llSetInventoryPermMask(string item, int mask, int value);
|
||||
void llSetLinkAlpha(int linknumber, double alpha, int face);
|
||||
void llSetLinkColor(int linknumber, LSL_Vector color, int face);
|
||||
LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules);
|
||||
void llSetLinkPrimitiveParams(int linknumber, LSL_List rules);
|
||||
void llSetLinkTexture(int linknumber, string texture, int face);
|
||||
void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate);
|
||||
@@ -348,7 +351,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
void llSetPayPrice(int price, LSL_List quick_pay_buttons);
|
||||
void llSetPos(LSL_Vector pos);
|
||||
LSL_Integer llSetRegionPos(LSL_Vector pos);
|
||||
LSL_Integer llSetPrimMediaParams(int face, LSL_List rules);
|
||||
LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules);
|
||||
void llSetPrimitiveParams(LSL_List rules);
|
||||
void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules);
|
||||
void llSetPrimURL(string url);
|
||||
|
||||
@@ -1909,17 +1909,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
return m_LSL_Functions.llGetPrimMediaParams(face, rules);
|
||||
}
|
||||
|
||||
|
||||
public LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
|
||||
{
|
||||
return m_LSL_Functions.llGetLinkMedia(link, face, rules);
|
||||
}
|
||||
|
||||
public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules)
|
||||
{
|
||||
return m_LSL_Functions.llSetPrimMediaParams(face, rules);
|
||||
}
|
||||
|
||||
|
||||
public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
|
||||
{
|
||||
return m_LSL_Functions.llSetLinkMedia(link, face, rules);
|
||||
}
|
||||
|
||||
public LSL_Integer llClearPrimMedia(LSL_Integer face)
|
||||
{
|
||||
return m_LSL_Functions.llClearPrimMedia(face);
|
||||
}
|
||||
|
||||
public LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face)
|
||||
{
|
||||
return m_LSL_Functions.llClearLinkMedia(link, face);
|
||||
}
|
||||
|
||||
public LSL_Integer llGetLinkNumberOfSides(LSL_Integer link)
|
||||
{
|
||||
return m_LSL_Functions.llGetLinkNumberOfSides(link);
|
||||
|
||||
Reference in New Issue
Block a user