diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
3 files changed, 111 insertions, 31 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ba02a78..a6a2aa7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7550,10 +7550,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7550 | shapeBlock.PathScaleX = 100; | 7550 | shapeBlock.PathScaleX = 100; |
7551 | shapeBlock.PathScaleY = 150; | 7551 | shapeBlock.PathScaleY = 150; |
7552 | 7552 | ||
7553 | if ((type & (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER) == 0 && | 7553 | int flag = type & (ScriptBaseClass.PRIM_SCULPT_FLAG_INVERT | ScriptBaseClass.PRIM_SCULPT_FLAG_MIRROR); |
7554 | (type & (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE) == 0 && | 7554 | |
7555 | (type & (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE) == 0 && | 7555 | if (type != (ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER | flag) && |
7556 | (type & (int)ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS) == 0) | 7556 | type != (ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE | flag) && |
7557 | type != (ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE | flag) && | ||
7558 | type != (ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS | flag)) | ||
7557 | { | 7559 | { |
7558 | // default | 7560 | // default |
7559 | type = type | (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; | 7561 | type = type | (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; |
@@ -8841,23 +8843,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8841 | { | 8843 | { |
8842 | m_host.AddScriptLPS(1); | 8844 | m_host.AddScriptLPS(1); |
8843 | ScriptSleep(1000); | 8845 | ScriptSleep(1000); |
8846 | return GetPrimMediaParams(m_host, face, rules); | ||
8847 | } | ||
8848 | |||
8849 | public LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules) | ||
8850 | { | ||
8851 | m_host.AddScriptLPS(1); | ||
8852 | ScriptSleep(1000); | ||
8853 | if (link == ScriptBaseClass.LINK_ROOT) | ||
8854 | return GetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules); | ||
8855 | else if (link == ScriptBaseClass.LINK_THIS) | ||
8856 | return GetPrimMediaParams(m_host, face, rules); | ||
8857 | else | ||
8858 | { | ||
8859 | SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link); | ||
8860 | if (null != part) | ||
8861 | return GetPrimMediaParams(part, face, rules); | ||
8862 | } | ||
8863 | |||
8864 | return new LSL_List(); | ||
8865 | } | ||
8844 | 8866 | ||
8867 | private LSL_List GetPrimMediaParams(SceneObjectPart part, int face, LSL_List rules) | ||
8868 | { | ||
8845 | // LSL Spec http://wiki.secondlife.com/wiki/LlGetPrimMediaParams says to fail silently if face is invalid | 8869 | // LSL Spec http://wiki.secondlife.com/wiki/LlGetPrimMediaParams says to fail silently if face is invalid |
8846 | // TODO: Need to correctly handle case where a face has no media (which gives back an empty list). | 8870 | // TODO: Need to correctly handle case where a face has no media (which gives back an empty list). |
8847 | // Assuming silently fail means give back an empty list. Ideally, need to check this. | 8871 | // Assuming silently fail means give back an empty list. Ideally, need to check this. |
8848 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) | 8872 | if (face < 0 || face > part.GetNumberOfSides() - 1) |
8849 | return new LSL_List(); | 8873 | return new LSL_List(); |
8850 | 8874 | ||
8851 | return GetPrimMediaParams(face, rules); | ||
8852 | } | ||
8853 | |||
8854 | private LSL_List GetPrimMediaParams(int face, LSL_List rules) | ||
8855 | { | ||
8856 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); | 8875 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); |
8857 | if (null == module) | 8876 | if (null == module) |
8858 | throw new Exception("Media on a prim functions not available"); | 8877 | return new LSL_List(); |
8859 | 8878 | ||
8860 | MediaEntry me = module.GetMediaEntry(m_host, face); | 8879 | MediaEntry me = module.GetMediaEntry(part, face); |
8861 | 8880 | ||
8862 | // As per http://wiki.secondlife.com/wiki/LlGetPrimMediaParams | 8881 | // As per http://wiki.secondlife.com/wiki/LlGetPrimMediaParams |
8863 | if (null == me) | 8882 | if (null == me) |
@@ -8939,33 +8958,52 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8939 | case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: | 8958 | case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: |
8940 | res.Add(new LSL_Integer((int)me.ControlPermissions)); | 8959 | res.Add(new LSL_Integer((int)me.ControlPermissions)); |
8941 | break; | 8960 | break; |
8961 | |||
8962 | default: return ScriptBaseClass.LSL_STATUS_MALFORMED_PARAMS; | ||
8942 | } | 8963 | } |
8943 | } | 8964 | } |
8944 | 8965 | ||
8945 | return res; | 8966 | return res; |
8946 | } | 8967 | } |
8947 | 8968 | ||
8948 | public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules) | 8969 | public LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules) |
8949 | { | 8970 | { |
8950 | m_host.AddScriptLPS(1); | 8971 | m_host.AddScriptLPS(1); |
8951 | ScriptSleep(1000); | 8972 | ScriptSleep(1000); |
8973 | return SetPrimMediaParams(m_host, face, rules); | ||
8974 | } | ||
8952 | 8975 | ||
8953 | // LSL Spec http://wiki.secondlife.com/wiki/LlSetPrimMediaParams says to fail silently if face is invalid | 8976 | public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules) |
8954 | // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. | 8977 | { |
8955 | // Don't perform the media check directly | 8978 | m_host.AddScriptLPS(1); |
8956 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) | 8979 | ScriptSleep(1000); |
8957 | return ScriptBaseClass.LSL_STATUS_OK; | 8980 | if (link == ScriptBaseClass.LINK_ROOT) |
8981 | return SetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules); | ||
8982 | else if (link == ScriptBaseClass.LINK_THIS) | ||
8983 | return SetPrimMediaParams(m_host, face, rules); | ||
8984 | else | ||
8985 | { | ||
8986 | SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link); | ||
8987 | if (null != part) | ||
8988 | return SetPrimMediaParams(part, face, rules); | ||
8989 | } | ||
8958 | 8990 | ||
8959 | return SetPrimMediaParams(face, rules); | 8991 | return ScriptBaseClass.LSL_STATUS_NOT_FOUND; |
8960 | } | 8992 | } |
8961 | 8993 | ||
8962 | private LSL_Integer SetPrimMediaParams(int face, LSL_List rules) | 8994 | private LSL_Integer SetPrimMediaParams(SceneObjectPart part, LSL_Integer face, LSL_List rules) |
8963 | { | 8995 | { |
8996 | // LSL Spec http://wiki.secondlife.com/wiki/LlSetPrimMediaParams says to fail silently if face is invalid | ||
8997 | // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. | ||
8998 | // Don't perform the media check directly | ||
8999 | if (face < 0 || face > part.GetNumberOfSides() - 1) | ||
9000 | return ScriptBaseClass.LSL_STATUS_NOT_FOUND; | ||
9001 | |||
8964 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); | 9002 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); |
8965 | if (null == module) | 9003 | if (null == module) |
8966 | throw new Exception("Media on a prim functions not available"); | 9004 | return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED; |
8967 | 9005 | ||
8968 | MediaEntry me = module.GetMediaEntry(m_host, face); | 9006 | MediaEntry me = module.GetMediaEntry(part, face); |
8969 | if (null == me) | 9007 | if (null == me) |
8970 | me = new MediaEntry(); | 9008 | me = new MediaEntry(); |
8971 | 9009 | ||
@@ -9044,10 +9082,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9044 | case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: | 9082 | case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: |
9045 | me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++); | 9083 | me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++); |
9046 | break; | 9084 | break; |
9085 | |||
9086 | default: return ScriptBaseClass.LSL_STATUS_MALFORMED_PARAMS; | ||
9047 | } | 9087 | } |
9048 | } | 9088 | } |
9049 | 9089 | ||
9050 | module.SetMediaEntry(m_host, face, me); | 9090 | module.SetMediaEntry(part, face, me); |
9051 | 9091 | ||
9052 | return ScriptBaseClass.LSL_STATUS_OK; | 9092 | return ScriptBaseClass.LSL_STATUS_OK; |
9053 | } | 9093 | } |
@@ -9056,18 +9096,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9056 | { | 9096 | { |
9057 | m_host.AddScriptLPS(1); | 9097 | m_host.AddScriptLPS(1); |
9058 | ScriptSleep(1000); | 9098 | ScriptSleep(1000); |
9099 | return ClearPrimMedia(m_host, face); | ||
9100 | } | ||
9101 | |||
9102 | public LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face) | ||
9103 | { | ||
9104 | m_host.AddScriptLPS(1); | ||
9105 | ScriptSleep(1000); | ||
9106 | if (link == ScriptBaseClass.LINK_ROOT) | ||
9107 | return ClearPrimMedia(m_host.ParentGroup.RootPart, face); | ||
9108 | else if (link == ScriptBaseClass.LINK_THIS) | ||
9109 | return ClearPrimMedia(m_host, face); | ||
9110 | else | ||
9111 | { | ||
9112 | SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link); | ||
9113 | if (null != part) | ||
9114 | return ClearPrimMedia(part, face); | ||
9115 | } | ||
9059 | 9116 | ||
9117 | return ScriptBaseClass.LSL_STATUS_NOT_FOUND; | ||
9118 | } | ||
9119 | |||
9120 | private LSL_Integer ClearPrimMedia(SceneObjectPart part, LSL_Integer face) | ||
9121 | { | ||
9060 | // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid | 9122 | // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid |
9061 | // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. | 9123 | // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. |
9062 | // FIXME: Don't perform the media check directly | 9124 | // FIXME: Don't perform the media check directly |
9063 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) | 9125 | if (face < 0 || face > part.GetNumberOfSides() - 1) |
9064 | return ScriptBaseClass.LSL_STATUS_OK; | 9126 | return ScriptBaseClass.LSL_STATUS_NOT_FOUND; |
9065 | 9127 | ||
9066 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); | 9128 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); |
9067 | if (null == module) | 9129 | if (null == module) |
9068 | throw new Exception("Media on a prim functions not available"); | 9130 | return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED; |
9069 | 9131 | ||
9070 | module.ClearMediaEntry(m_host, face); | 9132 | module.ClearMediaEntry(part, face); |
9071 | 9133 | ||
9072 | return ScriptBaseClass.LSL_STATUS_OK; | 9134 | return ScriptBaseClass.LSL_STATUS_OK; |
9073 | } | 9135 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index bf7e7b5..55444dc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -64,6 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
64 | LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options); | 64 | LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options); |
65 | LSL_Integer llCeil(double f); | 65 | LSL_Integer llCeil(double f); |
66 | void llClearCameraParams(); | 66 | void llClearCameraParams(); |
67 | LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face); | ||
67 | LSL_Integer llClearPrimMedia(LSL_Integer face); | 68 | LSL_Integer llClearPrimMedia(LSL_Integer face); |
68 | void llCloseRemoteDataChannel(string channel); | 69 | void llCloseRemoteDataChannel(string channel); |
69 | LSL_Float llCloud(LSL_Vector offset); | 70 | LSL_Float llCloud(LSL_Vector offset); |
@@ -140,7 +141,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
140 | LSL_String llGetLinkName(int linknum); | 141 | LSL_String llGetLinkName(int linknum); |
141 | LSL_Integer llGetLinkNumber(); | 142 | LSL_Integer llGetLinkNumber(); |
142 | LSL_Integer llGetLinkNumberOfSides(int link); | 143 | LSL_Integer llGetLinkNumberOfSides(int link); |
143 | LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules); | 144 | LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules); |
145 | LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules); | ||
144 | LSL_Integer llGetListEntryType(LSL_List src, int index); | 146 | LSL_Integer llGetListEntryType(LSL_List src, int index); |
145 | LSL_Integer llGetListLength(LSL_List src); | 147 | LSL_Integer llGetListLength(LSL_List src); |
146 | LSL_Vector llGetLocalPos(); | 148 | LSL_Vector llGetLocalPos(); |
@@ -337,6 +339,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
337 | void llSetInventoryPermMask(string item, int mask, int value); | 339 | void llSetInventoryPermMask(string item, int mask, int value); |
338 | void llSetLinkAlpha(int linknumber, double alpha, int face); | 340 | void llSetLinkAlpha(int linknumber, double alpha, int face); |
339 | void llSetLinkColor(int linknumber, LSL_Vector color, int face); | 341 | void llSetLinkColor(int linknumber, LSL_Vector color, int face); |
342 | LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules); | ||
340 | void llSetLinkPrimitiveParams(int linknumber, LSL_List rules); | 343 | void llSetLinkPrimitiveParams(int linknumber, LSL_List rules); |
341 | void llSetLinkTexture(int linknumber, string texture, int face); | 344 | void llSetLinkTexture(int linknumber, string texture, int face); |
342 | void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate); | 345 | 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 | |||
348 | void llSetPayPrice(int price, LSL_List quick_pay_buttons); | 351 | void llSetPayPrice(int price, LSL_List quick_pay_buttons); |
349 | void llSetPos(LSL_Vector pos); | 352 | void llSetPos(LSL_Vector pos); |
350 | LSL_Integer llSetRegionPos(LSL_Vector pos); | 353 | LSL_Integer llSetRegionPos(LSL_Vector pos); |
351 | LSL_Integer llSetPrimMediaParams(int face, LSL_List rules); | 354 | LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules); |
352 | void llSetPrimitiveParams(LSL_List rules); | 355 | void llSetPrimitiveParams(LSL_List rules); |
353 | void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules); | 356 | void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules); |
354 | void llSetPrimURL(string url); | 357 | void llSetPrimURL(string url); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 21d8432..5f9f0b9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -1909,17 +1909,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1909 | { | 1909 | { |
1910 | return m_LSL_Functions.llGetPrimMediaParams(face, rules); | 1910 | return m_LSL_Functions.llGetPrimMediaParams(face, rules); |
1911 | } | 1911 | } |
1912 | 1912 | ||
1913 | public LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules) | ||
1914 | { | ||
1915 | return m_LSL_Functions.llGetLinkMedia(link, face, rules); | ||
1916 | } | ||
1917 | |||
1913 | public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules) | 1918 | public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules) |
1914 | { | 1919 | { |
1915 | return m_LSL_Functions.llSetPrimMediaParams(face, rules); | 1920 | return m_LSL_Functions.llSetPrimMediaParams(face, rules); |
1916 | } | 1921 | } |
1917 | 1922 | ||
1923 | public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules) | ||
1924 | { | ||
1925 | return m_LSL_Functions.llSetLinkMedia(link, face, rules); | ||
1926 | } | ||
1927 | |||
1918 | public LSL_Integer llClearPrimMedia(LSL_Integer face) | 1928 | public LSL_Integer llClearPrimMedia(LSL_Integer face) |
1919 | { | 1929 | { |
1920 | return m_LSL_Functions.llClearPrimMedia(face); | 1930 | return m_LSL_Functions.llClearPrimMedia(face); |
1921 | } | 1931 | } |
1922 | 1932 | ||
1933 | public LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face) | ||
1934 | { | ||
1935 | return m_LSL_Functions.llClearLinkMedia(link, face); | ||
1936 | } | ||
1937 | |||
1923 | public LSL_Integer llGetLinkNumberOfSides(LSL_Integer link) | 1938 | public LSL_Integer llGetLinkNumberOfSides(LSL_Integer link) |
1924 | { | 1939 | { |
1925 | return m_LSL_Functions.llGetLinkNumberOfSides(link); | 1940 | return m_LSL_Functions.llGetLinkNumberOfSides(link); |