aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorUbitUmarov2018-09-13 12:32:55 +0100
committerUbitUmarov2018-09-13 12:32:55 +0100
commit075ebf3524d1493644e5060356249be99b732d7b (patch)
tree3a7221368b6bf0aca698abdfccc066a9bbdf2e19 /OpenSim/Region/ScriptEngine
parentpesty warning (diff)
downloadopensim-SC-075ebf3524d1493644e5060356249be99b732d7b.zip
opensim-SC-075ebf3524d1493644e5060356249be99b732d7b.tar.gz
opensim-SC-075ebf3524d1493644e5060356249be99b732d7b.tar.bz2
opensim-SC-075ebf3524d1493644e5060356249be99b732d7b.tar.xz
fix osDie harakiri for Yengine
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs37
1 files changed, 20 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 62729b3..6a0c274 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -134,7 +134,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
134 public const string GridInfoServiceConfigSectionName = "GridInfoService"; 134 public const string GridInfoServiceConfigSectionName = "GridInfoService";
135 135
136 internal IScriptEngine m_ScriptEngine; 136 internal IScriptEngine m_ScriptEngine;
137 internal ILSL_Api m_LSL_Api = null; // get a reference to the LSL API so we can call methods housed there 137 internal LSL_Api m_LSL_Api = null; // get a reference to the LSL API so we can call methods housed there
138 internal SceneObjectPart m_host; 138 internal SceneObjectPart m_host;
139 internal TaskInventoryItem m_item; 139 internal TaskInventoryItem m_item;
140 internal bool m_OSFunctionsEnabled = false; 140 internal bool m_OSFunctionsEnabled = false;
@@ -249,7 +249,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
249 if (m_LSL_Api != null) 249 if (m_LSL_Api != null)
250 return; 250 return;
251 251
252 m_LSL_Api = (ILSL_Api)m_ScriptEngine.GetApi(m_item.ItemID, "LSL"); 252 m_LSL_Api = (LSL_Api)m_ScriptEngine.GetApi(m_item.ItemID, "LSL");
253 } 253 }
254 254
255 // 255 //
@@ -2104,11 +2104,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2104 return; 2104 return;
2105 } 2105 }
2106 2106
2107 InitLSL();
2107 // harakiri check 2108 // harakiri check
2108 if(objUUID == UUID.Zero) 2109 if(objUUID == UUID.Zero)
2109 { 2110 {
2110 if (!m_host.ParentGroup.IsAttachment) 2111 if (!m_host.ParentGroup.IsAttachment)
2111 throw new SelfDeleteException(); 2112 m_LSL_Api.llDie();
2112 return; 2113 return;
2113 } 2114 }
2114 2115
@@ -2125,7 +2126,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2125 2126
2126 // harakiri check 2127 // harakiri check
2127 if(sceneOG.UUID == m_host.ParentGroup.UUID) 2128 if(sceneOG.UUID == m_host.ParentGroup.UUID)
2128 throw new SelfDeleteException(); 2129 {
2130 m_LSL_Api.llDie();
2131 return;
2132 }
2129 2133
2130 // restrict to objects rezzed by host 2134 // restrict to objects rezzed by host
2131 if(sceneOG.RezzerID == m_host.ParentGroup.UUID) 2135 if(sceneOG.RezzerID == m_host.ParentGroup.UUID)
@@ -2806,23 +2810,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2806 InitLSL(); 2810 InitLSL();
2807 // One needs to cast m_LSL_Api because we're using functions not 2811 // One needs to cast m_LSL_Api because we're using functions not
2808 // on the ILSL_Api interface. 2812 // on the ILSL_Api interface.
2809 LSL_Api LSL_Api = (LSL_Api)m_LSL_Api;
2810 LSL_List retVal = new LSL_List(); 2813 LSL_List retVal = new LSL_List();
2811 LSL_List remaining = new LSL_List(); 2814 LSL_List remaining = new LSL_List();
2812 List<SceneObjectPart> parts = LSL_Api.GetLinkParts(linknumber); 2815 List<SceneObjectPart> parts = m_LSL_Api.GetLinkParts(linknumber);
2813 foreach (SceneObjectPart part in parts) 2816 foreach (SceneObjectPart part in parts)
2814 { 2817 {
2815 remaining = LSL_Api.GetPrimParams(part, rules, ref retVal); 2818 remaining = m_LSL_Api.GetPrimParams(part, rules, ref retVal);
2816 } 2819 }
2817 2820
2818 while (remaining.Length > 2) 2821 while (remaining.Length > 2)
2819 { 2822 {
2820 linknumber = remaining.GetLSLIntegerItem(0); 2823 linknumber = remaining.GetLSLIntegerItem(0);
2821 rules = remaining.GetSublist(1, -1); 2824 rules = remaining.GetSublist(1, -1);
2822 parts = LSL_Api.GetLinkParts(linknumber); 2825 parts = m_LSL_Api.GetLinkParts(linknumber);
2823 2826
2824 foreach (SceneObjectPart part in parts) 2827 foreach (SceneObjectPart part in parts)
2825 remaining = LSL_Api.GetPrimParams(part, rules, ref retVal); 2828 remaining = m_LSL_Api.GetPrimParams(part, rules, ref retVal);
2826 } 2829 }
2827 return retVal; 2830 return retVal;
2828 } 2831 }
@@ -2832,7 +2835,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2832 CheckThreatLevel(ThreatLevel.VeryLow, "osForceCreateLink"); 2835 CheckThreatLevel(ThreatLevel.VeryLow, "osForceCreateLink");
2833 2836
2834 InitLSL(); 2837 InitLSL();
2835 ((LSL_Api)m_LSL_Api).CreateLink(target, parent); 2838 m_LSL_Api.CreateLink(target, parent);
2836 } 2839 }
2837 2840
2838 public void osForceBreakLink(int linknum) 2841 public void osForceBreakLink(int linknum)
@@ -2840,7 +2843,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2840 CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakLink"); 2843 CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakLink");
2841 2844
2842 InitLSL(); 2845 InitLSL();
2843 ((LSL_Api)m_LSL_Api).BreakLink(linknum); 2846 m_LSL_Api.BreakLink(linknum);
2844 } 2847 }
2845 2848
2846 public void osForceBreakAllLinks() 2849 public void osForceBreakAllLinks()
@@ -2848,7 +2851,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2848 CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakAllLinks"); 2851 CheckThreatLevel(ThreatLevel.VeryLow, "osForceBreakAllLinks");
2849 2852
2850 InitLSL(); 2853 InitLSL();
2851 ((LSL_Api)m_LSL_Api).BreakAllLinks(); 2854 m_LSL_Api.BreakAllLinks();
2852 } 2855 }
2853 2856
2854 public LSL_Integer osIsNpc(LSL_Key npc) 2857 public LSL_Integer osIsNpc(LSL_Key npc)
@@ -4029,7 +4032,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4029 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar"); 4032 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar");
4030 4033
4031 InitLSL(); 4034 InitLSL();
4032 ((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint); 4035 m_LSL_Api.AttachToAvatar(attachmentPoint);
4033 } 4036 }
4034 4037
4035 public void osForceAttachToAvatarFromInventory(string itemName, int attachmentPoint) 4038 public void osForceAttachToAvatarFromInventory(string itemName, int attachmentPoint)
@@ -4064,7 +4067,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4064 4067
4065 if (item == null) 4068 if (item == null)
4066 { 4069 {
4067 ((LSL_Api)m_LSL_Api).llSay(0, string.Format("Could not find object '{0}'", itemName)); 4070 m_LSL_Api.llSay(0, string.Format("Could not find object '{0}'", itemName));
4068 throw new Exception(String.Format("The inventory item '{0}' could not be found", itemName)); 4071 throw new Exception(String.Format("The inventory item '{0}' could not be found", itemName));
4069 } 4072 }
4070 4073
@@ -4073,7 +4076,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4073 // FIXME: Temporary null check for regression tests since they dont' have the infrastructure to set 4076 // FIXME: Temporary null check for regression tests since they dont' have the infrastructure to set
4074 // up the api reference. 4077 // up the api reference.
4075 if (m_LSL_Api != null) 4078 if (m_LSL_Api != null)
4076 ((LSL_Api)m_LSL_Api).llSay(0, string.Format("Unable to attach, item '{0}' is not an object.", itemName)); 4079 m_LSL_Api.llSay(0, string.Format("Unable to attach, item '{0}' is not an object.", itemName));
4077 4080
4078 throw new Exception(String.Format("The inventory item '{0}' is not an object", itemName)); 4081 throw new Exception(String.Format("The inventory item '{0}' is not an object", itemName));
4079 } 4082 }
@@ -4091,7 +4094,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4091 m_log.ErrorFormat( 4094 m_log.ErrorFormat(
4092 "[OSSL API]: Could not create user inventory item {0} for {1}, attach point {2} in {3}: {4}", 4095 "[OSSL API]: Could not create user inventory item {0} for {1}, attach point {2} in {3}: {4}",
4093 itemName, m_host.Name, attachmentPoint, World.Name, message); 4096 itemName, m_host.Name, attachmentPoint, World.Name, message);
4094 ((LSL_Api)m_LSL_Api).llSay(0, message); 4097 m_LSL_Api.llSay(0, message);
4095 return; 4098 return;
4096 } 4099 }
4097 4100
@@ -4103,7 +4106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4103 CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar"); 4106 CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar");
4104 4107
4105 InitLSL(); 4108 InitLSL();
4106 ((LSL_Api)m_LSL_Api).DetachFromAvatar(); 4109 m_LSL_Api.DetachFromAvatar();
4107 } 4110 }
4108 4111
4109 public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints) 4112 public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints)