aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs118
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs45
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs36
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs46
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs71
5 files changed, 283 insertions, 33 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
new file mode 100644
index 0000000..489c1c6
--- /dev/null
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
@@ -0,0 +1,118 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
26 */
27
28using System;
29using System.Reflection;
30using System.Collections;
31using System.Collections.Generic;
32using System.Runtime.Remoting.Lifetime;
33using OpenMetaverse;
34using Nini.Config;
35using OpenSim;
36using OpenSim.Framework;
37using OpenSim.Region.CoreModules.World.LightShare;
38using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes;
40using OpenSim.Region.ScriptEngine.Shared;
41using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
42using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
43using OpenSim.Region.ScriptEngine.Interfaces;
44using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
45using OpenSim.Services.Interfaces;
46
47using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
48using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
49using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
50using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
51using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
52using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
53using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
54
55namespace OpenSim.Region.ScriptEngine.Shared.Api
56{
57 [Serializable]
58 public class CM_Api : MarshalByRefObject, ICM_Api, IScriptApi
59 {
60 internal IScriptEngine m_ScriptEngine;
61 internal SceneObjectPart m_host;
62 internal uint m_localID;
63 internal UUID m_itemID;
64 internal bool m_CMFunctionsEnabled = false;
65
66 public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
67 {
68 m_ScriptEngine = ScriptEngine;
69 m_host = host;
70 m_localID = localID;
71 m_itemID = itemID;
72
73 if (m_ScriptEngine.Config.GetBoolean("AllowCareminsterFunctions", false))
74 m_CMFunctionsEnabled = true;
75 }
76
77 public override Object InitializeLifetimeService()
78 {
79 ILease lease = (ILease)base.InitializeLifetimeService();
80
81 if (lease.CurrentState == LeaseState.Initial)
82 {
83 lease.InitialLeaseTime = TimeSpan.FromMinutes(0);
84 // lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0);
85 // lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0);
86 }
87 return lease;
88 }
89
90 public Scene World
91 {
92 get { return m_ScriptEngine.World; }
93 }
94
95 public string cmDetectedCountry(int number)
96 {
97 m_host.AddScriptLPS(1);
98 DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, number);
99 if (detectedParams == null)
100 return String.Empty;
101 return detectedParams.Country;
102 }
103
104 public string cmGetAgentCountry(LSL_Key key)
105 {
106 if (!World.Permissions.IsGod(m_host.OwnerID))
107 return String.Empty;
108
109 UUID uuid;
110
111 if (!UUID.TryParse(key, out uuid))
112 return String.Empty;
113
114 UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
115 return account.UserCountry;
116 }
117 }
118}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 59e905e..559523b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1920,15 +1920,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1920 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) 1920 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
1921 return; 1921 return;
1922 1922
1923 UUID textureID=new UUID(); 1923 UUID textureID = new UUID();
1924 1924
1925 if (!UUID.TryParse(texture, out textureID)) 1925 textureID = InventoryKey(texture, (int)AssetType.Texture);
1926 { 1926 if (textureID == UUID.Zero)
1927 textureID=InventoryKey(texture, (int)AssetType.Texture); 1927 {
1928 } 1928 if (!UUID.TryParse(texture, out textureID))
1929 1929 return;
1930 if (textureID == UUID.Zero) 1930 }
1931 return;
1932 1931
1933 Primitive.TextureEntry tex = part.Shape.Textures; 1932 Primitive.TextureEntry tex = part.Shape.Textures;
1934 1933
@@ -3346,12 +3345,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3346 msg.ParentEstateID = World.RegionInfo.EstateSettings.EstateID; 3345 msg.ParentEstateID = World.RegionInfo.EstateSettings.EstateID;
3347 msg.Position = new Vector3(m_host.AbsolutePosition); 3346 msg.Position = new Vector3(m_host.AbsolutePosition);
3348 msg.RegionID = World.RegionInfo.RegionID.Guid; 3347 msg.RegionID = World.RegionInfo.RegionID.Guid;
3349 msg.binaryBucket = Util.StringToBytes256(m_host.OwnerID.ToString()); 3348 msg.binaryBucket
3349 = Util.StringToBytes256(
3350 "{0}/{1}/{2}/{3}",
3351 World.RegionInfo.RegionName,
3352 (int)Math.Floor(m_host.AbsolutePosition.X),
3353 (int)Math.Floor(m_host.AbsolutePosition.Y),
3354 (int)Math.Floor(m_host.AbsolutePosition.Z));
3350 3355
3351 if (m_TransferModule != null) 3356 if (m_TransferModule != null)
3352 { 3357 {
3353 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 3358 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
3354 } 3359 }
3360
3355 ScriptSleep(2000); 3361 ScriptSleep(2000);
3356 } 3362 }
3357 3363
@@ -4195,7 +4201,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4195 if (!found) 4201 if (!found)
4196 { 4202 {
4197 llSay(0, String.Format("Could not find object '{0}'", inventory)); 4203 llSay(0, String.Format("Could not find object '{0}'", inventory));
4198 throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); 4204 return;
4205// throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory));
4199 } 4206 }
4200 4207
4201 // check if destination is an object 4208 // check if destination is an object
@@ -4479,7 +4486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4479 if (presence != null) 4486 if (presence != null)
4480 { 4487 {
4481 // agent must not be a god 4488 // agent must not be a god
4482 if (presence.GodLevel >= 200) return; 4489 if (presence.UserLevel >= 200) return;
4483 4490
4484 // agent must be over the owners land 4491 // agent must be over the owners land
4485 if (m_host.OwnerID == World.LandChannel.GetLandObject( 4492 if (m_host.OwnerID == World.LandChannel.GetLandObject(
@@ -6860,6 +6867,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6860 } 6867 }
6861 6868
6862 // copy the first script found with this inventory name 6869 // copy the first script found with this inventory name
6870 TaskInventoryItem scriptItem = null;
6863 m_host.TaskInventory.LockItemsForRead(true); 6871 m_host.TaskInventory.LockItemsForRead(true);
6864 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) 6872 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
6865 { 6873 {
@@ -6870,6 +6878,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6870 { 6878 {
6871 found = true; 6879 found = true;
6872 srcId = inv.Key; 6880 srcId = inv.Key;
6881 scriptItem = inv.Value;
6873 break; 6882 break;
6874 } 6883 }
6875 } 6884 }
@@ -6882,8 +6891,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6882 return; 6891 return;
6883 } 6892 }
6884 6893
6885 // the rest of the permission checks are done in RezScript, so check the pin there as well 6894 SceneObjectPart dest = World.GetSceneObjectPart(destId);
6886 World.RezScript(srcId, m_host, destId, pin, running, start_param); 6895 if (dest != null)
6896 {
6897 if ((scriptItem.BasePermissions & (uint)PermissionMask.Transfer) != 0 || dest.ParentGroup.RootPart.OwnerID == m_host.ParentGroup.RootPart.OwnerID)
6898 {
6899 // the rest of the permission checks are done in RezScript, so check the pin there as well
6900 World.RezScript(srcId, m_host, destId, pin, running, start_param);
6901
6902 if ((scriptItem.BasePermissions & (uint)PermissionMask.Copy) == 0)
6903 m_host.Inventory.RemoveInventoryItem(srcId);
6904 }
6905 }
6887 // this will cause the delay even if the script pin or permissions were wrong - seems ok 6906 // this will cause the delay even if the script pin or permissions were wrong - seems ok
6888 ScriptSleep(3000); 6907 ScriptSleep(3000);
6889 } 6908 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index cf059b3..39e1a27 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -690,10 +690,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
690 // 690 //
691 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); 691 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
692 692
693 TeleportAgent(agent, regionName, position, lookat); 693 TeleportAgent(agent, regionName, position, lookat, false);
694 } 694 }
695 695
696 private void TeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 696 private void TeleportAgent(string agent, string regionName,
697 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions)
697 { 698 {
698 m_host.AddScriptLPS(1); 699 m_host.AddScriptLPS(1);
699 UUID agentId = new UUID(); 700 UUID agentId = new UUID();
@@ -702,21 +703,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
702 ScenePresence presence = World.GetScenePresence(agentId); 703 ScenePresence presence = World.GetScenePresence(agentId);
703 if (presence != null) 704 if (presence != null)
704 { 705 {
705 // agent must be over owners land to avoid abuse 706 // For osTeleportAgent, agent must be over owners land to avoid abuse
706 if (m_host.OwnerID 707 // For osTeleportOwner, this restriction isn't necessary
708 if (relaxRestrictions ||
709 m_host.OwnerID
707 == World.LandChannel.GetLandObject( 710 == World.LandChannel.GetLandObject(
708 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 711 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
709 { 712 {
710 // Check for hostname, attempt to make a HG link,
711 // and convert the regionName to the target region
712 if (regionName.Contains(".") && regionName.Contains(":"))
713 {
714// List<GridRegion> regions = World.GridService.GetRegionsByName(World.RegionInfo.ScopeID, regionName, 1);
715 string[] parts = regionName.Split(new char[] { ':' });
716 if (parts.Length > 2)
717 regionName = parts[0] + ':' + parts[1] + "/ " + parts[2];
718 regionName = "http://" + regionName;
719 }
720 World.RequestTeleportLocation(presence.ControllingClient, regionName, 713 World.RequestTeleportLocation(presence.ControllingClient, regionName,
721 new Vector3((float)position.x, (float)position.y, (float)position.z), 714 new Vector3((float)position.x, (float)position.y, (float)position.z),
722 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); 715 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation);
@@ -733,10 +726,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
733 // 726 //
734 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); 727 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
735 728
736 TeleportAgent(agent, regionX, regionY, position, lookat); 729 TeleportAgent(agent, regionX, regionY, position, lookat, false);
737 } 730 }
738 731
739 private void TeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 732 private void TeleportAgent(string agent, int regionX, int regionY,
733 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions)
740 { 734 {
741 ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); 735 ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize));
742 736
@@ -747,8 +741,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
747 ScenePresence presence = World.GetScenePresence(agentId); 741 ScenePresence presence = World.GetScenePresence(agentId);
748 if (presence != null) 742 if (presence != null)
749 { 743 {
750 // agent must be over owners land to avoid abuse 744 // For osTeleportAgent, agent must be over owners land to avoid abuse
751 if (m_host.OwnerID 745 // For osTeleportOwner, this restriction isn't necessary
746 if (relaxRestrictions ||
747 m_host.OwnerID
752 == World.LandChannel.GetLandObject( 748 == World.LandChannel.GetLandObject(
753 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 749 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
754 { 750 {
@@ -771,7 +767,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
771 // Threat level None because this is what can already be done with the World Map in the viewer 767 // Threat level None because this is what can already be done with the World Map in the viewer
772 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); 768 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
773 769
774 TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat); 770 TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat, true);
775 } 771 }
776 772
777 public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 773 public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
@@ -783,7 +779,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
783 { 779 {
784 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); 780 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
785 781
786 TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat); 782 TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat, true);
787 } 783 }
788 784
789 // Functions that get information from the agent itself. 785 // Functions that get information from the agent itself.
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs
new file mode 100644
index 0000000..ab215f3
--- /dev/null
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs
@@ -0,0 +1,46 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
26 */
27
28using System.Collections;
29using OpenSim.Region.ScriptEngine.Interfaces;
30
31using key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
32using rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
33using vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
34using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
35using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
36using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
37using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
38
39namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
40{
41 public interface ICM_Api
42 {
43 string cmDetectedCountry(int num);
44 string cmGetAgentCountry(key key);
45 }
46}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs
new file mode 100644
index 0000000..4132dfa
--- /dev/null
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs
@@ -0,0 +1,71 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
26 */
27
28using System;
29using System.Runtime.Remoting.Lifetime;
30using System.Threading;
31using System.Reflection;
32using System.Collections;
33using System.Collections.Generic;
34using OpenSim.Framework;
35using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.ScriptEngine.Interfaces;
37using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
38using integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
39using vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
40using rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
41using key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
42using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
43using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
44using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
45using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
46
47namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
48{
49 public partial class ScriptBaseClass : MarshalByRefObject
50 {
51 public ICM_Api m_CM_Functions;
52
53 public void ApiTypeCM(IScriptApi api)
54 {
55 if (!(api is ICM_Api))
56 return;
57
58 m_CM_Functions = (ICM_Api)api;
59 }
60
61 public string cmDetectedCountry(int num)
62 {
63 return m_CM_Functions.cmDetectedCountry(num);
64 }
65
66 public string cmGetAgentCountry(key key)
67 {
68 return m_CM_Functions.cmGetAgentCountry(key);
69 }
70 }
71}