diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 64931d0..b710229 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -38,7 +38,6 @@ using OpenSim; | |||
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | 39 | ||
40 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
41 | using OpenSim.Region.CoreModules.Avatar.NPC; | ||
42 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
44 | using OpenSim.Region.ScriptEngine.Shared; | 43 | using OpenSim.Region.ScriptEngine.Shared; |
@@ -812,7 +811,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
812 | World.ForEachScenePresence(delegate(ScenePresence sp) | 811 | World.ForEachScenePresence(delegate(ScenePresence sp) |
813 | { | 812 | { |
814 | if (!sp.IsChildAgent) | 813 | if (!sp.IsChildAgent) |
815 | result.Add(sp.Name); | 814 | result.Add(new LSL_String(sp.Name)); |
816 | }); | 815 | }); |
817 | return result; | 816 | return result; |
818 | } | 817 | } |
@@ -970,7 +969,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
970 | 969 | ||
971 | public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) | 970 | public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) |
972 | { | 971 | { |
973 | CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); | 972 | CheckThreatLevel(ThreatLevel.None, "osDrawPolygon"); |
974 | 973 | ||
975 | m_host.AddScriptLPS(1); | 974 | m_host.AddScriptLPS(1); |
976 | 975 | ||
@@ -1241,7 +1240,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1241 | return String.Empty; | 1240 | return String.Empty; |
1242 | } | 1241 | } |
1243 | 1242 | ||
1244 | public void osSetWindParam(string plugin, string param, float value) | 1243 | public void osSetWindParam(string plugin, string param, LSL_Float value) |
1245 | { | 1244 | { |
1246 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); | 1245 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); |
1247 | m_host.AddScriptLPS(1); | 1246 | m_host.AddScriptLPS(1); |
@@ -1251,13 +1250,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1251 | { | 1250 | { |
1252 | try | 1251 | try |
1253 | { | 1252 | { |
1254 | module.WindParamSet(plugin, param, value); | 1253 | module.WindParamSet(plugin, param, (float)value); |
1255 | } | 1254 | } |
1256 | catch (Exception) { } | 1255 | catch (Exception) { } |
1257 | } | 1256 | } |
1258 | } | 1257 | } |
1259 | 1258 | ||
1260 | public float osGetWindParam(string plugin, string param) | 1259 | public LSL_Float osGetWindParam(string plugin, string param) |
1261 | { | 1260 | { |
1262 | CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); | 1261 | CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); |
1263 | m_host.AddScriptLPS(1); | 1262 | m_host.AddScriptLPS(1); |
@@ -1409,7 +1408,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1409 | { | 1408 | { |
1410 | // What actually is the difference to the LL function? | 1409 | // What actually is the difference to the LL function? |
1411 | // | 1410 | // |
1412 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL"); | 1411 | CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress"); |
1413 | 1412 | ||
1414 | m_host.AddScriptLPS(1); | 1413 | m_host.AddScriptLPS(1); |
1415 | 1414 | ||
@@ -1910,8 +1909,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1910 | }; | 1909 | }; |
1911 | 1910 | ||
1912 | return NotecardCache.GetLines(assetID); | 1911 | return NotecardCache.GetLines(assetID); |
1913 | |||
1914 | |||
1915 | } | 1912 | } |
1916 | 1913 | ||
1917 | public string osAvatarName2Key(string firstname, string lastname) | 1914 | public string osAvatarName2Key(string firstname, string lastname) |
@@ -2025,16 +2022,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2025 | // Find matches beginning at start position | 2022 | // Find matches beginning at start position |
2026 | Regex matcher = new Regex(pattern); | 2023 | Regex matcher = new Regex(pattern); |
2027 | Match match = matcher.Match(src, start); | 2024 | Match match = matcher.Match(src, start); |
2028 | if (match.Success) | 2025 | while (match.Success) |
2029 | { | 2026 | { |
2030 | foreach (System.Text.RegularExpressions.Group g in match.Groups) | 2027 | foreach (System.Text.RegularExpressions.Group g in match.Groups) |
2031 | { | 2028 | { |
2032 | if (g.Success) | 2029 | if (g.Success) |
2033 | { | 2030 | { |
2034 | result.Add(g.Value); | 2031 | result.Add(new LSL_String(g.Value)); |
2035 | result.Add(g.Index); | 2032 | result.Add(new LSL_Integer(g.Index)); |
2036 | } | 2033 | } |
2037 | } | 2034 | } |
2035 | |||
2036 | match = match.NextMatch(); | ||
2038 | } | 2037 | } |
2039 | 2038 | ||
2040 | return result; | 2039 | return result; |
@@ -2209,12 +2208,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2209 | return (int)pws; | 2208 | return (int)pws; |
2210 | } | 2209 | } |
2211 | 2210 | ||
2212 | public void osSetSpeed(string UUID, float SpeedModifier) | 2211 | public void osSetSpeed(string UUID, LSL_Float SpeedModifier) |
2213 | { | 2212 | { |
2214 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); | 2213 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); |
2215 | m_host.AddScriptLPS(1); | 2214 | m_host.AddScriptLPS(1); |
2216 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); | 2215 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); |
2217 | avatar.SpeedModifier = SpeedModifier; | 2216 | avatar.SpeedModifier = (float)SpeedModifier; |
2218 | } | 2217 | } |
2219 | 2218 | ||
2220 | public void osKickAvatar(string FirstName,string SurName,string alert) | 2219 | public void osKickAvatar(string FirstName,string SurName,string alert) |
@@ -2295,14 +2294,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2295 | { | 2294 | { |
2296 | CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); | 2295 | CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); |
2297 | m_host.AddScriptLPS(1); | 2296 | m_host.AddScriptLPS(1); |
2297 | InitLSL(); | ||
2298 | 2298 | ||
2299 | return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules); | 2299 | return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules); |
2300 | } | 2300 | } |
2301 | 2301 | ||
2302 | public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) | 2302 | public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) |
2303 | { | 2303 | { |
2304 | CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams"); | 2304 | CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams"); |
2305 | m_host.AddScriptLPS(1); | 2305 | m_host.AddScriptLPS(1); |
2306 | InitLSL(); | ||
2306 | 2307 | ||
2307 | m_LSL_Api.SetPrimitiveParamsEx(prim, rules); | 2308 | m_LSL_Api.SetPrimitiveParamsEx(prim, rules); |
2308 | } | 2309 | } |
@@ -2364,9 +2365,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2364 | { | 2365 | { |
2365 | if (avatar.IsChildAgent == false) | 2366 | if (avatar.IsChildAgent == false) |
2366 | { | 2367 | { |
2367 | result.Add(avatar.UUID); | 2368 | result.Add(new LSL_String(avatar.UUID.ToString())); |
2368 | result.Add(avatar.AbsolutePosition); | 2369 | OpenMetaverse.Vector3 ap = avatar.AbsolutePosition; |
2369 | result.Add(avatar.Name); | 2370 | result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z)); |
2371 | result.Add(new LSL_String(avatar.Name)); | ||
2370 | } | 2372 | } |
2371 | } | 2373 | } |
2372 | }); | 2374 | }); |