aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs42
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs54
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs9
6 files changed, 83 insertions, 29 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 39f620b..bf83a49 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()
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 726b37a..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;
48using OpenSim.Region.ScriptEngine.Interfaces; 48using OpenSim.Region.ScriptEngine.Interfaces;
49using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; 49using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
50using TPFlags = OpenSim.Framework.Constants.TeleportFlags; 50using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
51using OpenSim.Services.Interfaces;
52using GridRegion = OpenSim.Services.Interfaces.GridRegion;
51using System.Text.RegularExpressions; 53using System.Text.RegularExpressions;
52 54
53using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; 55using 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();
@@ -1164,6 +1169,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1164 1169
1165 land.SetMediaUrl(url); 1170 land.SetMediaUrl(url);
1166 } 1171 }
1172
1173 public void osSetParcelSIPAddress(string SIPAddress)
1174 {
1175 // What actually is the difference to the LL function?
1176 //
1177 CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL");
1178
1179 m_host.AddScriptLPS(1);
1180
1181
1182 ILandObject land
1183 = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
1184
1185 if (land.landData.OwnerID != m_host.ObjectOwner)
1186 {
1187 OSSLError("osSetParcelSIPAddress: Sorry, you need to own the land to use this function");
1188 return;
1189 }
1190
1191 // get the voice module
1192 IVoiceModule voiceModule = World.RequestModuleInterface<IVoiceModule>();
1193
1194 if (voiceModule != null)
1195 voiceModule.setLandSIPAddress(SIPAddress,land.landData.GlobalID);
1196 else
1197 OSSLError("osSetParcelSIPAddress: No voice module enabled for this land");
1198
1199
1200 }
1167 1201
1168 public string osGetScriptEngineName() 1202 public string osGetScriptEngineName()
1169 { 1203 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index 41358e5..a74e8da 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -201,7 +201,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
201 void llGroundRepel(double height, int water, double tau); 201 void llGroundRepel(double height, int water, double tau);
202 LSL_Vector llGroundSlope(LSL_Vector offset); 202 LSL_Vector llGroundSlope(LSL_Vector offset);
203 LSL_String llHTTPRequest(string url, LSL_List parameters, string body); 203 LSL_String llHTTPRequest(string url, LSL_List parameters, string body);
204 void llHTTPResponse(string url, int status, string body); 204 void llHTTPResponse(LSL_Key id, int status, string body);
205 LSL_String llInsertString(string dst, int position, string src); 205 LSL_String llInsertString(string dst, int position, string src);
206 void llInstantMessage(string user, string message); 206 void llInstantMessage(string user, string message);
207 LSL_String llIntegerToBase64(int number); 207 LSL_String llIntegerToBase64(int number);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 49aa45a..d8d3c31 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -75,6 +75,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
75 bool osConsoleCommand(string Command); 75 bool osConsoleCommand(string Command);
76 void osSetParcelMediaURL(string url); 76 void osSetParcelMediaURL(string url);
77 void osSetPrimFloatOnWater(int floatYN); 77 void osSetPrimFloatOnWater(int floatYN);
78 void osSetParcelSIPAddress(string SIPAddress);
78 79
79 // Avatar Info Commands 80 // Avatar Info Commands
80 string osGetAgentIP(string agent); 81 string osGetAgentIP(string agent);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 02ae281..a28e97b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -864,9 +864,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
864 return m_LSL_Functions.llHTTPRequest(url, parameters, body); 864 return m_LSL_Functions.llHTTPRequest(url, parameters, body);
865 } 865 }
866 866
867 public void llHTTPResponse(string url, int status, string body) 867 public void llHTTPResponse(LSL_Key id, int status, string body)
868 { 868 {
869 m_LSL_Functions.llHTTPResponse(url, status, body); 869 m_LSL_Functions.llHTTPResponse(id, status, body);
870 } 870 }
871 871
872 public LSL_String llInsertString(string dst, int position, string src) 872 public LSL_String llInsertString(string dst, int position, string src)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 8f52d99..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);
@@ -183,6 +183,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
183 { 183 {
184 m_OSSL_Functions.osSetParcelMediaURL(url); 184 m_OSSL_Functions.osSetParcelMediaURL(url);
185 } 185 }
186
187 public void osSetParcelSIPAddress(string SIPAddress)
188 {
189 m_OSSL_Functions.osSetParcelSIPAddress(SIPAddress);
190 }
186 191
187 public void osSetPrimFloatOnWater(int floatYN) 192 public void osSetPrimFloatOnWater(int floatYN)
188 { 193 {
@@ -324,7 +329,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
324 329
325 public string osGetSimulatorVersion() 330 public string osGetSimulatorVersion()
326 { 331 {
327 return m_OSSL_Functions.osGetSimulatorVersion(); 332 return m_OSSL_Functions.osGetSimulatorVersion();
328 } 333 }
329 334
330 public Hashtable osParseJSON(string JSON) 335 public Hashtable osParseJSON(string JSON)