diff options
author | Melanie Thielker | 2008-07-19 04:05:34 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-07-19 04:05:34 +0000 |
commit | bcf74416a1677584c069e4e0b9acf9015d8c5b6c (patch) | |
tree | 8c0b967fafbc21e93974760c0b32a0dd2119b930 /OpenSim/Region/ScriptEngine | |
parent | Introduce a separate connection string for estates, which defaults to the one gi (diff) | |
download | opensim-SC-bcf74416a1677584c069e4e0b9acf9015d8c5b6c.zip opensim-SC-bcf74416a1677584c069e4e0b9acf9015d8c5b6c.tar.gz opensim-SC-bcf74416a1677584c069e4e0b9acf9015d8c5b6c.tar.bz2 opensim-SC-bcf74416a1677584c069e4e0b9acf9015d8c5b6c.tar.xz |
Fix prim link numbers (Mantis #1781)
Implements additional unlink modes (unlink root prim from link set, some
multi-set operations). Linking (single and mutiple) fully implemented.
Consistent numbering of links while in world. Link/delink with predictable
link numbering. Correct link numbers in LSL.
Not all multi-set ops implemented. Link numbers still change when taken and
re-rezzed.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 21 insertions, 27 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index cbd4db2..682d566 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -2600,7 +2600,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2600 | 2600 | ||
2601 | if (m_host.ParentGroup.Children.Count > 1) | 2601 | if (m_host.ParentGroup.Children.Count > 1) |
2602 | { | 2602 | { |
2603 | return m_host.LinkNum + 1; | 2603 | return m_host.LinkNum; |
2604 | } | 2604 | } |
2605 | else | 2605 | else |
2606 | { | 2606 | { |
@@ -2979,7 +2979,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2979 | 2979 | ||
2980 | object[] resobj = new object[] | 2980 | object[] resobj = new object[] |
2981 | { | 2981 | { |
2982 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 2982 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
2983 | }; | 2983 | }; |
2984 | 2984 | ||
2985 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 2985 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
@@ -3004,7 +3004,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3004 | partItemID = item.ItemID; | 3004 | partItemID = item.ItemID; |
3005 | Object[] resobj = new object[] | 3005 | Object[] resobj = new object[] |
3006 | { | 3006 | { |
3007 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 3007 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
3008 | }; | 3008 | }; |
3009 | 3009 | ||
3010 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 3010 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
@@ -3032,7 +3032,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3032 | partItemID = item.ItemID; | 3032 | partItemID = item.ItemID; |
3033 | Object[] resobj = new object[] | 3033 | Object[] resobj = new object[] |
3034 | { | 3034 | { |
3035 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 3035 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
3036 | }; | 3036 | }; |
3037 | 3037 | ||
3038 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 3038 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
@@ -3062,7 +3062,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3062 | partItemID = item.ItemID; | 3062 | partItemID = item.ItemID; |
3063 | Object[] resobj = new object[] | 3063 | Object[] resobj = new object[] |
3064 | { | 3064 | { |
3065 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 3065 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
3066 | }; | 3066 | }; |
3067 | 3067 | ||
3068 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 3068 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
@@ -3086,7 +3086,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3086 | 3086 | ||
3087 | object[] resobj = new object[] | 3087 | object[] resobj = new object[] |
3088 | { | 3088 | { |
3089 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 3089 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
3090 | }; | 3090 | }; |
3091 | 3091 | ||
3092 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 3092 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
@@ -3103,7 +3103,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3103 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) | 3103 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) |
3104 | { | 3104 | { |
3105 | 3105 | ||
3106 | if ((partInst.LinkNum + 1) == linknum) | 3106 | if ((partInst.LinkNum) == linknum) |
3107 | { | 3107 | { |
3108 | 3108 | ||
3109 | foreach (TaskInventoryItem item in partInst.TaskInventory.Values) | 3109 | foreach (TaskInventoryItem item in partInst.TaskInventory.Values) |
@@ -3114,7 +3114,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3114 | partItemID = item.ItemID; | 3114 | partItemID = item.ItemID; |
3115 | Object[] resObjDef = new object[] | 3115 | Object[] resObjDef = new object[] |
3116 | { | 3116 | { |
3117 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 3117 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
3118 | }; | 3118 | }; |
3119 | 3119 | ||
3120 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 3120 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
@@ -5246,7 +5246,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5246 | { | 5246 | { |
5247 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) | 5247 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) |
5248 | { | 5248 | { |
5249 | if ((partInst.LinkNum + 1) == linknumber) | 5249 | if ((partInst.LinkNum) == linknumber) |
5250 | { | 5250 | { |
5251 | part = partInst; | 5251 | part = partInst; |
5252 | break; | 5252 | break; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index decd2d0..c3255b1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2487,7 +2487,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2487 | 2487 | ||
2488 | if (m_host.ParentGroup.Children.Count > 1) | 2488 | if (m_host.ParentGroup.Children.Count > 1) |
2489 | { | 2489 | { |
2490 | return m_host.LinkNum + 1; | 2490 | return m_host.LinkNum; |
2491 | } | 2491 | } |
2492 | else | 2492 | else |
2493 | { | 2493 | { |
@@ -2923,7 +2923,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2923 | 2923 | ||
2924 | object[] resobj = new object[] | 2924 | object[] resobj = new object[] |
2925 | { | 2925 | { |
2926 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 2926 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
2927 | }; | 2927 | }; |
2928 | 2928 | ||
2929 | m_ScriptEngine.PostScriptEvent(partItemID, | 2929 | m_ScriptEngine.PostScriptEvent(partItemID, |
@@ -2947,7 +2947,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2947 | partItemID = item.ItemID; | 2947 | partItemID = item.ItemID; |
2948 | Object[] resobj = new object[] | 2948 | Object[] resobj = new object[] |
2949 | { | 2949 | { |
2950 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 2950 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
2951 | }; | 2951 | }; |
2952 | 2952 | ||
2953 | m_ScriptEngine.PostScriptEvent(partItemID, | 2953 | m_ScriptEngine.PostScriptEvent(partItemID, |
@@ -2975,7 +2975,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2975 | partItemID = item.ItemID; | 2975 | partItemID = item.ItemID; |
2976 | Object[] resobj = new object[] | 2976 | Object[] resobj = new object[] |
2977 | { | 2977 | { |
2978 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 2978 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
2979 | }; | 2979 | }; |
2980 | 2980 | ||
2981 | m_ScriptEngine.PostScriptEvent(partItemID, | 2981 | m_ScriptEngine.PostScriptEvent(partItemID, |
@@ -3005,7 +3005,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3005 | partItemID = item.ItemID; | 3005 | partItemID = item.ItemID; |
3006 | Object[] resobj = new object[] | 3006 | Object[] resobj = new object[] |
3007 | { | 3007 | { |
3008 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 3008 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
3009 | }; | 3009 | }; |
3010 | 3010 | ||
3011 | m_ScriptEngine.PostScriptEvent(partItemID, | 3011 | m_ScriptEngine.PostScriptEvent(partItemID, |
@@ -3029,7 +3029,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3029 | 3029 | ||
3030 | object[] resobj = new object[] | 3030 | object[] resobj = new object[] |
3031 | { | 3031 | { |
3032 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 3032 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
3033 | }; | 3033 | }; |
3034 | 3034 | ||
3035 | m_ScriptEngine.PostScriptEvent(partItemID, | 3035 | m_ScriptEngine.PostScriptEvent(partItemID, |
@@ -3045,7 +3045,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3045 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) | 3045 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) |
3046 | { | 3046 | { |
3047 | 3047 | ||
3048 | if ((partInst.LinkNum + 1) == linknum) | 3048 | if ((partInst.LinkNum) == linknum) |
3049 | { | 3049 | { |
3050 | 3050 | ||
3051 | foreach (TaskInventoryItem item in partInst.TaskInventory.Values) | 3051 | foreach (TaskInventoryItem item in partInst.TaskInventory.Values) |
@@ -3056,7 +3056,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3056 | partItemID = item.ItemID; | 3056 | partItemID = item.ItemID; |
3057 | Object[] resObjDef = new object[] | 3057 | Object[] resObjDef = new object[] |
3058 | { | 3058 | { |
3059 | new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) | 3059 | new LSL_Types.LSLInteger(m_host.LinkNum), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id) |
3060 | }; | 3060 | }; |
3061 | 3061 | ||
3062 | m_ScriptEngine.PostScriptEvent(partItemID, | 3062 | m_ScriptEngine.PostScriptEvent(partItemID, |
@@ -5046,7 +5046,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5046 | { | 5046 | { |
5047 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) | 5047 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) |
5048 | { | 5048 | { |
5049 | if ((partInst.LinkNum + 1) == linknumber) | 5049 | if ((partInst.LinkNum) == linknumber) |
5050 | { | 5050 | { |
5051 | part = partInst; | 5051 | part = partInst; |
5052 | break; | 5052 | break; |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 3fd4942..db11e6b 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | |||
@@ -93,9 +93,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
93 | if (part == null) | 93 | if (part == null) |
94 | return; | 94 | return; |
95 | 95 | ||
96 | det[0].LinkNum = 0; | 96 | det[0].LinkNum = part.LinkNum; |
97 | if (part.ParentGroup.Children.Count > 0) | ||
98 | det[0].LinkNum = part.LinkNum + 1; | ||
99 | 97 | ||
100 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 98 | myScriptEngine.PostObjectEvent(localID, new EventParams( |
101 | "touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, | 99 | "touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, |
@@ -119,9 +117,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
119 | if (part == null) | 117 | if (part == null) |
120 | return; | 118 | return; |
121 | 119 | ||
122 | det[0].LinkNum = 0; | 120 | det[0].LinkNum = part.LinkNum; |
123 | if (part.ParentGroup.Children.Count > 0) | ||
124 | det[0].LinkNum = part.LinkNum + 1; | ||
125 | 121 | ||
126 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 122 | myScriptEngine.PostObjectEvent(localID, new EventParams( |
127 | "touch", new Object[] { new LSL_Types.LSLInteger(1) }, | 123 | "touch", new Object[] { new LSL_Types.LSLInteger(1) }, |
@@ -141,9 +137,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
141 | if (part == null) | 137 | if (part == null) |
142 | return; | 138 | return; |
143 | 139 | ||
144 | det[0].LinkNum = 0; | 140 | det[0].LinkNum = part.LinkNum; |
145 | if (part.ParentGroup.Children.Count > 0) | ||
146 | det[0].LinkNum = part.LinkNum + 1; | ||
147 | 141 | ||
148 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 142 | myScriptEngine.PostObjectEvent(localID, new EventParams( |
149 | "touch_end", new Object[] { new LSL_Types.LSLInteger(1) }, | 143 | "touch_end", new Object[] { new LSL_Types.LSLInteger(1) }, |