diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
3 files changed, 35 insertions, 24 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c41f2a5..3051609 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -50,6 +50,9 @@ using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | |||
50 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 50 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
51 | using OpenSim.Region.ScriptEngine.Interfaces; | 51 | using OpenSim.Region.ScriptEngine.Interfaces; |
52 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; | 52 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; |
53 | using OpenSim.Services.Interfaces; | ||
54 | |||
55 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
53 | 56 | ||
54 | using AssetLandmark = OpenSim.Framework.AssetLandmark; | 57 | using AssetLandmark = OpenSim.Framework.AssetLandmark; |
55 | 58 | ||
@@ -2010,10 +2013,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2010 | q = avatar.Rotation; // Currently infrequently updated so may be inaccurate | 2013 | q = avatar.Rotation; // Currently infrequently updated so may be inaccurate |
2011 | } | 2014 | } |
2012 | else | 2015 | else |
2013 | q = part.ParentGroup.GroupRotation; // Likely never get here but just in case | 2016 | q = part.ParentGroup.Rotation; // Likely never get here but just in case |
2014 | } | 2017 | } |
2015 | else | 2018 | else |
2016 | q = part.ParentGroup.GroupRotation; // just the group rotation | 2019 | q = part.ParentGroup.Rotation; // just the group rotation |
2017 | return new LSL_Rotation(q.X, q.Y, q.Z, q.W); | 2020 | return new LSL_Rotation(q.X, q.Y, q.Z, q.W); |
2018 | } | 2021 | } |
2019 | q = part.GetWorldRotation(); | 2022 | q = part.GetWorldRotation(); |
@@ -5002,6 +5005,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5002 | if (end > src.Length) | 5005 | if (end > src.Length) |
5003 | end = src.Length; | 5006 | end = src.Length; |
5004 | 5007 | ||
5008 | if (stride == 0) | ||
5009 | stride = 1; | ||
5010 | |||
5005 | // There may be one or two ranges to be considered | 5011 | // There may be one or two ranges to be considered |
5006 | 5012 | ||
5007 | if (start != end) | 5013 | if (start != end) |
@@ -5028,9 +5034,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5028 | // A negative stride reverses the direction of the | 5034 | // A negative stride reverses the direction of the |
5029 | // scan producing an inverted list as a result. | 5035 | // scan producing an inverted list as a result. |
5030 | 5036 | ||
5031 | if (stride == 0) | ||
5032 | stride = 1; | ||
5033 | |||
5034 | if (stride > 0) | 5037 | if (stride > 0) |
5035 | { | 5038 | { |
5036 | for (int i = 0; i < src.Length; i += stride) | 5039 | for (int i = 0; i < src.Length; i += stride) |
@@ -5054,7 +5057,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5054 | } | 5057 | } |
5055 | else | 5058 | else |
5056 | { | 5059 | { |
5057 | result.Add(src.Data[start]); | 5060 | if (start%stride == 0) |
5061 | { | ||
5062 | result.Add(src.Data[start]); | ||
5063 | } | ||
5058 | } | 5064 | } |
5059 | 5065 | ||
5060 | return result; | 5066 | return result; |
@@ -5232,12 +5238,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5232 | } | 5238 | } |
5233 | } | 5239 | } |
5234 | 5240 | ||
5235 | List<SimpleRegionInfo> neighbors = World.CommsManager.GridService.RequestNeighbours(World.RegionInfo.RegionLocX, World.RegionInfo.RegionLocY); | 5241 | List<GridRegion> neighbors = World.GridService.GetNeighbours(World.RegionInfo.ScopeID, World.RegionInfo.RegionID); |
5236 | 5242 | ||
5237 | uint neighborX = World.RegionInfo.RegionLocX + (uint)dir.x; | 5243 | uint neighborX = World.RegionInfo.RegionLocX + (uint)dir.x; |
5238 | uint neighborY = World.RegionInfo.RegionLocY + (uint)dir.y; | 5244 | uint neighborY = World.RegionInfo.RegionLocY + (uint)dir.y; |
5239 | 5245 | ||
5240 | foreach (SimpleRegionInfo sri in neighbors) | 5246 | foreach (GridRegion sri in neighbors) |
5241 | { | 5247 | { |
5242 | if (sri.RegionLocX == neighborX && sri.RegionLocY == neighborY) | 5248 | if (sri.RegionLocX == neighborX && sri.RegionLocY == neighborY) |
5243 | return 0; | 5249 | return 0; |
@@ -7178,10 +7184,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7178 | else | 7184 | else |
7179 | q = avatar.Rotation; // Currently infrequently updated so may be inaccurate | 7185 | q = avatar.Rotation; // Currently infrequently updated so may be inaccurate |
7180 | else | 7186 | else |
7181 | q = m_host.ParentGroup.GroupRotation; // Likely never get here but just in case | 7187 | q = m_host.ParentGroup.Rotation; // Likely never get here but just in case |
7182 | } | 7188 | } |
7183 | else | 7189 | else |
7184 | q = m_host.ParentGroup.GroupRotation; // just the group rotation | 7190 | q = m_host.ParentGroup.Rotation; // just the group rotation |
7185 | return new LSL_Rotation(q.X, q.Y, q.Z, q.W); | 7191 | return new LSL_Rotation(q.X, q.Y, q.Z, q.W); |
7186 | } | 7192 | } |
7187 | 7193 | ||
@@ -8184,7 +8190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8184 | 8190 | ||
8185 | string reply = String.Empty; | 8191 | string reply = String.Empty; |
8186 | 8192 | ||
8187 | RegionInfo info = m_ScriptEngine.World.RequestClosestRegion(simulator); | 8193 | GridRegion info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); |
8188 | 8194 | ||
8189 | switch (data) | 8195 | switch (data) |
8190 | { | 8196 | { |
@@ -8211,7 +8217,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8211 | ConditionalScriptSleep(1000); | 8217 | ConditionalScriptSleep(1000); |
8212 | return UUID.Zero.ToString(); | 8218 | return UUID.Zero.ToString(); |
8213 | } | 8219 | } |
8214 | int access = info.RegionSettings.Maturity; | 8220 | int access = info.Maturity; |
8215 | if (access == 0) | 8221 | if (access == 0) |
8216 | reply = "PG"; | 8222 | reply = "PG"; |
8217 | else if (access == 1) | 8223 | else if (access == 1) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index ccdd4c5..0b95abc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -48,6 +48,8 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | |||
48 | using OpenSim.Region.ScriptEngine.Interfaces; | 48 | using OpenSim.Region.ScriptEngine.Interfaces; |
49 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; | 49 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; |
50 | using TPFlags = OpenSim.Framework.Constants.TeleportFlags; | 50 | using TPFlags = OpenSim.Framework.Constants.TeleportFlags; |
51 | using OpenSim.Services.Interfaces; | ||
52 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
51 | using System.Text.RegularExpressions; | 53 | using System.Text.RegularExpressions; |
52 | 54 | ||
53 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; | 55 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; |
@@ -599,17 +601,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
599 | if (regionName.Contains(".") && regionName.Contains(":")) | 601 | if (regionName.Contains(".") && regionName.Contains(":")) |
600 | { | 602 | { |
601 | // Try to link the region | 603 | // Try to link the region |
602 | RegionInfo regInfo = HGHyperlink.TryLinkRegion(World, | 604 | IHyperlinkService hyperService = World.RequestModuleInterface<IHyperlinkService>(); |
603 | presence.ControllingClient, | 605 | if (hyperService != null) |
604 | regionName); | ||
605 | // Get the region name | ||
606 | if (regInfo != null) | ||
607 | { | 606 | { |
608 | regionName = regInfo.RegionName; | 607 | GridRegion regInfo = hyperService.TryLinkRegion(presence.ControllingClient, |
609 | } | 608 | regionName); |
610 | else | 609 | // Get the region name |
611 | { | 610 | if (regInfo != null) |
612 | // Might need to ping the client here in case of failure?? | 611 | { |
612 | regionName = regInfo.RegionName; | ||
613 | } | ||
614 | else | ||
615 | { | ||
616 | // Might need to ping the client here in case of failure?? | ||
617 | } | ||
613 | } | 618 | } |
614 | } | 619 | } |
615 | presence.ControllingClient.SendTeleportLocationStart(); | 620 | presence.ControllingClient.SendTeleportLocationStart(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index d0df390..8dcb1f5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
95 | return m_OSSL_Functions.osWindActiveModelPluginName(); | 95 | return m_OSSL_Functions.osWindActiveModelPluginName(); |
96 | } | 96 | } |
97 | 97 | ||
98 | // Not yet plugged in as available OSSL functions, so commented out | 98 | // Not yet plugged in as available OSSL functions, so commented out |
99 | // void osWindParamSet(string plugin, string param, float value) | 99 | // void osWindParamSet(string plugin, string param, float value) |
100 | // { | 100 | // { |
101 | // m_OSSL_Functions.osWindParamSet(plugin, param, value); | 101 | // m_OSSL_Functions.osWindParamSet(plugin, param, value); |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
329 | 329 | ||
330 | public string osGetSimulatorVersion() | 330 | public string osGetSimulatorVersion() |
331 | { | 331 | { |
332 | return m_OSSL_Functions.osGetSimulatorVersion(); | 332 | return m_OSSL_Functions.osGetSimulatorVersion(); |
333 | } | 333 | } |
334 | 334 | ||
335 | public Hashtable osParseJSON(string JSON) | 335 | public Hashtable osParseJSON(string JSON) |