diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
11 files changed, 413 insertions, 363 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index ae148a9..9f6ea35 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -81,6 +81,9 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
81 | 81 | ||
82 | void PostEvent(EventParams data); | 82 | void PostEvent(EventParams data); |
83 | 83 | ||
84 | void Suspend(); | ||
85 | void Resume(); | ||
86 | |||
84 | /// <summary> | 87 | /// <summary> |
85 | /// Process the next event queued for this script | 88 | /// Process the next event queued for this script |
86 | /// </summary> | 89 | /// </summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs index 4f1e9f7..3e62c1a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 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 | |||
28 | using System; | ||
2 | using System.Reflection; | 29 | using System.Reflection; |
3 | using System.Collections; | 30 | using System.Collections; |
4 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
@@ -7,7 +34,7 @@ using OpenMetaverse; | |||
7 | using Nini.Config; | 34 | using Nini.Config; |
8 | using OpenSim; | 35 | using OpenSim; |
9 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
10 | using OpenSim.Region.CoreModules.World.Meta7Windlight; | 37 | using OpenSim.Region.CoreModules.World.LightShare; |
11 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
12 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
13 | using OpenSim.Region.ScriptEngine.Shared; | 40 | using OpenSim.Region.ScriptEngine.Shared; |
@@ -92,7 +119,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
92 | public LSL_List cmGetAvatarList() | 119 | public LSL_List cmGetAvatarList() |
93 | { | 120 | { |
94 | LSL_List result = new LSL_List(); | 121 | LSL_List result = new LSL_List(); |
95 | foreach (ScenePresence avatar in World.GetAvatars()) | 122 | World.ForEachScenePresence(delegate (ScenePresence avatar) |
96 | { | 123 | { |
97 | if (avatar != null && avatar.UUID != m_host.OwnerID) | 124 | if (avatar != null && avatar.UUID != m_host.OwnerID) |
98 | { | 125 | { |
@@ -103,7 +130,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
103 | result.Add(avatar.Name); | 130 | result.Add(avatar.Name); |
104 | } | 131 | } |
105 | } | 132 | } |
106 | } | 133 | }); |
107 | return result; | 134 | return result; |
108 | } | 135 | } |
109 | 136 | ||
@@ -119,7 +146,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
119 | return new LSL_List(); | 146 | return new LSL_List(); |
120 | } | 147 | } |
121 | m_host.AddScriptLPS(1); | 148 | m_host.AddScriptLPS(1); |
122 | RegionMeta7WindlightData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings; | 149 | RegionLightShareData wl = m_host.ParentGroup.Scene.RegionInfo.WindlightSettings; |
123 | 150 | ||
124 | LSL_List values = new LSL_List(); | 151 | LSL_List values = new LSL_List(); |
125 | int idx = 0; | 152 | int idx = 0; |
@@ -253,9 +280,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
253 | 280 | ||
254 | } | 281 | } |
255 | 282 | ||
256 | private RegionMeta7WindlightData getWindlightProfileFromRules(LSL_List rules) | 283 | private RegionLightShareData getWindlightProfileFromRules(LSL_List rules) |
257 | { | 284 | { |
258 | RegionMeta7WindlightData wl = (RegionMeta7WindlightData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone(); | 285 | RegionLightShareData wl = (RegionLightShareData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone(); |
259 | 286 | ||
260 | LSL_List values = new LSL_List(); | 287 | LSL_List values = new LSL_List(); |
261 | int idx = 0; | 288 | int idx = 0; |
@@ -449,9 +476,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
449 | } | 476 | } |
450 | int success = 0; | 477 | int success = 0; |
451 | m_host.AddScriptLPS(1); | 478 | m_host.AddScriptLPS(1); |
452 | if (Meta7WindlightModule.EnableWindlight) | 479 | if (LightShareModule.EnableWindlight) |
453 | { | 480 | { |
454 | RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules); | 481 | RegionLightShareData wl = getWindlightProfileFromRules(rules); |
455 | m_host.ParentGroup.Scene.StoreWindlightProfile(wl); | 482 | m_host.ParentGroup.Scene.StoreWindlightProfile(wl); |
456 | success = 1; | 483 | success = 1; |
457 | } | 484 | } |
@@ -481,9 +508,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
481 | } | 508 | } |
482 | int success = 0; | 509 | int success = 0; |
483 | m_host.AddScriptLPS(1); | 510 | m_host.AddScriptLPS(1); |
484 | if (Meta7WindlightModule.EnableWindlight) | 511 | if (LightShareModule.EnableWindlight) |
485 | { | 512 | { |
486 | RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules); | 513 | RegionLightShareData wl = getWindlightProfileFromRules(rules); |
487 | World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string)); | 514 | World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string)); |
488 | success = 1; | 515 | success = 1; |
489 | } | 516 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 75dd615..68f6e7b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -39,7 +39,7 @@ using OpenMetaverse; | |||
39 | using OpenMetaverse.Packets; | 39 | using OpenMetaverse.Packets; |
40 | using OpenSim; | 40 | using OpenSim; |
41 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
42 | using OpenSim.Framework.Communications.Cache; | 42 | |
43 | using OpenSim.Region.CoreModules; | 43 | using OpenSim.Region.CoreModules; |
44 | using OpenSim.Region.CoreModules.World.Land; | 44 | using OpenSim.Region.CoreModules.World.Land; |
45 | using OpenSim.Region.CoreModules.World.Terrain; | 45 | using OpenSim.Region.CoreModules.World.Terrain; |
@@ -53,9 +53,9 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | |||
53 | using OpenSim.Region.ScriptEngine.Interfaces; | 53 | using OpenSim.Region.ScriptEngine.Interfaces; |
54 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; | 54 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; |
55 | using OpenSim.Services.Interfaces; | 55 | using OpenSim.Services.Interfaces; |
56 | |||
57 | using PrimType = OpenSim.Region.Framework.Scenes.PrimType; | ||
58 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 56 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
57 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | ||
58 | using PrimType = OpenSim.Region.Framework.Scenes.PrimType; | ||
59 | using AssetLandmark = OpenSim.Framework.AssetLandmark; | 59 | using AssetLandmark = OpenSim.Framework.AssetLandmark; |
60 | 60 | ||
61 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; | 61 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; |
@@ -917,10 +917,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
917 | public string resolveName(UUID objecUUID) | 917 | public string resolveName(UUID objecUUID) |
918 | { | 918 | { |
919 | // try avatar username surname | 919 | // try avatar username surname |
920 | CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID); | 920 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, objecUUID); |
921 | if (profile != null && profile.UserProfile != null) | 921 | if (account != null) |
922 | { | 922 | { |
923 | string avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName; | 923 | string avatarname = account.Name; |
924 | return avatarname; | 924 | return avatarname; |
925 | } | 925 | } |
926 | // try an scene object | 926 | // try an scene object |
@@ -2033,14 +2033,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2033 | float ground = World.GetGroundHeight((float)targetPos.x, (float)targetPos.y); | 2033 | float ground = World.GetGroundHeight((float)targetPos.x, (float)targetPos.y); |
2034 | bool disable_underground_movement = m_ScriptEngine.Config.GetBoolean("DisableUndergroundMovement", true); | 2034 | bool disable_underground_movement = m_ScriptEngine.Config.GetBoolean("DisableUndergroundMovement", true); |
2035 | 2035 | ||
2036 | if (part.ParentGroup == null) | 2036 | if (part.ParentGroup.RootPart == part) |
2037 | { | ||
2038 | if ((targetPos.z < ground) && disable_underground_movement) | ||
2039 | targetPos.z = ground; | ||
2040 | LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos); | ||
2041 | part.UpdateOffSet(new Vector3((float)real_vec.x, (float)real_vec.y, (float)real_vec.z)); | ||
2042 | } | ||
2043 | else if (part.ParentGroup.RootPart == part) | ||
2044 | { | 2037 | { |
2045 | if ((targetPos.z < ground) && disable_underground_movement) | 2038 | if ((targetPos.z < ground) && disable_underground_movement) |
2046 | targetPos.z = ground; | 2039 | targetPos.z = ground; |
@@ -2050,7 +2043,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2050 | } | 2043 | } |
2051 | else | 2044 | else |
2052 | { | 2045 | { |
2053 | //it's late... i think this is right ? | ||
2054 | if (llVecDist(new LSL_Vector(0,0,0), targetPos) <= 10.0f) | 2046 | if (llVecDist(new LSL_Vector(0,0,0), targetPos) <= 10.0f) |
2055 | { | 2047 | { |
2056 | part.OffsetPosition = new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z); | 2048 | part.OffsetPosition = new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z); |
@@ -3080,9 +3072,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3080 | 3072 | ||
3081 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | 3073 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); |
3082 | 3074 | ||
3083 | m_ScriptEngine.World.AttachObject(presence.ControllingClient, | 3075 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; |
3084 | grp.LocalId, (uint)attachment, Quaternion.Identity, | 3076 | if (attachmentsModule != null) |
3085 | Vector3.Zero, false); | 3077 | attachmentsModule.AttachObject( |
3078 | presence.ControllingClient, grp.LocalId, | ||
3079 | (uint)attachment, Quaternion.Identity, Vector3.Zero, false); | ||
3086 | } | 3080 | } |
3087 | } | 3081 | } |
3088 | 3082 | ||
@@ -3119,8 +3113,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3119 | 3113 | ||
3120 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | 3114 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); |
3121 | 3115 | ||
3122 | m_ScriptEngine.World.DetachSingleAttachmentToInv(itemID, | 3116 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; |
3123 | presence.ControllingClient); | 3117 | if (attachmentsModule != null) |
3118 | attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient); | ||
3124 | } | 3119 | } |
3125 | } | 3120 | } |
3126 | 3121 | ||
@@ -4002,9 +3997,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4002 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); | 3997 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); |
4003 | } | 3998 | } |
4004 | 3999 | ||
4005 | // check if destination is an avatar | 4000 | // check if destination is an object |
4006 | if (World.GetScenePresence(destId) != null) | 4001 | if (World.GetSceneObjectPart(destId) != null) |
4007 | { | 4002 | { |
4003 | // destination is an object | ||
4004 | World.MoveTaskInventoryItem(destId, m_host, objId); | ||
4005 | } | ||
4006 | else | ||
4007 | { | ||
4008 | ScenePresence presence = World.GetScenePresence(destId); | ||
4009 | |||
4010 | if (presence == null) | ||
4011 | { | ||
4012 | UserAccount account = | ||
4013 | World.UserAccountService.GetUserAccount( | ||
4014 | World.RegionInfo.ScopeID, | ||
4015 | destId); | ||
4016 | |||
4017 | if (account == null) | ||
4018 | { | ||
4019 | llSay(0, "Can't find destination "+destId.ToString()); | ||
4020 | return; | ||
4021 | } | ||
4022 | } | ||
4023 | |||
4008 | // destination is an avatar | 4024 | // destination is an avatar |
4009 | InventoryItemBase agentItem = | 4025 | InventoryItemBase agentItem = |
4010 | World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId); | 4026 | World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId); |
@@ -4034,12 +4050,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4034 | //This delay should only occur when giving inventory to avatars. | 4050 | //This delay should only occur when giving inventory to avatars. |
4035 | ScriptSleep(3000); | 4051 | ScriptSleep(3000); |
4036 | } | 4052 | } |
4037 | else | ||
4038 | { | ||
4039 | // destination is an object | ||
4040 | World.MoveTaskInventoryItem(destId, m_host, objId); | ||
4041 | } | ||
4042 | |||
4043 | } | 4053 | } |
4044 | 4054 | ||
4045 | [DebuggerNonUserCode] | 4055 | [DebuggerNonUserCode] |
@@ -4096,13 +4106,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4096 | 4106 | ||
4097 | UUID uuid = (UUID)id; | 4107 | UUID uuid = (UUID)id; |
4098 | 4108 | ||
4099 | UserProfileData userProfile = | 4109 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); |
4100 | World.CommsManager.UserService.GetUserProfile(uuid); | ||
4101 | 4110 | ||
4102 | UserAgentData userAgent = | 4111 | PresenceInfo pinfo = null; |
4103 | World.CommsManager.UserService.GetAgentByUUID(uuid); | 4112 | PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); |
4113 | if (pinfos != null && pinfos.Length > 0) | ||
4114 | pinfo = pinfos[0]; | ||
4104 | 4115 | ||
4105 | if (userProfile == null || userAgent == null) | 4116 | if (pinfo == null) |
4106 | return UUID.Zero.ToString(); | 4117 | return UUID.Zero.ToString(); |
4107 | 4118 | ||
4108 | string reply = String.Empty; | 4119 | string reply = String.Empty; |
@@ -4111,17 +4122,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4111 | { | 4122 | { |
4112 | case 1: // DATA_ONLINE (0|1) | 4123 | case 1: // DATA_ONLINE (0|1) |
4113 | // TODO: implement fetching of this information | 4124 | // TODO: implement fetching of this information |
4114 | if (userProfile.CurrentAgent!=null && userProfile.CurrentAgent.AgentOnline) | 4125 | if (pinfo != null) |
4115 | reply = "1"; | 4126 | reply = "1"; |
4116 | else | 4127 | else |
4117 | reply = "0"; | 4128 | reply = "0"; |
4118 | break; | 4129 | break; |
4119 | case 2: // DATA_NAME (First Last) | 4130 | case 2: // DATA_NAME (First Last) |
4120 | reply = userProfile.FirstName + " " + userProfile.SurName; | 4131 | reply = account.FirstName + " " + account.LastName; |
4121 | break; | 4132 | break; |
4122 | case 3: // DATA_BORN (YYYY-MM-DD) | 4133 | case 3: // DATA_BORN (YYYY-MM-DD) |
4123 | DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); | 4134 | DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); |
4124 | born = born.AddSeconds(userProfile.Created); | 4135 | born = born.AddSeconds(account.Created); |
4125 | reply = born.ToString("yyyy-MM-dd"); | 4136 | reply = born.ToString("yyyy-MM-dd"); |
4126 | break; | 4137 | break; |
4127 | case 4: // DATA_RATING (0,0,0,0,0,0) | 4138 | case 4: // DATA_RATING (0,0,0,0,0,0) |
@@ -4220,10 +4231,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4220 | ScriptSleep(5000); | 4231 | ScriptSleep(5000); |
4221 | } | 4232 | } |
4222 | 4233 | ||
4223 | public void llTextBox(string avatar, string message, int chat_channel) | 4234 | public void llTextBox(string agent, string message, int chatChannel) |
4224 | { | 4235 | { |
4236 | IDialogModule dm = World.RequestModuleInterface<IDialogModule>(); | ||
4237 | |||
4238 | if (dm == null) | ||
4239 | return; | ||
4240 | |||
4225 | m_host.AddScriptLPS(1); | 4241 | m_host.AddScriptLPS(1); |
4226 | NotImplemented("llTextBox"); | 4242 | UUID av = new UUID(); |
4243 | if (!UUID.TryParse(agent,out av)) | ||
4244 | { | ||
4245 | LSLError("First parameter to llDialog needs to be a key"); | ||
4246 | return; | ||
4247 | } | ||
4248 | |||
4249 | if (message == string.Empty) | ||
4250 | { | ||
4251 | ShoutError("Trying to use llTextBox with empty message."); | ||
4252 | } | ||
4253 | else if (message.Length > 512) | ||
4254 | { | ||
4255 | ShoutError("Trying to use llTextBox with message over 512 characters."); | ||
4256 | } | ||
4257 | else | ||
4258 | { | ||
4259 | dm.SendTextBoxToUser(av, message, chatChannel, m_host.Name, m_host.UUID, m_host.OwnerID); | ||
4260 | ScriptSleep(1000); | ||
4261 | } | ||
4227 | } | 4262 | } |
4228 | 4263 | ||
4229 | public void llModifyLand(int action, int brush) | 4264 | public void llModifyLand(int action, int brush) |
@@ -4238,6 +4273,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4238 | 4273 | ||
4239 | public void llCollisionSound(string impact_sound, double impact_volume) | 4274 | public void llCollisionSound(string impact_sound, double impact_volume) |
4240 | { | 4275 | { |
4276 | |||
4241 | m_host.AddScriptLPS(1); | 4277 | m_host.AddScriptLPS(1); |
4242 | // TODO: Parameter check logic required. | 4278 | // TODO: Parameter check logic required. |
4243 | UUID soundId = UUID.Zero; | 4279 | UUID soundId = UUID.Zero; |
@@ -5788,7 +5824,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5788 | public LSL_String llGetLandOwnerAt(LSL_Vector pos) | 5824 | public LSL_String llGetLandOwnerAt(LSL_Vector pos) |
5789 | { | 5825 | { |
5790 | m_host.AddScriptLPS(1); | 5826 | m_host.AddScriptLPS(1); |
5791 | return World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).LandData.OwnerID.ToString(); | 5827 | ILandObject land = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); |
5828 | if (land == null) | ||
5829 | return UUID.Zero.ToString(); | ||
5830 | return land.LandData.OwnerID.ToString(); | ||
5792 | } | 5831 | } |
5793 | 5832 | ||
5794 | /// <summary> | 5833 | /// <summary> |
@@ -9091,17 +9130,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9091 | landObject.SetMediaUrl(url); | 9130 | landObject.SetMediaUrl(url); |
9092 | 9131 | ||
9093 | // now send to all (non-child) agents | 9132 | // now send to all (non-child) agents |
9094 | List<ScenePresence> agents = World.GetAvatars(); | 9133 | World.ForEachScenePresence(delegate(ScenePresence sp) |
9095 | foreach (ScenePresence agent in agents) | ||
9096 | { | 9134 | { |
9097 | agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, | 9135 | if (!sp.IsChildAgent) |
9098 | landData.MediaID, | 9136 | { |
9099 | landData.MediaAutoScale, | 9137 | sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, |
9100 | mediaType, | 9138 | landData.MediaID, |
9101 | description, | 9139 | landData.MediaAutoScale, |
9102 | width, height, | 9140 | mediaType, |
9103 | loop); | 9141 | description, |
9104 | } | 9142 | width, height, |
9143 | loop); | ||
9144 | } | ||
9145 | }); | ||
9105 | } | 9146 | } |
9106 | else if (!presence.IsChildAgent) | 9147 | else if (!presence.IsChildAgent) |
9107 | { | 9148 | { |
@@ -9122,13 +9163,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9122 | if (presence == null) | 9163 | if (presence == null) |
9123 | { | 9164 | { |
9124 | // send to all (non-child) agents | 9165 | // send to all (non-child) agents |
9125 | List<ScenePresence> agents = World.GetAvatars(); | 9166 | World.ForEachScenePresence(delegate(ScenePresence sp) |
9126 | foreach (ScenePresence agent in agents) | ||
9127 | { | 9167 | { |
9128 | agent.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this? | 9168 | if (!sp.IsChildAgent) |
9129 | (ParcelMediaCommandEnum)commandToSend, | 9169 | { |
9130 | time); | 9170 | sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this? |
9131 | } | 9171 | (ParcelMediaCommandEnum)commandToSend, |
9172 | time); | ||
9173 | } | ||
9174 | }); | ||
9132 | } | 9175 | } |
9133 | else if (!presence.IsChildAgent) | 9176 | else if (!presence.IsChildAgent) |
9134 | { | 9177 | { |
@@ -10160,90 +10203,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10160 | 10203 | ||
10161 | Notecard nc = new Notecard(); | 10204 | Notecard nc = new Notecard(); |
10162 | nc.lastRef = DateTime.Now; | 10205 | nc.lastRef = DateTime.Now; |
10163 | nc.text = ParseText(text.Replace("\r", "").Split('\n')); | 10206 | nc.text = SLUtil.ParseNotecardToList(text).ToArray(); |
10164 | m_Notecards[assetID] = nc; | 10207 | m_Notecards[assetID] = nc; |
10165 | } | 10208 | } |
10166 | } | 10209 | } |
10167 | 10210 | ||
10168 | protected static string[] ParseText(string[] input) | ||
10169 | { | ||
10170 | int idx = 0; | ||
10171 | int level = 0; | ||
10172 | List<string> output = new List<string>(); | ||
10173 | string[] words; | ||
10174 | |||
10175 | while (idx < input.Length) | ||
10176 | { | ||
10177 | if (input[idx] == "{") | ||
10178 | { | ||
10179 | level++; | ||
10180 | idx++; | ||
10181 | continue; | ||
10182 | } | ||
10183 | |||
10184 | if (input[idx]== "}") | ||
10185 | { | ||
10186 | level--; | ||
10187 | idx++; | ||
10188 | continue; | ||
10189 | } | ||
10190 | |||
10191 | switch (level) | ||
10192 | { | ||
10193 | case 0: | ||
10194 | words = input[idx].Split(' '); // Linden text ver | ||
10195 | // Notecards are created *really* empty. Treat that as "no text" (just like after saving an empty notecard) | ||
10196 | if (words.Length < 3) | ||
10197 | return new String[0]; | ||
10198 | |||
10199 | int version = int.Parse(words[3]); | ||
10200 | if (version != 2) | ||
10201 | return new String[0]; | ||
10202 | break; | ||
10203 | case 1: | ||
10204 | words = input[idx].Split(' '); | ||
10205 | if (words[0] == "LLEmbeddedItems") | ||
10206 | break; | ||
10207 | if (words[0] == "Text") | ||
10208 | { | ||
10209 | int len = int.Parse(words[2]); | ||
10210 | idx++; | ||
10211 | |||
10212 | int count = -1; | ||
10213 | |||
10214 | while (count < len) | ||
10215 | { | ||
10216 | // int l = input[idx].Length; | ||
10217 | string ln = input[idx]; | ||
10218 | |||
10219 | int need = len-count-1; | ||
10220 | if (ln.Length > need) | ||
10221 | ln = ln.Substring(0, need); | ||
10222 | |||
10223 | output.Add(ln); | ||
10224 | count += ln.Length + 1; | ||
10225 | idx++; | ||
10226 | } | ||
10227 | |||
10228 | return output.ToArray(); | ||
10229 | } | ||
10230 | break; | ||
10231 | case 2: | ||
10232 | words = input[idx].Split(' '); // count | ||
10233 | if (words[0] == "count") | ||
10234 | { | ||
10235 | int c = int.Parse(words[1]); | ||
10236 | if (c > 0) | ||
10237 | return new String[0]; | ||
10238 | break; | ||
10239 | } | ||
10240 | break; | ||
10241 | } | ||
10242 | idx++; | ||
10243 | } | ||
10244 | return output.ToArray(); | ||
10245 | } | ||
10246 | |||
10247 | public static bool IsCached(UUID assetID) | 10211 | public static bool IsCached(UUID assetID) |
10248 | { | 10212 | { |
10249 | lock (m_Notecards) | 10213 | lock (m_Notecards) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 1ddba1e..9474bab 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -36,12 +36,11 @@ using OpenMetaverse; | |||
36 | using Nini.Config; | 36 | using Nini.Config; |
37 | using OpenSim; | 37 | using OpenSim; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications.Cache; | 39 | |
40 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
41 | using OpenSim.Region.CoreModules.Avatar.NPC; | 41 | using OpenSim.Region.CoreModules.Avatar.NPC; |
42 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
44 | using OpenSim.Region.Framework.Scenes.Hypergrid; | ||
45 | using OpenSim.Region.ScriptEngine.Shared; | 44 | using OpenSim.Region.ScriptEngine.Shared; |
46 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | 45 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; |
47 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 46 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
@@ -607,21 +606,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
607 | // and convert the regionName to the target region | 606 | // and convert the regionName to the target region |
608 | if (regionName.Contains(".") && regionName.Contains(":")) | 607 | if (regionName.Contains(".") && regionName.Contains(":")) |
609 | { | 608 | { |
609 | List<GridRegion> regions = World.GridService.GetRegionsByName(World.RegionInfo.ScopeID, regionName, 1); | ||
610 | // Try to link the region | 610 | // Try to link the region |
611 | IHyperlinkService hyperService = World.RequestModuleInterface<IHyperlinkService>(); | 611 | if (regions != null && regions.Count > 0) |
612 | if (hyperService != null) | ||
613 | { | 612 | { |
614 | GridRegion regInfo = hyperService.TryLinkRegion(presence.ControllingClient, | 613 | GridRegion regInfo = regions[0]; |
615 | regionName); | 614 | regionName = regInfo.RegionName; |
616 | // Get the region name | ||
617 | if (regInfo != null) | ||
618 | { | ||
619 | regionName = regInfo.RegionName; | ||
620 | } | ||
621 | else | ||
622 | { | ||
623 | // Might need to ping the client here in case of failure?? | ||
624 | } | ||
625 | } | 615 | } |
626 | } | 616 | } |
627 | presence.ControllingClient.SendTeleportLocationStart(); | 617 | presence.ControllingClient.SendTeleportLocationStart(); |
@@ -707,10 +697,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
707 | CheckThreatLevel(ThreatLevel.None, "osGetAgents"); | 697 | CheckThreatLevel(ThreatLevel.None, "osGetAgents"); |
708 | 698 | ||
709 | LSL_List result = new LSL_List(); | 699 | LSL_List result = new LSL_List(); |
710 | foreach (ScenePresence avatar in World.GetAvatars()) | 700 | World.ForEachScenePresence(delegate(ScenePresence sp) |
711 | { | 701 | { |
712 | result.Add(avatar.Name); | 702 | if (!sp.IsChildAgent) |
713 | } | 703 | result.Add(sp.Name); |
704 | }); | ||
714 | return result; | 705 | return result; |
715 | } | 706 | } |
716 | 707 | ||
@@ -1482,7 +1473,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1482 | m_host.AddScriptLPS(1); | 1473 | m_host.AddScriptLPS(1); |
1483 | 1474 | ||
1484 | // Create new asset | 1475 | // Create new asset |
1485 | AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard); | 1476 | AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString()); |
1486 | asset.Description = "Script Generated Notecard"; | 1477 | asset.Description = "Script Generated Notecard"; |
1487 | string notecardData = String.Empty; | 1478 | string notecardData = String.Empty; |
1488 | 1479 | ||
@@ -1695,15 +1686,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1695 | { | 1686 | { |
1696 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); | 1687 | CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); |
1697 | 1688 | ||
1698 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(firstname, lastname); | 1689 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, firstname, lastname); |
1699 | 1690 | if (null == account) | |
1700 | if (null == userInfo) | ||
1701 | { | 1691 | { |
1702 | return UUID.Zero.ToString(); | 1692 | return UUID.Zero.ToString(); |
1703 | } | 1693 | } |
1704 | else | 1694 | else |
1705 | { | 1695 | { |
1706 | return userInfo.UserProfile.ID.ToString(); | 1696 | return account.PrincipalID.ToString(); |
1707 | } | 1697 | } |
1708 | } | 1698 | } |
1709 | 1699 | ||
@@ -1714,15 +1704,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1714 | 1704 | ||
1715 | if (UUID.TryParse(id, out key)) | 1705 | if (UUID.TryParse(id, out key)) |
1716 | { | 1706 | { |
1717 | CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(key); | 1707 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, key); |
1718 | 1708 | if (null == account) | |
1719 | if (null == userInfo) | ||
1720 | { | 1709 | { |
1721 | return ""; | 1710 | return ""; |
1722 | } | 1711 | } |
1723 | else | 1712 | else |
1724 | { | 1713 | { |
1725 | return userInfo.UserProfile.Name; | 1714 | return account.Name; |
1726 | } | 1715 | } |
1727 | } | 1716 | } |
1728 | else | 1717 | else |
@@ -2001,19 +1990,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2001 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 1990 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); |
2002 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | 1991 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) |
2003 | { | 1992 | { |
2004 | foreach (ScenePresence presence in World.GetAvatars()) | 1993 | World.ForEachScenePresence(delegate(ScenePresence sp) |
2005 | { | 1994 | { |
2006 | if ((presence.Firstname == FirstName) && | 1995 | if (!sp.IsChildAgent && |
2007 | presence.Lastname == SurName) | 1996 | sp.Firstname == FirstName && |
1997 | sp.Lastname == SurName) | ||
2008 | { | 1998 | { |
2009 | // kick client... | 1999 | // kick client... |
2010 | if (alert != null) | 2000 | if (alert != null) |
2011 | presence.ControllingClient.Kick(alert); | 2001 | sp.ControllingClient.Kick(alert); |
2012 | 2002 | ||
2013 | // ...and close on our side | 2003 | // ...and close on our side |
2014 | presence.Scene.IncomingCloseAgent(presence.UUID); | 2004 | sp.Scene.IncomingCloseAgent(sp.UUID); |
2015 | } | 2005 | } |
2016 | } | 2006 | }); |
2017 | } | 2007 | } |
2018 | } | 2008 | } |
2019 | 2009 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index b75a2e4..a5b1124 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Communications.Cache; | 32 | |
33 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
34 | using OpenSim.Region.ScriptEngine.Shared; | 34 | using OpenSim.Region.ScriptEngine.Shared; |
35 | using OpenSim.Region.ScriptEngine.Shared.Api; | 35 | using OpenSim.Region.ScriptEngine.Shared.Api; |
@@ -204,7 +204,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
204 | // Is the sensor type is AGENT and not SCRIPTED then include agents | 204 | // Is the sensor type is AGENT and not SCRIPTED then include agents |
205 | if ((ts.type & AGENT) != 0 && (ts.type & SCRIPTED) == 0) | 205 | if ((ts.type & AGENT) != 0 && (ts.type & SCRIPTED) == 0) |
206 | { | 206 | { |
207 | sensedEntities.AddRange(doAgentSensor(ts)); | 207 | sensedEntities.AddRange(doAgentSensor(ts)); |
208 | } | 208 | } |
209 | 209 | ||
210 | // If SCRIPTED or PASSIVE or ACTIVE check objects | 210 | // If SCRIPTED or PASSIVE or ACTIVE check objects |
@@ -302,6 +302,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
302 | float dz; | 302 | float dz; |
303 | 303 | ||
304 | Quaternion q = SensePoint.RotationOffset; | 304 | Quaternion q = SensePoint.RotationOffset; |
305 | if (SensePoint.ParentGroup.RootPart.IsAttachment) | ||
306 | { | ||
307 | // In attachments, the sensor cone always orients with the | ||
308 | // avatar rotation. This may include a nonzero elevation if | ||
309 | // in mouselook. | ||
310 | |||
311 | ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar); | ||
312 | fromRegionPos = avatar.AbsolutePosition; | ||
313 | q = avatar.Rotation; | ||
314 | } | ||
305 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); | 315 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); |
306 | LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); | 316 | LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); |
307 | double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); | 317 | double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); |
@@ -404,70 +414,50 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
404 | 414 | ||
405 | private List<SensedEntity> doAgentSensor(SenseRepeatClass ts) | 415 | private List<SensedEntity> doAgentSensor(SenseRepeatClass ts) |
406 | { | 416 | { |
407 | List<ScenePresence> presences; | ||
408 | List<SensedEntity> sensedEntities = new List<SensedEntity>(); | 417 | List<SensedEntity> sensedEntities = new List<SensedEntity>(); |
409 | 418 | ||
410 | // If this is an avatar sense by key try to get them directly | ||
411 | // rather than getting a list to scan through | ||
412 | if (ts.keyID != UUID.Zero) | ||
413 | { | ||
414 | ScenePresence p = m_CmdManager.m_ScriptEngine.World.GetScenePresence(ts.keyID); | ||
415 | if (p == null) | ||
416 | return sensedEntities; | ||
417 | presences = new List<ScenePresence>(); | ||
418 | presences.Add(p); | ||
419 | } | ||
420 | else | ||
421 | { | ||
422 | presences = new List<ScenePresence>(m_CmdManager.m_ScriptEngine.World.GetScenePresences()); | ||
423 | } | ||
424 | |||
425 | // If nobody about quit fast | 419 | // If nobody about quit fast |
426 | if (presences.Count == 0) | 420 | if(m_CmdManager.m_ScriptEngine.World.GetRootAgentCount() == 0) |
427 | return sensedEntities; | 421 | return sensedEntities; |
428 | 422 | ||
429 | SceneObjectPart SensePoint = ts.host; | 423 | SceneObjectPart SensePoint = ts.host; |
430 | |||
431 | Vector3 fromRegionPos = SensePoint.AbsolutePosition; | 424 | Vector3 fromRegionPos = SensePoint.AbsolutePosition; |
432 | |||
433 | Quaternion q = SensePoint.RotationOffset; | 425 | Quaternion q = SensePoint.RotationOffset; |
426 | if (SensePoint.ParentGroup.RootPart.IsAttachment) | ||
427 | { | ||
428 | // In attachments, the sensor cone always orients with the | ||
429 | // avatar rotation. This may include a nonzero elevation if | ||
430 | // in mouselook. | ||
431 | |||
432 | ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar); | ||
433 | fromRegionPos = avatar.AbsolutePosition; | ||
434 | q = avatar.Rotation; | ||
435 | } | ||
434 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); | 436 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); |
435 | LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); | 437 | LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); |
436 | double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); | 438 | double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); |
437 | |||
438 | bool attached = (SensePoint.AttachmentPoint != 0); | 439 | bool attached = (SensePoint.AttachmentPoint != 0); |
439 | bool nameSearch = (ts.name != null && ts.name != ""); | ||
440 | Vector3 toRegionPos; | 440 | Vector3 toRegionPos; |
441 | double dis; | 441 | double dis; |
442 | 442 | ||
443 | for (int i = 0; i < presences.Count; i++) | 443 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) |
444 | { | 444 | { |
445 | ScenePresence presence = presences[i]; | 445 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) |
446 | bool keep = true; | 446 | return; |
447 | |||
448 | // if the object the script is in is attached and the avatar is the owner | ||
449 | // then this one is not wanted | ||
450 | if (attached && presence.UUID == SensePoint.OwnerID) | ||
451 | return; | ||
447 | 452 | ||
448 | if (presence.IsDeleted) | ||
449 | continue; | ||
450 | |||
451 | if (presence.IsChildAgent) | ||
452 | keep = false; | ||
453 | toRegionPos = presence.AbsolutePosition; | 453 | toRegionPos = presence.AbsolutePosition; |
454 | |||
455 | dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos)); | 454 | dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos)); |
456 | 455 | ||
457 | // are they in range | 456 | // are they in range |
458 | if (keep && dis <= ts.range) | 457 | if (dis <= ts.range) |
459 | { | 458 | { |
460 | // if the object the script is in is attached and the avatar is the owner | ||
461 | // then this one is not wanted | ||
462 | if (attached && presence.UUID == SensePoint.OwnerID) | ||
463 | keep = false; | ||
464 | |||
465 | // check the name if needed | ||
466 | if (keep && nameSearch && ts.name != presence.Name) | ||
467 | keep = false; | ||
468 | |||
469 | // Are they in the required angle of view | 459 | // Are they in the required angle of view |
470 | if (keep && ts.arc < Math.PI) | 460 | if (ts.arc < Math.PI) |
471 | { | 461 | { |
472 | // not omni-directional. Can you see it ? | 462 | // not omni-directional. Can you see it ? |
473 | // vec forward_dir = llRot2Fwd(llGetRot()) | 463 | // vec forward_dir = llRot2Fwd(llGetRot()) |
@@ -488,26 +478,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
488 | catch | 478 | catch |
489 | { | 479 | { |
490 | } | 480 | } |
491 | if (ang_obj > ts.arc) keep = false; | 481 | if (ang_obj <= ts.arc) |
482 | { | ||
483 | sensedEntities.Add(new SensedEntity(dis, presence.UUID)); | ||
484 | } | ||
485 | } | ||
486 | else | ||
487 | { | ||
488 | sensedEntities.Add(new SensedEntity(dis, presence.UUID)); | ||
492 | } | 489 | } |
493 | } | 490 | } |
494 | else | 491 | }); |
495 | { | ||
496 | keep = false; | ||
497 | } | ||
498 | |||
499 | // Do not report gods, not even minor ones | ||
500 | if (keep && presence.GodLevel > 0.0) | ||
501 | keep = false; | ||
502 | |||
503 | if (keep) // add to list with distance | ||
504 | { | ||
505 | sensedEntities.Add(new SensedEntity(dis, presence.UUID)); | ||
506 | } | ||
507 | 492 | ||
508 | // If this is a search by name and we have just found it then no more to do | 493 | // If this is an avatar sense by key try to get them directly |
509 | if (nameSearch && ts.name == presence.Name) | 494 | // rather than getting a list to scan through |
495 | if (ts.keyID != UUID.Zero) | ||
496 | { | ||
497 | ScenePresence sp; | ||
498 | // Try direct lookup by UUID | ||
499 | if(!m_CmdManager.m_ScriptEngine.World.TryGetScenePresence(ts.keyID, out sp)) | ||
510 | return sensedEntities; | 500 | return sensedEntities; |
501 | senseEntity(sp); | ||
502 | } | ||
503 | else if (ts.name != null && ts.name != "") | ||
504 | { | ||
505 | ScenePresence sp; | ||
506 | // Try lookup by name will return if/when found | ||
507 | if (!m_CmdManager.m_ScriptEngine.World.TryGetAvatarByName(ts.name, out sp)) | ||
508 | return sensedEntities; | ||
509 | senseEntity(sp); | ||
510 | } | ||
511 | else | ||
512 | { | ||
513 | m_CmdManager.m_ScriptEngine.World.ForEachScenePresence(senseEntity); | ||
511 | } | 514 | } |
512 | return sensedEntities; | 515 | return sensedEntities; |
513 | } | 516 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs index 6239726..fba27f9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System.Collections; | 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 | |||
28 | using System.Collections; | ||
2 | using OpenSim.Region.ScriptEngine.Interfaces; | 29 | using OpenSim.Region.ScriptEngine.Interfaces; |
3 | 30 | ||
4 | using key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; | 31 | using key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Constants.cs index 522c020..f94ef4a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Constants.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
70 | public const int WL_CLOUD_SCROLL_Y = 32; | 70 | public const int WL_CLOUD_SCROLL_Y = 32; |
71 | public const int WL_CLOUD_SCROLL_Y_LOCK = 33; | 71 | public const int WL_CLOUD_SCROLL_Y_LOCK = 33; |
72 | public const int WL_CLOUD_SCROLL_X_LOCK = 34; | 72 | public const int WL_CLOUD_SCROLL_X_LOCK = 34; |
73 | public const int WL_DRAW_CLASSIC_CLOUDS = 35; | 73 | public const int WL_DRAW_CLASSIC_CLOUDS = 35; |
74 | public const int WL_SUN_MOON_POSITION = 36; | 74 | public const int WL_SUN_MOON_POSITION = 36; |
75 | 75 | ||
76 | } | 76 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index b3e4740..96f6486 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -549,5 +549,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
549 | public const int STATS_ACTIVE_SCRIPTS = 19; | 549 | public const int STATS_ACTIVE_SCRIPTS = 19; |
550 | public const int STATS_SCRIPT_LPS = 20; | 550 | public const int STATS_SCRIPT_LPS = 20; |
551 | 551 | ||
552 | public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED"; | ||
553 | public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED"; | ||
552 | } | 554 | } |
553 | } | 555 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index d8c0ba5..f719683 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -261,13 +261,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
261 | // } | 261 | // } |
262 | //} | 262 | //} |
263 | 263 | ||
264 | public object GetCompilerOutput(UUID assetID) | 264 | public string GetCompilerOutput(string assetID) |
265 | { | 265 | { |
266 | return Path.Combine(ScriptEnginesPath, Path.Combine( | 266 | return Path.Combine(ScriptEnginesPath, Path.Combine( |
267 | m_scriptEngine.World.RegionInfo.RegionID.ToString(), | 267 | m_scriptEngine.World.RegionInfo.RegionID.ToString(), |
268 | FilePrefix + "_compiled_" + assetID + ".dll")); | 268 | FilePrefix + "_compiled_" + assetID + ".dll")); |
269 | } | 269 | } |
270 | 270 | ||
271 | public string GetCompilerOutput(UUID assetID) | ||
272 | { | ||
273 | return GetCompilerOutput(assetID.ToString()); | ||
274 | } | ||
275 | |||
271 | /// <summary> | 276 | /// <summary> |
272 | /// Converts script from LSL to CS and calls CompileFromCSText | 277 | /// Converts script from LSL to CS and calls CompileFromCSText |
273 | /// </summary> | 278 | /// </summary> |
@@ -279,9 +284,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
279 | linemap = null; | 284 | linemap = null; |
280 | m_warnings.Clear(); | 285 | m_warnings.Clear(); |
281 | 286 | ||
282 | assembly = Path.Combine(ScriptEnginesPath, Path.Combine( | 287 | assembly = GetCompilerOutput(asset); |
283 | m_scriptEngine.World.RegionInfo.RegionID.ToString(), | ||
284 | FilePrefix + "_compiled_" + asset + ".dll")); | ||
285 | 288 | ||
286 | if (!Directory.Exists(ScriptEnginesPath)) | 289 | if (!Directory.Exists(ScriptEnginesPath)) |
287 | { | 290 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 6ecafd4..b348403 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -96,6 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
96 | private bool m_startedFromSavedState; | 96 | private bool m_startedFromSavedState; |
97 | private UUID m_CurrentStateHash; | 97 | private UUID m_CurrentStateHash; |
98 | private UUID m_RegionID; | 98 | private UUID m_RegionID; |
99 | private bool m_Suspended = false; | ||
99 | 100 | ||
100 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> | 101 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> |
101 | m_LineMap; | 102 | m_LineMap; |
@@ -640,158 +641,160 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
640 | /// <returns></returns> | 641 | /// <returns></returns> |
641 | public object EventProcessor() | 642 | public object EventProcessor() |
642 | { | 643 | { |
644 | EventParams data = null; | ||
643 | 645 | ||
644 | EventParams data = null; | 646 | lock (m_EventQueue) |
645 | |||
646 | lock (m_EventQueue) | ||
647 | { | ||
648 | lock (m_Script) | ||
649 | { | 647 | { |
650 | data = (EventParams) m_EventQueue.Dequeue(); | 648 | if (m_Suspended) |
651 | if (data == null) // Shouldn't happen | 649 | return 0; |
650 | |||
651 | lock (m_Script) | ||
652 | { | 652 | { |
653 | if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) | 653 | data = (EventParams) m_EventQueue.Dequeue(); |
654 | if (data == null) // Shouldn't happen | ||
654 | { | 655 | { |
655 | m_CurrentResult = m_Engine.QueueEventHandler(this); | 656 | if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) |
657 | { | ||
658 | m_CurrentResult = m_Engine.QueueEventHandler(this); | ||
659 | } | ||
660 | else | ||
661 | { | ||
662 | m_CurrentResult = null; | ||
663 | } | ||
664 | return 0; | ||
656 | } | 665 | } |
657 | else | 666 | |
667 | if (data.EventName == "timer") | ||
668 | m_TimerQueued = false; | ||
669 | if (data.EventName == "control") | ||
658 | { | 670 | { |
659 | m_CurrentResult = null; | 671 | if (m_ControlEventsInQueue > 0) |
672 | m_ControlEventsInQueue--; | ||
660 | } | 673 | } |
661 | return 0; | 674 | if (data.EventName == "collision") |
662 | } | 675 | m_CollisionInQueue = false; |
663 | |||
664 | if (data.EventName == "timer") | ||
665 | m_TimerQueued = false; | ||
666 | if (data.EventName == "control") | ||
667 | { | ||
668 | if (m_ControlEventsInQueue > 0) | ||
669 | m_ControlEventsInQueue--; | ||
670 | } | 676 | } |
671 | if (data.EventName == "collision") | ||
672 | m_CollisionInQueue = false; | ||
673 | } | 677 | } |
674 | } | 678 | lock(m_Script) |
675 | lock(m_Script) | 679 | { |
676 | { | 680 | |
677 | 681 | //m_log.DebugFormat("[XENGINE]: Processing event {0} for {1}", data.EventName, this); | |
678 | //m_log.DebugFormat("[XENGINE]: Processing event {0} for {1}", data.EventName, this); | ||
679 | 682 | ||
680 | m_DetectParams = data.DetectParams; | 683 | m_DetectParams = data.DetectParams; |
681 | 684 | ||
682 | if (data.EventName == "state") // Hardcoded state change | 685 | if (data.EventName == "state") // Hardcoded state change |
683 | { | ||
684 | // m_log.DebugFormat("[Script] Script {0}.{1} state set to {2}", | ||
685 | // m_PrimName, m_ScriptName, data.Params[0].ToString()); | ||
686 | m_State=data.Params[0].ToString(); | ||
687 | AsyncCommandManager.RemoveScript(m_Engine, | ||
688 | m_LocalID, m_ItemID); | ||
689 | |||
690 | SceneObjectPart part = m_Engine.World.GetSceneObjectPart( | ||
691 | m_LocalID); | ||
692 | if (part != null) | ||
693 | { | ||
694 | part.SetScriptEvents(m_ItemID, | ||
695 | (int)m_Script.GetStateEventFlags(State)); | ||
696 | } | ||
697 | } | ||
698 | else | ||
699 | { | ||
700 | if (m_Engine.World.PipeEventsForScript(m_LocalID) || | ||
701 | data.EventName == "control") // Don't freeze avies! | ||
702 | { | 686 | { |
687 | // m_log.DebugFormat("[Script] Script {0}.{1} state set to {2}", | ||
688 | // m_PrimName, m_ScriptName, data.Params[0].ToString()); | ||
689 | m_State=data.Params[0].ToString(); | ||
690 | AsyncCommandManager.RemoveScript(m_Engine, | ||
691 | m_LocalID, m_ItemID); | ||
692 | |||
703 | SceneObjectPart part = m_Engine.World.GetSceneObjectPart( | 693 | SceneObjectPart part = m_Engine.World.GetSceneObjectPart( |
704 | m_LocalID); | 694 | m_LocalID); |
705 | // m_log.DebugFormat("[Script] Delivered event {2} in state {3} to {0}.{1}", | 695 | if (part != null) |
706 | // m_PrimName, m_ScriptName, data.EventName, m_State); | 696 | { |
707 | 697 | part.SetScriptEvents(m_ItemID, | |
708 | try | 698 | (int)m_Script.GetStateEventFlags(State)); |
699 | } | ||
700 | } | ||
701 | else | ||
702 | { | ||
703 | if (m_Engine.World.PipeEventsForScript(m_LocalID) || | ||
704 | data.EventName == "control") // Don't freeze avies! | ||
709 | { | 705 | { |
710 | m_CurrentEvent = data.EventName; | 706 | SceneObjectPart part = m_Engine.World.GetSceneObjectPart( |
711 | m_EventStart = DateTime.Now; | 707 | m_LocalID); |
712 | m_InEvent = true; | 708 | // m_log.DebugFormat("[Script] Delivered event {2} in state {3} to {0}.{1}", |
709 | // m_PrimName, m_ScriptName, data.EventName, m_State); | ||
713 | 710 | ||
714 | m_Script.ExecuteEvent(State, data.EventName, data.Params); | 711 | try |
712 | { | ||
713 | m_CurrentEvent = data.EventName; | ||
714 | m_EventStart = DateTime.Now; | ||
715 | m_InEvent = true; | ||
715 | 716 | ||
716 | m_InEvent = false; | 717 | m_Script.ExecuteEvent(State, data.EventName, data.Params); |
717 | m_CurrentEvent = String.Empty; | ||
718 | 718 | ||
719 | if (m_SaveState) | 719 | m_InEvent = false; |
720 | { | 720 | m_CurrentEvent = String.Empty; |
721 | // This will be the very first event we deliver | ||
722 | // (state_entry) in default state | ||
723 | // | ||
724 | 721 | ||
725 | SaveState(m_Assembly); | 722 | if (m_SaveState) |
723 | { | ||
724 | // This will be the very first event we deliver | ||
725 | // (state_entry) in default state | ||
726 | // | ||
726 | 727 | ||
727 | m_SaveState = false; | 728 | SaveState(m_Assembly); |
728 | } | ||
729 | } | ||
730 | catch (Exception e) | ||
731 | { | ||
732 | // m_log.DebugFormat("[SCRIPT] Exception: {0}", e.Message); | ||
733 | m_InEvent = false; | ||
734 | m_CurrentEvent = String.Empty; | ||
735 | 729 | ||
736 | if ((!(e is TargetInvocationException) || (!(e.InnerException is SelfDeleteException) && !(e.InnerException is ScriptDeleteException))) && !(e is ThreadAbortException)) | 730 | m_SaveState = false; |
731 | } | ||
732 | } | ||
733 | catch (Exception e) | ||
737 | { | 734 | { |
738 | try | 735 | // m_log.DebugFormat("[SCRIPT] Exception: {0}", e.Message); |
736 | m_InEvent = false; | ||
737 | m_CurrentEvent = String.Empty; | ||
738 | |||
739 | if ((!(e is TargetInvocationException) || (!(e.InnerException is SelfDeleteException) && !(e.InnerException is ScriptDeleteException))) && !(e is ThreadAbortException)) | ||
739 | { | 740 | { |
740 | // DISPLAY ERROR INWORLD | 741 | try |
741 | string text = FormatException(e); | 742 | { |
742 | 743 | // DISPLAY ERROR INWORLD | |
743 | if (text.Length > 1000) | 744 | string text = FormatException(e); |
744 | text = text.Substring(0, 1000); | 745 | |
745 | m_Engine.World.SimChat(Utils.StringToBytes(text), | 746 | if (text.Length > 1000) |
746 | ChatTypeEnum.DebugChannel, 2147483647, | 747 | text = text.Substring(0, 1000); |
747 | part.AbsolutePosition, | 748 | m_Engine.World.SimChat(Utils.StringToBytes(text), |
748 | part.Name, part.UUID, false); | 749 | ChatTypeEnum.DebugChannel, 2147483647, |
750 | part.AbsolutePosition, | ||
751 | part.Name, part.UUID, false); | ||
752 | } | ||
753 | catch (Exception) | ||
754 | { | ||
755 | } | ||
756 | // catch (Exception e2) // LEGIT: User Scripting | ||
757 | // { | ||
758 | // m_log.Error("[SCRIPT]: "+ | ||
759 | // "Error displaying error in-world: " + | ||
760 | // e2.ToString()); | ||
761 | // m_log.Error("[SCRIPT]: " + | ||
762 | // "Errormessage: Error compiling script:\r\n" + | ||
763 | // e.ToString()); | ||
764 | // } | ||
749 | } | 765 | } |
750 | catch (Exception) | 766 | else if ((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) |
751 | { | 767 | { |
768 | m_InSelfDelete = true; | ||
769 | if (part != null && part.ParentGroup != null) | ||
770 | m_Engine.World.DeleteSceneObject(part.ParentGroup, false); | ||
771 | } | ||
772 | else if ((e is TargetInvocationException) && (e.InnerException is ScriptDeleteException)) | ||
773 | { | ||
774 | m_InSelfDelete = true; | ||
775 | if (part != null && part.ParentGroup != null) | ||
776 | part.Inventory.RemoveInventoryItem(m_ItemID); | ||
752 | } | 777 | } |
753 | // catch (Exception e2) // LEGIT: User Scripting | ||
754 | // { | ||
755 | // m_log.Error("[SCRIPT]: "+ | ||
756 | // "Error displaying error in-world: " + | ||
757 | // e2.ToString()); | ||
758 | // m_log.Error("[SCRIPT]: " + | ||
759 | // "Errormessage: Error compiling script:\r\n" + | ||
760 | // e.ToString()); | ||
761 | // } | ||
762 | } | ||
763 | else if ((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) | ||
764 | { | ||
765 | m_InSelfDelete = true; | ||
766 | if (part != null && part.ParentGroup != null) | ||
767 | m_Engine.World.DeleteSceneObject(part.ParentGroup, false); | ||
768 | } | ||
769 | else if ((e is TargetInvocationException) && (e.InnerException is ScriptDeleteException)) | ||
770 | { | ||
771 | m_InSelfDelete = true; | ||
772 | if (part != null && part.ParentGroup != null) | ||
773 | part.Inventory.RemoveInventoryItem(m_ItemID); | ||
774 | } | 778 | } |
775 | } | 779 | } |
776 | } | 780 | } |
777 | } | ||
778 | 781 | ||
779 | lock (m_EventQueue) | 782 | lock (m_EventQueue) |
780 | { | ||
781 | if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) | ||
782 | { | ||
783 | m_CurrentResult = m_Engine.QueueEventHandler(this); | ||
784 | } | ||
785 | else | ||
786 | { | 783 | { |
787 | m_CurrentResult = null; | 784 | if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) |
785 | { | ||
786 | m_CurrentResult = m_Engine.QueueEventHandler(this); | ||
787 | } | ||
788 | else | ||
789 | { | ||
790 | m_CurrentResult = null; | ||
791 | } | ||
788 | } | 792 | } |
789 | } | ||
790 | 793 | ||
791 | m_DetectParams = null; | 794 | m_DetectParams = null; |
792 | 795 | ||
793 | return 0; | 796 | return 0; |
794 | } | 797 | } |
795 | } | 798 | } |
796 | 799 | ||
797 | public int EventTime() | 800 | public int EventTime() |
@@ -1018,5 +1021,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1018 | { | 1021 | { |
1019 | get { return m_RegionID; } | 1022 | get { return m_RegionID; } |
1020 | } | 1023 | } |
1024 | |||
1025 | public void Suspend() | ||
1026 | { | ||
1027 | m_Suspended = true; | ||
1028 | } | ||
1029 | |||
1030 | public void Resume() | ||
1031 | { | ||
1032 | m_Suspended = false; | ||
1033 | } | ||
1021 | } | 1034 | } |
1022 | } | 1035 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 35d57d8..463b052 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1570,5 +1570,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1570 | return new ArrayList(); | 1570 | return new ArrayList(); |
1571 | } | 1571 | } |
1572 | } | 1572 | } |
1573 | |||
1574 | public void SuspendScript(UUID itemID) | ||
1575 | { | ||
1576 | IScriptInstance instance = GetInstance(itemID); | ||
1577 | if (instance == null) | ||
1578 | return; | ||
1579 | |||
1580 | instance.Suspend(); | ||
1581 | } | ||
1582 | |||
1583 | public void ResumeScript(UUID itemID) | ||
1584 | { | ||
1585 | IScriptInstance instance = GetInstance(itemID); | ||
1586 | if (instance == null) | ||
1587 | return; | ||
1588 | |||
1589 | instance.Resume(); | ||
1590 | } | ||
1573 | } | 1591 | } |
1574 | } | 1592 | } |