aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs42
1 files changed, 28 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ba42678..0bd6546 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -24,7 +24,7 @@
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
@@ -50,6 +50,9 @@ using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
50using OpenSim.Region.ScriptEngine.Shared.ScriptBase; 50using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
51using OpenSim.Region.ScriptEngine.Interfaces; 51using OpenSim.Region.ScriptEngine.Interfaces;
52using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; 52using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
53using OpenSim.Services.Interfaces;
54
55using GridRegion = OpenSim.Services.Interfaces.GridRegion;
53 56
54using AssetLandmark = OpenSim.Framework.AssetLandmark; 57using AssetLandmark = OpenSim.Framework.AssetLandmark;
55 58
@@ -4996,6 +4999,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4996 if (end > src.Length) 4999 if (end > src.Length)
4997 end = src.Length; 5000 end = src.Length;
4998 5001
5002 if (stride == 0)
5003 stride = 1;
5004
4999 // There may be one or two ranges to be considered 5005 // There may be one or two ranges to be considered
5000 5006
5001 if (start != end) 5007 if (start != end)
@@ -5022,9 +5028,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5022 // A negative stride reverses the direction of the 5028 // A negative stride reverses the direction of the
5023 // scan producing an inverted list as a result. 5029 // scan producing an inverted list as a result.
5024 5030
5025 if (stride == 0)
5026 stride = 1;
5027
5028 if (stride > 0) 5031 if (stride > 0)
5029 { 5032 {
5030 for (int i = 0; i < src.Length; i += stride) 5033 for (int i = 0; i < src.Length; i += stride)
@@ -5048,7 +5051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5048 } 5051 }
5049 else 5052 else
5050 { 5053 {
5051 result.Add(src.Data[start]); 5054 if (start%stride == 0)
5055 {
5056 result.Add(src.Data[start]);
5057 }
5052 } 5058 }
5053 5059
5054 return result; 5060 return result;
@@ -5226,12 +5232,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5226 } 5232 }
5227 } 5233 }
5228 5234
5229 List<SimpleRegionInfo> neighbors = World.CommsManager.GridService.RequestNeighbours(World.RegionInfo.RegionLocX, World.RegionInfo.RegionLocY); 5235 List<GridRegion> neighbors = World.GridService.GetNeighbours(World.RegionInfo.ScopeID, World.RegionInfo.RegionID);
5230 5236
5231 uint neighborX = World.RegionInfo.RegionLocX + (uint)dir.x; 5237 uint neighborX = World.RegionInfo.RegionLocX + (uint)dir.x;
5232 uint neighborY = World.RegionInfo.RegionLocY + (uint)dir.y; 5238 uint neighborY = World.RegionInfo.RegionLocY + (uint)dir.y;
5233 5239
5234 foreach (SimpleRegionInfo sri in neighbors) 5240 foreach (GridRegion sri in neighbors)
5235 { 5241 {
5236 if (sri.RegionLocX == neighborX && sri.RegionLocY == neighborY) 5242 if (sri.RegionLocX == neighborX && sri.RegionLocY == neighborY)
5237 return 0; 5243 return 0;
@@ -6321,9 +6327,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6321 UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, UUID.Zero); 6327 UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, UUID.Zero);
6322 IXmlRpcRouter xmlRpcRouter = m_ScriptEngine.World.RequestModuleInterface<IXmlRpcRouter>(); 6328 IXmlRpcRouter xmlRpcRouter = m_ScriptEngine.World.RequestModuleInterface<IXmlRpcRouter>();
6323 if (xmlRpcRouter != null) 6329 if (xmlRpcRouter != null)
6330 {
6331 string ExternalHostName = m_ScriptEngine.World.RegionInfo.ExternalHostName;
6332
6324 xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID, 6333 xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID,
6325 m_itemID, String.Format("http://{0}:{1}/", System.Environment.MachineName, 6334 m_itemID, String.Format("http://{0}:{1}/", ExternalHostName,
6326 xmlrpcMod.Port.ToString())); 6335 xmlrpcMod.Port.ToString()));
6336 }
6327 object[] resobj = new object[] 6337 object[] resobj = new object[]
6328 { 6338 {
6329 new LSL_Integer(1), 6339 new LSL_Integer(1),
@@ -7834,8 +7844,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7834 public LSL_String llGetHTTPHeader(LSL_Key request_id, string header) 7844 public LSL_String llGetHTTPHeader(LSL_Key request_id, string header)
7835 { 7845 {
7836 m_host.AddScriptLPS(1); 7846 m_host.AddScriptLPS(1);
7837 NotImplemented("llGetHTTPHeader"); 7847
7838 return String.Empty; 7848 if (m_UrlModule != null)
7849 return m_UrlModule.GetHttpHeader(new UUID(request_id), header);
7850 return String.Empty;
7839 } 7851 }
7840 7852
7841 7853
@@ -8175,7 +8187,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8175 8187
8176 string reply = String.Empty; 8188 string reply = String.Empty;
8177 8189
8178 RegionInfo info = m_ScriptEngine.World.RequestClosestRegion(simulator); 8190 GridRegion info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator);
8179 8191
8180 switch (data) 8192 switch (data)
8181 { 8193 {
@@ -8202,7 +8214,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8202 ConditionalScriptSleep(1000); 8214 ConditionalScriptSleep(1000);
8203 return UUID.Zero.ToString(); 8215 return UUID.Zero.ToString();
8204 } 8216 }
8205 int access = info.RegionSettings.Maturity; 8217 int access = info.Maturity;
8206 if (access == 0) 8218 if (access == 0)
8207 reply = "PG"; 8219 reply = "PG";
8208 else if (access == 1) 8220 else if (access == 1)
@@ -9113,13 +9125,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9113 } 9125 }
9114 9126
9115 9127
9116 public void llHTTPResponse(string url, int status, string body) 9128 public void llHTTPResponse(LSL_Key id, int status, string body)
9117 { 9129 {
9118 // Partial implementation: support for parameter flags needed 9130 // Partial implementation: support for parameter flags needed
9119 // see http://wiki.secondlife.com/wiki/llHTTPResponse 9131 // see http://wiki.secondlife.com/wiki/llHTTPResponse
9120 9132
9121 m_host.AddScriptLPS(1); 9133 m_host.AddScriptLPS(1);
9122 NotImplemented("llHTTPResponse"); 9134
9135 if (m_UrlModule != null)
9136 m_UrlModule.HttpResponse(new UUID(id), status,body);
9123 } 9137 }
9124 9138
9125 public void llResetLandBanList() 9139 public void llResetLandBanList()