diff options
author | BlueWall | 2012-04-26 16:13:47 -0400 |
---|---|---|
committer | BlueWall | 2012-04-26 16:13:47 -0400 |
commit | fba802bb03b7dee804059eae888b63c88280389c (patch) | |
tree | ca7312919830dd469dfd4e9b739d5291702007e4 /OpenSim/Region/ScriptEngine | |
parent | Add a version of osNpcSay that takes a channel number Mantis 5747 (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-fba802bb03b7dee804059eae888b63c88280389c.zip opensim-SC_OLD-fba802bb03b7dee804059eae888b63c88280389c.tar.gz opensim-SC_OLD-fba802bb03b7dee804059eae888b63c88280389c.tar.bz2 opensim-SC_OLD-fba802bb03b7dee804059eae888b63c88280389c.tar.xz |
Merge branch 'master' of /home/opensim/var/repo/opensim
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
7 files changed, 227 insertions, 276 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs index 47ed6ba..684138f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/ApiManager.cs | |||
@@ -29,42 +29,43 @@ using System; | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using log4net; | ||
32 | using OpenSim.Region.ScriptEngine.Interfaces; | 33 | using OpenSim.Region.ScriptEngine.Interfaces; |
33 | 34 | ||
34 | namespace OpenSim.Region.ScriptEngine.Shared.Api | 35 | namespace OpenSim.Region.ScriptEngine.Shared.Api |
35 | { | 36 | { |
36 | public class ApiManager | 37 | public class ApiManager |
37 | { | 38 | { |
39 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
40 | |||
38 | private Dictionary<string,Type> m_Apis = new Dictionary<string,Type>(); | 41 | private Dictionary<string,Type> m_Apis = new Dictionary<string,Type>(); |
39 | 42 | ||
40 | public string[] GetApis() | 43 | public string[] GetApis() |
41 | { | 44 | { |
42 | if (m_Apis.Count > 0) | 45 | if (m_Apis.Count <= 0) |
43 | { | 46 | { |
44 | List<string> l = new List<string>(m_Apis.Keys); | 47 | Assembly a = Assembly.GetExecutingAssembly(); |
45 | return l.ToArray(); | ||
46 | } | ||
47 | 48 | ||
48 | Assembly a = Assembly.GetExecutingAssembly(); | 49 | Type[] types = a.GetExportedTypes(); |
49 | 50 | ||
50 | Type[] types = a.GetExportedTypes(); | 51 | foreach (Type t in types) |
51 | |||
52 | foreach (Type t in types) | ||
53 | { | ||
54 | string name = t.ToString(); | ||
55 | int idx = name.LastIndexOf('.'); | ||
56 | if (idx != -1) | ||
57 | name = name.Substring(idx+1); | ||
58 | |||
59 | if (name.EndsWith("_Api")) | ||
60 | { | 52 | { |
61 | name = name.Substring(0, name.Length - 4); | 53 | string name = t.ToString(); |
62 | m_Apis[name] = t; | 54 | int idx = name.LastIndexOf('.'); |
55 | if (idx != -1) | ||
56 | name = name.Substring(idx+1); | ||
57 | |||
58 | if (name.EndsWith("_Api")) | ||
59 | { | ||
60 | name = name.Substring(0, name.Length - 4); | ||
61 | m_Apis[name] = t; | ||
62 | } | ||
63 | } | 63 | } |
64 | } | 64 | } |
65 | 65 | ||
66 | List<string> ret = new List<string>(m_Apis.Keys); | 66 | // m_log.DebugFormat("[API MANAGER]: Found {0} apis", m_Apis.Keys.Count); |
67 | return ret.ToArray(); | 67 | |
68 | return new List<string>(m_Apis.Keys).ToArray(); | ||
68 | } | 69 | } |
69 | 70 | ||
70 | public IScriptApi CreateApi(string api) | 71 | public IScriptApi CreateApi(string api) |
@@ -76,4 +77,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
76 | return ret; | 77 | return ret; |
77 | } | 78 | } |
78 | } | 79 | } |
79 | } | 80 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a2176ba..d641958 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -85,7 +85,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
85 | protected IScriptEngine m_ScriptEngine; | 85 | protected IScriptEngine m_ScriptEngine; |
86 | protected SceneObjectPart m_host; | 86 | protected SceneObjectPart m_host; |
87 | protected uint m_localID; | 87 | protected uint m_localID; |
88 | |||
89 | /// <summary> | ||
90 | /// The UUID of the item that hosts this script | ||
91 | /// </summary> | ||
88 | protected UUID m_itemID; | 92 | protected UUID m_itemID; |
93 | |||
89 | protected bool throwErrorOnNotImplemented = true; | 94 | protected bool throwErrorOnNotImplemented = true; |
90 | protected AsyncCommandManager AsyncCommands = null; | 95 | protected AsyncCommandManager AsyncCommands = null; |
91 | protected float m_ScriptDelayFactor = 1.0f; | 96 | protected float m_ScriptDelayFactor = 1.0f; |
@@ -267,23 +272,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
267 | } | 272 | } |
268 | } | 273 | } |
269 | 274 | ||
270 | protected UUID InventorySelf() | 275 | /// <summary> |
276 | /// Get the inventory item that hosts ourselves. | ||
277 | /// </summary> | ||
278 | /// <remarks> | ||
279 | /// FIXME: It would be far easier to pass in TaskInventoryItem rather than just m_itemID so that we don't need | ||
280 | /// to keep looking ourselves up. | ||
281 | /// </remarks> | ||
282 | /// <returns></returns> | ||
283 | protected TaskInventoryItem GetSelfInventoryItem() | ||
271 | { | 284 | { |
272 | UUID invItemID = new UUID(); | ||
273 | |||
274 | lock (m_host.TaskInventory) | 285 | lock (m_host.TaskInventory) |
275 | { | 286 | return m_host.TaskInventory[m_itemID]; |
276 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) | ||
277 | { | ||
278 | if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID) | ||
279 | { | ||
280 | invItemID = inv.Key; | ||
281 | break; | ||
282 | } | ||
283 | } | ||
284 | } | ||
285 | |||
286 | return invItemID; | ||
287 | } | 287 | } |
288 | 288 | ||
289 | protected UUID InventoryKey(string name, int type) | 289 | protected UUID InventoryKey(string name, int type) |
@@ -832,8 +832,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
832 | 832 | ||
833 | public void llRegionSayTo(string target, int channel, string msg) | 833 | public void llRegionSayTo(string target, int channel, string msg) |
834 | { | 834 | { |
835 | string error = String.Empty; | ||
836 | |||
837 | if (msg.Length > 1023) | 835 | if (msg.Length > 1023) |
838 | msg = msg.Substring(0, 1023); | 836 | msg = msg.Substring(0, 1023); |
839 | 837 | ||
@@ -2701,18 +2699,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2701 | 2699 | ||
2702 | public LSL_Integer llGiveMoney(string destination, int amount) | 2700 | public LSL_Integer llGiveMoney(string destination, int amount) |
2703 | { | 2701 | { |
2704 | UUID invItemID=InventorySelf(); | ||
2705 | if (invItemID == UUID.Zero) | ||
2706 | return 0; | ||
2707 | |||
2708 | m_host.AddScriptLPS(1); | 2702 | m_host.AddScriptLPS(1); |
2709 | 2703 | ||
2710 | TaskInventoryItem item = m_host.TaskInventory[invItemID]; | 2704 | TaskInventoryItem item = GetSelfInventoryItem(); |
2711 | |||
2712 | lock (m_host.TaskInventory) | ||
2713 | { | ||
2714 | item = m_host.TaskInventory[invItemID]; | ||
2715 | } | ||
2716 | 2705 | ||
2717 | if (item.PermsGranter == UUID.Zero) | 2706 | if (item.PermsGranter == UUID.Zero) |
2718 | return 0; | 2707 | return 0; |
@@ -2955,15 +2944,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2955 | 2944 | ||
2956 | public void llTakeControls(int controls, int accept, int pass_on) | 2945 | public void llTakeControls(int controls, int accept, int pass_on) |
2957 | { | 2946 | { |
2958 | TaskInventoryItem item; | 2947 | TaskInventoryItem item = GetSelfInventoryItem(); |
2959 | |||
2960 | lock (m_host.TaskInventory) | ||
2961 | { | ||
2962 | if (!m_host.TaskInventory.ContainsKey(InventorySelf())) | ||
2963 | return; | ||
2964 | else | ||
2965 | item = m_host.TaskInventory[InventorySelf()]; | ||
2966 | } | ||
2967 | 2948 | ||
2968 | if (item.PermsGranter != UUID.Zero) | 2949 | if (item.PermsGranter != UUID.Zero) |
2969 | { | 2950 | { |
@@ -2983,18 +2964,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2983 | 2964 | ||
2984 | public void llReleaseControls() | 2965 | public void llReleaseControls() |
2985 | { | 2966 | { |
2986 | TaskInventoryItem item; | ||
2987 | |||
2988 | lock (m_host.TaskInventory) | ||
2989 | { | ||
2990 | if (!m_host.TaskInventory.ContainsKey(InventorySelf())) | ||
2991 | return; | ||
2992 | else | ||
2993 | item = m_host.TaskInventory[InventorySelf()]; | ||
2994 | } | ||
2995 | |||
2996 | m_host.AddScriptLPS(1); | 2967 | m_host.AddScriptLPS(1); |
2997 | 2968 | ||
2969 | TaskInventoryItem item = GetSelfInventoryItem(); | ||
2970 | |||
2998 | if (item.PermsGranter != UUID.Zero) | 2971 | if (item.PermsGranter != UUID.Zero) |
2999 | { | 2972 | { |
3000 | ScenePresence presence = World.GetScenePresence(item.PermsGranter); | 2973 | ScenePresence presence = World.GetScenePresence(item.PermsGranter); |
@@ -3019,36 +2992,62 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3019 | m_UrlModule.ReleaseURL(url); | 2992 | m_UrlModule.ReleaseURL(url); |
3020 | } | 2993 | } |
3021 | 2994 | ||
3022 | public void llAttachToAvatar(int attachment) | 2995 | /// <summary> |
2996 | /// Attach the object containing this script to the avatar that owns it. | ||
2997 | /// </summary> | ||
2998 | /// <param name='attachment'>The attachment point (e.g. ATTACH_CHEST)</param> | ||
2999 | /// <returns>true if the attach suceeded, false if it did not</returns> | ||
3000 | public bool AttachToAvatar(int attachmentPoint) | ||
3001 | { | ||
3002 | SceneObjectGroup grp = m_host.ParentGroup; | ||
3003 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | ||
3004 | |||
3005 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | ||
3006 | |||
3007 | if (attachmentsModule != null) | ||
3008 | return attachmentsModule.AttachObject(presence, grp, (uint)attachmentPoint, false); | ||
3009 | else | ||
3010 | return false; | ||
3011 | } | ||
3012 | |||
3013 | /// <summary> | ||
3014 | /// Detach the object containing this script from the avatar it is attached to. | ||
3015 | /// </summary> | ||
3016 | /// <remarks> | ||
3017 | /// Nothing happens if the object is not attached. | ||
3018 | /// </remarks> | ||
3019 | public void DetachFromAvatar() | ||
3020 | { | ||
3021 | Util.FireAndForget(DetachWrapper, m_host); | ||
3022 | } | ||
3023 | |||
3024 | private void DetachWrapper(object o) | ||
3025 | { | ||
3026 | SceneObjectPart host = (SceneObjectPart)o; | ||
3027 | |||
3028 | SceneObjectGroup grp = host.ParentGroup; | ||
3029 | UUID itemID = grp.FromItemID; | ||
3030 | ScenePresence presence = World.GetScenePresence(host.OwnerID); | ||
3031 | |||
3032 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | ||
3033 | if (attachmentsModule != null) | ||
3034 | attachmentsModule.DetachSingleAttachmentToInv(presence, itemID); | ||
3035 | } | ||
3036 | |||
3037 | public void llAttachToAvatar(int attachmentPoint) | ||
3023 | { | 3038 | { |
3024 | m_host.AddScriptLPS(1); | 3039 | m_host.AddScriptLPS(1); |
3025 | 3040 | ||
3026 | // if (m_host.ParentGroup.RootPart.AttachmentPoint == 0) | 3041 | // if (m_host.ParentGroup.RootPart.AttachmentPoint == 0) |
3027 | // return; | 3042 | // return; |
3028 | 3043 | ||
3029 | TaskInventoryItem item; | 3044 | TaskInventoryItem item = GetSelfInventoryItem(); |
3030 | |||
3031 | lock (m_host.TaskInventory) | ||
3032 | { | ||
3033 | if (!m_host.TaskInventory.ContainsKey(InventorySelf())) | ||
3034 | return; | ||
3035 | else | ||
3036 | item = m_host.TaskInventory[InventorySelf()]; | ||
3037 | } | ||
3038 | 3045 | ||
3039 | if (item.PermsGranter != m_host.OwnerID) | 3046 | if (item.PermsGranter != m_host.OwnerID) |
3040 | return; | 3047 | return; |
3041 | 3048 | ||
3042 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0) | 3049 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0) |
3043 | { | 3050 | AttachToAvatar(attachmentPoint); |
3044 | SceneObjectGroup grp = m_host.ParentGroup; | ||
3045 | |||
3046 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | ||
3047 | |||
3048 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | ||
3049 | if (attachmentsModule != null) | ||
3050 | attachmentsModule.AttachObject(presence, grp, (uint)attachment, false); | ||
3051 | } | ||
3052 | } | 3051 | } |
3053 | 3052 | ||
3054 | public void llDetachFromAvatar() | 3053 | public void llDetachFromAvatar() |
@@ -3058,38 +3057,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3058 | if (m_host.ParentGroup.AttachmentPoint == 0) | 3057 | if (m_host.ParentGroup.AttachmentPoint == 0) |
3059 | return; | 3058 | return; |
3060 | 3059 | ||
3061 | TaskInventoryItem item; | 3060 | TaskInventoryItem item = GetSelfInventoryItem(); |
3062 | |||
3063 | lock (m_host.TaskInventory) | ||
3064 | { | ||
3065 | if (!m_host.TaskInventory.ContainsKey(InventorySelf())) | ||
3066 | return; | ||
3067 | else | ||
3068 | item = m_host.TaskInventory[InventorySelf()]; | ||
3069 | } | ||
3070 | 3061 | ||
3071 | if (item.PermsGranter != m_host.OwnerID) | 3062 | if (item.PermsGranter != m_host.OwnerID) |
3072 | return; | 3063 | return; |
3073 | 3064 | ||
3074 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0) | 3065 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0) |
3075 | { | 3066 | DetachFromAvatar(); |
3076 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | ||
3077 | if (attachmentsModule != null) | ||
3078 | Util.FireAndForget(DetachWrapper, m_host); | ||
3079 | } | ||
3080 | } | ||
3081 | |||
3082 | private void DetachWrapper(object o) | ||
3083 | { | ||
3084 | SceneObjectPart host = (SceneObjectPart)o; | ||
3085 | |||
3086 | SceneObjectGroup grp = host.ParentGroup; | ||
3087 | UUID itemID = grp.FromItemID; | ||
3088 | ScenePresence presence = World.GetScenePresence(host.OwnerID); | ||
3089 | |||
3090 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | ||
3091 | if (attachmentsModule != null) | ||
3092 | attachmentsModule.DetachSingleAttachmentToInv(presence, itemID); | ||
3093 | } | 3067 | } |
3094 | 3068 | ||
3095 | public void llTakeCamera(string avatar) | 3069 | public void llTakeCamera(string avatar) |
@@ -3317,19 +3291,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3317 | { | 3291 | { |
3318 | m_host.AddScriptLPS(1); | 3292 | m_host.AddScriptLPS(1); |
3319 | 3293 | ||
3320 | UUID invItemID = InventorySelf(); | 3294 | TaskInventoryItem item = GetSelfInventoryItem(); |
3321 | if (invItemID == UUID.Zero) | ||
3322 | return; | ||
3323 | |||
3324 | TaskInventoryItem item; | ||
3325 | |||
3326 | lock (m_host.TaskInventory) | ||
3327 | { | ||
3328 | if (!m_host.TaskInventory.ContainsKey(InventorySelf())) | ||
3329 | return; | ||
3330 | else | ||
3331 | item = m_host.TaskInventory[InventorySelf()]; | ||
3332 | } | ||
3333 | 3295 | ||
3334 | if (item.PermsGranter == UUID.Zero) | 3296 | if (item.PermsGranter == UUID.Zero) |
3335 | return; | 3297 | return; |
@@ -3354,19 +3316,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3354 | { | 3316 | { |
3355 | m_host.AddScriptLPS(1); | 3317 | m_host.AddScriptLPS(1); |
3356 | 3318 | ||
3357 | UUID invItemID=InventorySelf(); | 3319 | TaskInventoryItem item = GetSelfInventoryItem(); |
3358 | if (invItemID == UUID.Zero) | ||
3359 | return; | ||
3360 | |||
3361 | TaskInventoryItem item; | ||
3362 | |||
3363 | lock (m_host.TaskInventory) | ||
3364 | { | ||
3365 | if (!m_host.TaskInventory.ContainsKey(InventorySelf())) | ||
3366 | return; | ||
3367 | else | ||
3368 | item = m_host.TaskInventory[InventorySelf()]; | ||
3369 | } | ||
3370 | 3320 | ||
3371 | if (item.PermsGranter == UUID.Zero) | 3321 | if (item.PermsGranter == UUID.Zero) |
3372 | return; | 3322 | return; |
@@ -3421,22 +3371,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3421 | 3371 | ||
3422 | public void llRequestPermissions(string agent, int perm) | 3372 | public void llRequestPermissions(string agent, int perm) |
3423 | { | 3373 | { |
3424 | UUID agentID = new UUID(); | 3374 | UUID agentID; |
3425 | 3375 | ||
3426 | if (!UUID.TryParse(agent, out agentID)) | 3376 | if (!UUID.TryParse(agent, out agentID)) |
3427 | return; | 3377 | return; |
3428 | 3378 | ||
3429 | UUID invItemID = InventorySelf(); | 3379 | TaskInventoryItem item = GetSelfInventoryItem(); |
3430 | |||
3431 | if (invItemID == UUID.Zero) | ||
3432 | return; // Not in a prim? How?? | ||
3433 | |||
3434 | TaskInventoryItem item; | ||
3435 | |||
3436 | lock (m_host.TaskInventory) | ||
3437 | { | ||
3438 | item = m_host.TaskInventory[invItemID]; | ||
3439 | } | ||
3440 | 3380 | ||
3441 | if (agentID == UUID.Zero || perm == 0) // Releasing permissions | 3381 | if (agentID == UUID.Zero || perm == 0) // Releasing permissions |
3442 | { | 3382 | { |
@@ -3470,8 +3410,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3470 | { | 3410 | { |
3471 | lock (m_host.TaskInventory) | 3411 | lock (m_host.TaskInventory) |
3472 | { | 3412 | { |
3473 | m_host.TaskInventory[invItemID].PermsGranter = agentID; | 3413 | m_host.TaskInventory[m_itemID].PermsGranter = agentID; |
3474 | m_host.TaskInventory[invItemID].PermsMask = perm; | 3414 | m_host.TaskInventory[m_itemID].PermsMask = perm; |
3475 | } | 3415 | } |
3476 | 3416 | ||
3477 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( | 3417 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( |
@@ -3494,8 +3434,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3494 | { | 3434 | { |
3495 | lock (m_host.TaskInventory) | 3435 | lock (m_host.TaskInventory) |
3496 | { | 3436 | { |
3497 | m_host.TaskInventory[invItemID].PermsGranter = agentID; | 3437 | m_host.TaskInventory[m_itemID].PermsGranter = agentID; |
3498 | m_host.TaskInventory[invItemID].PermsMask = perm; | 3438 | m_host.TaskInventory[m_itemID].PermsMask = perm; |
3499 | } | 3439 | } |
3500 | 3440 | ||
3501 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( | 3441 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( |
@@ -3519,8 +3459,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3519 | { | 3459 | { |
3520 | lock (m_host.TaskInventory) | 3460 | lock (m_host.TaskInventory) |
3521 | { | 3461 | { |
3522 | m_host.TaskInventory[invItemID].PermsGranter = agentID; | 3462 | m_host.TaskInventory[m_itemID].PermsGranter = agentID; |
3523 | m_host.TaskInventory[invItemID].PermsMask = 0; | 3463 | m_host.TaskInventory[m_itemID].PermsMask = 0; |
3524 | } | 3464 | } |
3525 | 3465 | ||
3526 | presence.ControllingClient.OnScriptAnswer += handleScriptAnswer; | 3466 | presence.ControllingClient.OnScriptAnswer += handleScriptAnswer; |
@@ -3528,7 +3468,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3528 | } | 3468 | } |
3529 | 3469 | ||
3530 | presence.ControllingClient.SendScriptQuestion( | 3470 | presence.ControllingClient.SendScriptQuestion( |
3531 | m_host.UUID, m_host.ParentGroup.RootPart.Name, ownerName, invItemID, perm); | 3471 | m_host.UUID, m_host.ParentGroup.RootPart.Name, ownerName, m_itemID, perm); |
3532 | 3472 | ||
3533 | return; | 3473 | return; |
3534 | } | 3474 | } |
@@ -3545,20 +3485,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3545 | if (taskID != m_host.UUID) | 3485 | if (taskID != m_host.UUID) |
3546 | return; | 3486 | return; |
3547 | 3487 | ||
3548 | UUID invItemID = InventorySelf(); | 3488 | client.OnScriptAnswer -= handleScriptAnswer; |
3549 | 3489 | m_waitingForScriptAnswer = false; | |
3550 | if (invItemID == UUID.Zero) | ||
3551 | return; | ||
3552 | |||
3553 | client.OnScriptAnswer-=handleScriptAnswer; | ||
3554 | m_waitingForScriptAnswer=false; | ||
3555 | 3490 | ||
3556 | if ((answer & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) == 0) | 3491 | if ((answer & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) == 0) |
3557 | llReleaseControls(); | 3492 | llReleaseControls(); |
3558 | 3493 | ||
3559 | lock (m_host.TaskInventory) | 3494 | lock (m_host.TaskInventory) |
3560 | { | 3495 | { |
3561 | m_host.TaskInventory[invItemID].PermsMask = answer; | 3496 | m_host.TaskInventory[m_itemID].PermsMask = answer; |
3562 | } | 3497 | } |
3563 | 3498 | ||
3564 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( | 3499 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( |
@@ -3571,39 +3506,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3571 | { | 3506 | { |
3572 | m_host.AddScriptLPS(1); | 3507 | m_host.AddScriptLPS(1); |
3573 | 3508 | ||
3574 | lock (m_host.TaskInventory) | 3509 | return GetSelfInventoryItem().PermsGranter.ToString(); |
3575 | { | ||
3576 | foreach (TaskInventoryItem item in m_host.TaskInventory.Values) | ||
3577 | { | ||
3578 | if (item.Type == 10 && item.ItemID == m_itemID) | ||
3579 | { | ||
3580 | return item.PermsGranter.ToString(); | ||
3581 | } | ||
3582 | } | ||
3583 | } | ||
3584 | |||
3585 | return UUID.Zero.ToString(); | ||
3586 | } | 3510 | } |
3587 | 3511 | ||
3588 | public LSL_Integer llGetPermissions() | 3512 | public LSL_Integer llGetPermissions() |
3589 | { | 3513 | { |
3590 | m_host.AddScriptLPS(1); | 3514 | m_host.AddScriptLPS(1); |
3591 | 3515 | ||
3592 | lock (m_host.TaskInventory) | 3516 | int perms = GetSelfInventoryItem().PermsMask; |
3593 | { | ||
3594 | foreach (TaskInventoryItem item in m_host.TaskInventory.Values) | ||
3595 | { | ||
3596 | if (item.Type == 10 && item.ItemID == m_itemID) | ||
3597 | { | ||
3598 | int perms = item.PermsMask; | ||
3599 | if (m_automaticLinkPermission) | ||
3600 | perms |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; | ||
3601 | return perms; | ||
3602 | } | ||
3603 | } | ||
3604 | } | ||
3605 | 3517 | ||
3606 | return 0; | 3518 | if (m_automaticLinkPermission) |
3519 | perms |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; | ||
3520 | |||
3521 | return perms; | ||
3607 | } | 3522 | } |
3608 | 3523 | ||
3609 | public LSL_Integer llGetLinkNumber() | 3524 | public LSL_Integer llGetLinkNumber() |
@@ -3631,17 +3546,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3631 | public void llCreateLink(string target, int parent) | 3546 | public void llCreateLink(string target, int parent) |
3632 | { | 3547 | { |
3633 | m_host.AddScriptLPS(1); | 3548 | m_host.AddScriptLPS(1); |
3634 | UUID invItemID = InventorySelf(); | ||
3635 | UUID targetID; | 3549 | UUID targetID; |
3636 | 3550 | ||
3637 | if (!UUID.TryParse(target, out targetID)) | 3551 | if (!UUID.TryParse(target, out targetID)) |
3638 | return; | 3552 | return; |
3639 | 3553 | ||
3640 | TaskInventoryItem item; | 3554 | TaskInventoryItem item = GetSelfInventoryItem(); |
3641 | lock (m_host.TaskInventory) | ||
3642 | { | ||
3643 | item = m_host.TaskInventory[invItemID]; | ||
3644 | } | ||
3645 | 3555 | ||
3646 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 | 3556 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 |
3647 | && !m_automaticLinkPermission) | 3557 | && !m_automaticLinkPermission) |
@@ -3659,11 +3569,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3659 | 3569 | ||
3660 | if (targetPart.ParentGroup.AttachmentPoint != 0) | 3570 | if (targetPart.ParentGroup.AttachmentPoint != 0) |
3661 | return; // Fail silently if attached | 3571 | return; // Fail silently if attached |
3572 | |||
3573 | if (targetPart.ParentGroup.RootPart.OwnerID != m_host.ParentGroup.RootPart.OwnerID) | ||
3574 | return; | ||
3575 | |||
3662 | SceneObjectGroup parentPrim = null, childPrim = null; | 3576 | SceneObjectGroup parentPrim = null, childPrim = null; |
3663 | 3577 | ||
3664 | if (targetPart != null) | 3578 | if (targetPart != null) |
3665 | { | 3579 | { |
3666 | if (parent != 0) { | 3580 | if (parent != 0) |
3581 | { | ||
3667 | parentPrim = m_host.ParentGroup; | 3582 | parentPrim = m_host.ParentGroup; |
3668 | childPrim = targetPart.ParentGroup; | 3583 | childPrim = targetPart.ParentGroup; |
3669 | } | 3584 | } |
@@ -3675,7 +3590,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3675 | 3590 | ||
3676 | // Required for linking | 3591 | // Required for linking |
3677 | childPrim.RootPart.ClearUpdateSchedule(); | 3592 | childPrim.RootPart.ClearUpdateSchedule(); |
3678 | parentPrim.LinkToGroup(childPrim); | 3593 | parentPrim.LinkToGroup(childPrim, true); |
3679 | } | 3594 | } |
3680 | 3595 | ||
3681 | parentPrim.TriggerScriptChangedEvent(Changed.LINK); | 3596 | parentPrim.TriggerScriptChangedEvent(Changed.LINK); |
@@ -3692,16 +3607,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3692 | public void llBreakLink(int linknum) | 3607 | public void llBreakLink(int linknum) |
3693 | { | 3608 | { |
3694 | m_host.AddScriptLPS(1); | 3609 | m_host.AddScriptLPS(1); |
3695 | UUID invItemID = InventorySelf(); | ||
3696 | 3610 | ||
3697 | lock (m_host.TaskInventory) | 3611 | if ((GetSelfInventoryItem().PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 |
3612 | && !m_automaticLinkPermission) | ||
3698 | { | 3613 | { |
3699 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0 | 3614 | ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); |
3700 | && !m_automaticLinkPermission) | 3615 | return; |
3701 | { | ||
3702 | ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); | ||
3703 | return; | ||
3704 | } | ||
3705 | } | 3616 | } |
3706 | 3617 | ||
3707 | if (linknum < ScriptBaseClass.LINK_THIS) | 3618 | if (linknum < ScriptBaseClass.LINK_THIS) |
@@ -4578,23 +4489,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4578 | 4489 | ||
4579 | public LSL_String llGetScriptName() | 4490 | public LSL_String llGetScriptName() |
4580 | { | 4491 | { |
4581 | string result = String.Empty; | ||
4582 | |||
4583 | m_host.AddScriptLPS(1); | 4492 | m_host.AddScriptLPS(1); |
4584 | 4493 | ||
4585 | lock (m_host.TaskInventory) | 4494 | TaskInventoryItem item = GetSelfInventoryItem(); |
4586 | { | ||
4587 | foreach (TaskInventoryItem item in m_host.TaskInventory.Values) | ||
4588 | { | ||
4589 | if (item.Type == 10 && item.ItemID == m_itemID) | ||
4590 | { | ||
4591 | result = item.Name != null ? item.Name : String.Empty; | ||
4592 | break; | ||
4593 | } | ||
4594 | } | ||
4595 | } | ||
4596 | 4495 | ||
4597 | return result; | 4496 | return item.Name != null ? item.Name : String.Empty; |
4598 | } | 4497 | } |
4599 | 4498 | ||
4600 | public LSL_Integer llGetLinkNumberOfSides(int link) | 4499 | public LSL_Integer llGetLinkNumberOfSides(int link) |
@@ -9695,21 +9594,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9695 | public LSL_Vector llGetCameraPos() | 9594 | public LSL_Vector llGetCameraPos() |
9696 | { | 9595 | { |
9697 | m_host.AddScriptLPS(1); | 9596 | m_host.AddScriptLPS(1); |
9698 | UUID invItemID = InventorySelf(); | ||
9699 | 9597 | ||
9700 | if (invItemID == UUID.Zero) | 9598 | TaskInventoryItem item = GetSelfInventoryItem(); |
9701 | return new LSL_Vector(); | ||
9702 | 9599 | ||
9703 | lock (m_host.TaskInventory) | 9600 | if (item.PermsGranter == UUID.Zero) |
9704 | { | 9601 | return new LSL_Vector(); |
9705 | if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) | ||
9706 | return new LSL_Vector(); | ||
9707 | 9602 | ||
9708 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) | 9603 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) |
9709 | { | 9604 | { |
9710 | ShoutError("No permissions to track the camera"); | 9605 | ShoutError("No permissions to track the camera"); |
9711 | return new LSL_Vector(); | 9606 | return new LSL_Vector(); |
9712 | } | ||
9713 | } | 9607 | } |
9714 | 9608 | ||
9715 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | 9609 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); |
@@ -9724,20 +9618,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9724 | public LSL_Rotation llGetCameraRot() | 9618 | public LSL_Rotation llGetCameraRot() |
9725 | { | 9619 | { |
9726 | m_host.AddScriptLPS(1); | 9620 | m_host.AddScriptLPS(1); |
9727 | UUID invItemID = InventorySelf(); | ||
9728 | if (invItemID == UUID.Zero) | ||
9729 | return new LSL_Rotation(); | ||
9730 | 9621 | ||
9731 | lock (m_host.TaskInventory) | 9622 | TaskInventoryItem item = GetSelfInventoryItem(); |
9732 | { | ||
9733 | if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) | ||
9734 | return new LSL_Rotation(); | ||
9735 | 9623 | ||
9736 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) | 9624 | if (item.PermsGranter == UUID.Zero) |
9737 | { | 9625 | return new LSL_Rotation(); |
9738 | ShoutError("No permissions to track the camera"); | 9626 | |
9739 | return new LSL_Rotation(); | 9627 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0) |
9740 | } | 9628 | { |
9629 | ShoutError("No permissions to track the camera"); | ||
9630 | return new LSL_Rotation(); | ||
9741 | } | 9631 | } |
9742 | 9632 | ||
9743 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | 9633 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); |
@@ -9911,23 +9801,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9911 | { | 9801 | { |
9912 | m_host.AddScriptLPS(1); | 9802 | m_host.AddScriptLPS(1); |
9913 | 9803 | ||
9914 | // our key in the object we are in | ||
9915 | UUID invItemID = InventorySelf(); | ||
9916 | if (invItemID == UUID.Zero) return; | ||
9917 | |||
9918 | // the object we are in | 9804 | // the object we are in |
9919 | UUID objectID = m_host.ParentUUID; | 9805 | UUID objectID = m_host.ParentUUID; |
9920 | if (objectID == UUID.Zero) return; | 9806 | if (objectID == UUID.Zero) |
9807 | return; | ||
9921 | 9808 | ||
9922 | UUID agentID; | 9809 | TaskInventoryItem item = GetSelfInventoryItem(); |
9923 | lock (m_host.TaskInventory) | ||
9924 | { | ||
9925 | // we need the permission first, to know which avatar we want to set the camera for | ||
9926 | agentID = m_host.TaskInventory[invItemID].PermsGranter; | ||
9927 | 9810 | ||
9928 | if (agentID == UUID.Zero) return; | 9811 | // we need the permission first, to know which avatar we want to set the camera for |
9929 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 9812 | UUID agentID = item.PermsGranter; |
9930 | } | 9813 | |
9814 | if (agentID == UUID.Zero) | ||
9815 | return; | ||
9816 | |||
9817 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) | ||
9818 | return; | ||
9931 | 9819 | ||
9932 | ScenePresence presence = World.GetScenePresence(agentID); | 9820 | ScenePresence presence = World.GetScenePresence(agentID); |
9933 | 9821 | ||
@@ -9967,27 +9855,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9967 | { | 9855 | { |
9968 | m_host.AddScriptLPS(1); | 9856 | m_host.AddScriptLPS(1); |
9969 | 9857 | ||
9970 | // our key in the object we are in | ||
9971 | UUID invItemID=InventorySelf(); | ||
9972 | if (invItemID == UUID.Zero) return; | ||
9973 | |||
9974 | // the object we are in | 9858 | // the object we are in |
9975 | UUID objectID = m_host.ParentUUID; | 9859 | UUID objectID = m_host.ParentUUID; |
9976 | if (objectID == UUID.Zero) return; | 9860 | if (objectID == UUID.Zero) |
9861 | return; | ||
9862 | |||
9863 | TaskInventoryItem item = GetSelfInventoryItem(); | ||
9977 | 9864 | ||
9978 | // we need the permission first, to know which avatar we want to clear the camera for | 9865 | // we need the permission first, to know which avatar we want to clear the camera for |
9979 | UUID agentID; | 9866 | UUID agentID = item.PermsGranter; |
9980 | lock (m_host.TaskInventory) | 9867 | |
9981 | { | 9868 | if (agentID == UUID.Zero) |
9982 | agentID = m_host.TaskInventory[invItemID].PermsGranter; | 9869 | return; |
9983 | if (agentID == UUID.Zero) return; | 9870 | |
9984 | if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; | 9871 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) |
9985 | } | 9872 | return; |
9986 | 9873 | ||
9987 | ScenePresence presence = World.GetScenePresence(agentID); | 9874 | ScenePresence presence = World.GetScenePresence(agentID); |
9988 | 9875 | ||
9989 | // we are not interested in child-agents | 9876 | // we are not interested in child-agents |
9990 | if (presence.IsChildAgent) return; | 9877 | if (presence.IsChildAgent) |
9878 | return; | ||
9991 | 9879 | ||
9992 | presence.ControllingClient.SendClearFollowCamProperties(objectID); | 9880 | presence.ControllingClient.SendClearFollowCamProperties(objectID); |
9993 | } | 9881 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 890115d..893fda1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -209,6 +209,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
209 | throw new Exception("OSSL Runtime Error: " + msg); | 209 | throw new Exception("OSSL Runtime Error: " + msg); |
210 | } | 210 | } |
211 | 211 | ||
212 | /// <summary> | ||
213 | /// Initialize the LSL interface. | ||
214 | /// </summary> | ||
215 | /// <remarks> | ||
216 | /// FIXME: This is an abomination. We should be able to set this up earlier but currently we have no | ||
217 | /// guarantee the interface is present on Initialize(). There needs to be another post initialize call from | ||
218 | /// ScriptInstance. | ||
219 | /// </remarks> | ||
212 | private void InitLSL() | 220 | private void InitLSL() |
213 | { | 221 | { |
214 | if (m_LSL_Api != null) | 222 | if (m_LSL_Api != null) |
@@ -1609,7 +1617,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1609 | 1617 | ||
1610 | public Object osParseJSONNew(string JSON) | 1618 | public Object osParseJSONNew(string JSON) |
1611 | { | 1619 | { |
1612 | CheckThreatLevel(ThreatLevel.None, "osParseJSON"); | 1620 | CheckThreatLevel(ThreatLevel.None, "osParseJSONNew"); |
1613 | 1621 | ||
1614 | m_host.AddScriptLPS(1); | 1622 | m_host.AddScriptLPS(1); |
1615 | 1623 | ||
@@ -3132,5 +3140,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3132 | estate.setEstateTerrainTextureHeights(corner, (float)low, (float)high); | 3140 | estate.setEstateTerrainTextureHeights(corner, (float)low, (float)high); |
3133 | } | 3141 | } |
3134 | } | 3142 | } |
3143 | |||
3144 | public void osForceAttachToAvatar(int attachmentPoint) | ||
3145 | { | ||
3146 | CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar"); | ||
3147 | |||
3148 | m_host.AddScriptLPS(1); | ||
3149 | |||
3150 | InitLSL(); | ||
3151 | ((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint); | ||
3152 | } | ||
3153 | |||
3154 | public void osForceDetachFromAvatar() | ||
3155 | { | ||
3156 | CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar"); | ||
3157 | |||
3158 | m_host.AddScriptLPS(1); | ||
3159 | |||
3160 | InitLSL(); | ||
3161 | ((LSL_Api)m_LSL_Api).DetachFromAvatar(); | ||
3162 | } | ||
3135 | } | 3163 | } |
3136 | } \ No newline at end of file | 3164 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 2d3e8e8..e92518d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -98,6 +98,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
98 | void osAvatarPlayAnimation(string avatar, string animation); | 98 | void osAvatarPlayAnimation(string avatar, string animation); |
99 | void osAvatarStopAnimation(string avatar, string animation); | 99 | void osAvatarStopAnimation(string avatar, string animation); |
100 | 100 | ||
101 | // Attachment commands | ||
102 | |||
103 | /// <summary> | ||
104 | /// Attach the object containing this script to the avatar that owns it without checking for PERMISSION_ATTACH | ||
105 | /// </summary> | ||
106 | /// <param name='attachment'>The attachment point. For example, ATTACH_CHEST</param> | ||
107 | void osForceAttachToAvatar(int attachment); | ||
108 | |||
109 | /// <summary> | ||
110 | /// Detach the object containing this script from the avatar it is attached to without checking for PERMISSION_ATTACH | ||
111 | /// </summary> | ||
112 | /// <remarks>Nothing happens if the object is not attached.</remarks> | ||
113 | void osForceDetachFromAvatar(); | ||
114 | |||
101 | //texture draw functions | 115 | //texture draw functions |
102 | string osMovePen(string drawList, int x, int y); | 116 | string osMovePen(string drawList, int x, int y); |
103 | string osDrawLine(string drawList, int startX, int startY, int endX, int endY); | 117 | string osDrawLine(string drawList, int startX, int startY, int endX, int endY); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index e836959..d230662 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -289,8 +289,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
289 | m_OSSL_Functions.osAvatarStopAnimation(avatar, animation); | 289 | m_OSSL_Functions.osAvatarStopAnimation(avatar, animation); |
290 | } | 290 | } |
291 | 291 | ||
292 | // Avatar functions | ||
292 | 293 | ||
293 | //Texture Draw functions | 294 | public void osForceAttachToAvatar(int attachmentPoint) |
295 | { | ||
296 | m_OSSL_Functions.osForceAttachToAvatar(attachmentPoint); | ||
297 | } | ||
298 | |||
299 | public void osForceDetachFromAvatar() | ||
300 | { | ||
301 | m_OSSL_Functions.osForceDetachFromAvatar(); | ||
302 | } | ||
303 | |||
304 | // Texture Draw functions | ||
294 | 305 | ||
295 | public string osMovePen(string drawList, int x, int y) | 306 | public string osMovePen(string drawList, int x, int y) |
296 | { | 307 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 6e36742..2c8af81 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -964,7 +964,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
964 | public IScriptApi GetApi(string name) | 964 | public IScriptApi GetApi(string name) |
965 | { | 965 | { |
966 | if (m_Apis.ContainsKey(name)) | 966 | if (m_Apis.ContainsKey(name)) |
967 | { | ||
968 | // m_log.DebugFormat("[SCRIPT INSTANCE]: Found api {0} in {1}@{2}", name, ScriptName, PrimName); | ||
969 | |||
967 | return m_Apis[name]; | 970 | return m_Apis[name]; |
971 | } | ||
972 | |||
973 | // m_log.DebugFormat("[SCRIPT INSTANCE]: Did not find api {0} in {1}@{2}", name, ScriptName, PrimName); | ||
974 | |||
968 | return null; | 975 | return null; |
969 | } | 976 | } |
970 | 977 | ||
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 23a4cf9..a9b6e67 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1812,9 +1812,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1812 | // if there already exists a file at that location, it may be locked. | 1812 | // if there already exists a file at that location, it may be locked. |
1813 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message); | 1813 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message); |
1814 | } | 1814 | } |
1815 | |||
1816 | string textpath = path + ".text"; | ||
1815 | try | 1817 | try |
1816 | { | 1818 | { |
1817 | using (FileStream fs = File.Create(path + ".text")) | 1819 | using (FileStream fs = File.Create(textpath)) |
1818 | { | 1820 | { |
1819 | using (StreamWriter sw = new StreamWriter(fs)) | 1821 | using (StreamWriter sw = new StreamWriter(fs)) |
1820 | { | 1822 | { |
@@ -1827,7 +1829,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1827 | catch (IOException ex) | 1829 | catch (IOException ex) |
1828 | { | 1830 | { |
1829 | // if there already exists a file at that location, it may be locked. | 1831 | // if there already exists a file at that location, it may be locked. |
1830 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message); | 1832 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", textpath, ex.Message); |
1831 | } | 1833 | } |
1832 | } | 1834 | } |
1833 | } | 1835 | } |
@@ -1876,7 +1878,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1876 | catch (IOException ex) | 1878 | catch (IOException ex) |
1877 | { | 1879 | { |
1878 | // if there already exists a file at that location, it may be locked. | 1880 | // if there already exists a file at that location, it may be locked. |
1879 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", statepath, ex.Message); | 1881 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", mappath, ex.Message); |
1880 | } | 1882 | } |
1881 | } | 1883 | } |
1882 | 1884 | ||