diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 64 |
3 files changed, 69 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 682c36d..1f32362 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2025,6 +2025,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2025 | 2025 | ||
2026 | public void SetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID, bool running) | 2026 | public void SetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID, bool running) |
2027 | { | 2027 | { |
2028 | if (!Permissions.CanEditScript(itemID, objectID, controllingClient.AgentId)) | ||
2029 | return; | ||
2030 | |||
2028 | SceneObjectPart part = GetSceneObjectPart(objectID); | 2031 | SceneObjectPart part = GetSceneObjectPart(objectID); |
2029 | if (part == null) | 2032 | if (part == null) |
2030 | return; | 2033 | return; |
@@ -2168,5 +2171,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2168 | 2171 | ||
2169 | m_sceneGraph.LinkObjects(root, children); | 2172 | m_sceneGraph.LinkObjects(root, children); |
2170 | } | 2173 | } |
2174 | |||
2175 | private string PermissionString(uint permissions) | ||
2176 | { | ||
2177 | PermissionMask perms = (PermissionMask)permissions & | ||
2178 | (PermissionMask.Move | | ||
2179 | PermissionMask.Copy | | ||
2180 | PermissionMask.Transfer | | ||
2181 | PermissionMask.Modify); | ||
2182 | return perms.ToString(); | ||
2183 | } | ||
2171 | } | 2184 | } |
2172 | } | 2185 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 304de67..6e0fc43 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2857,8 +2857,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2857 | } | 2857 | } |
2858 | } | 2858 | } |
2859 | 2859 | ||
2860 | RootPart.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect); | ||
2860 | for (int i = 0; i < parts.Length; i++) | 2861 | for (int i = 0; i < parts.Length; i++) |
2861 | parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect); | 2862 | { |
2863 | if (parts[i] != RootPart) | ||
2864 | parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect); | ||
2865 | } | ||
2862 | } | 2866 | } |
2863 | } | 2867 | } |
2864 | 2868 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 970003a..3b1ab01 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -48,6 +48,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
48 | private string m_inventoryFileName = String.Empty; | 48 | private string m_inventoryFileName = String.Empty; |
49 | private byte[] m_inventoryFileData = new byte[0]; | 49 | private byte[] m_inventoryFileData = new byte[0]; |
50 | private uint m_inventoryFileNameSerial = 0; | 50 | private uint m_inventoryFileNameSerial = 0; |
51 | private bool m_inventoryPrivileged = false; | ||
51 | 52 | ||
52 | private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>(); | 53 | private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>(); |
53 | 54 | ||
@@ -93,6 +94,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
93 | { | 94 | { |
94 | m_items = value; | 95 | m_items = value; |
95 | m_inventorySerial++; | 96 | m_inventorySerial++; |
97 | QueryScriptStates(); | ||
96 | } | 98 | } |
97 | } | 99 | } |
98 | 100 | ||
@@ -225,6 +227,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
225 | m_items.LockItemsForWrite(false); | 227 | m_items.LockItemsForWrite(false); |
226 | } | 228 | } |
227 | 229 | ||
230 | private void QueryScriptStates() | ||
231 | { | ||
232 | if (m_part == null || m_part.ParentGroup == null) | ||
233 | return; | ||
234 | |||
235 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
236 | if (engines == null) // No engine at all | ||
237 | return; | ||
238 | |||
239 | Items.LockItemsForRead(true); | ||
240 | foreach (TaskInventoryItem item in Items.Values) | ||
241 | { | ||
242 | if (item.InvType == (int)InventoryType.LSL) | ||
243 | { | ||
244 | foreach (IScriptModule e in engines) | ||
245 | { | ||
246 | bool running; | ||
247 | |||
248 | if (e.HasScript(item.ItemID, out running)) | ||
249 | { | ||
250 | item.ScriptRunning = running; | ||
251 | break; | ||
252 | } | ||
253 | } | ||
254 | } | ||
255 | } | ||
256 | |||
257 | Items.LockItemsForRead(false); | ||
258 | } | ||
259 | |||
228 | /// <summary> | 260 | /// <summary> |
229 | /// Start all the scripts contained in this prim's inventory | 261 | /// Start all the scripts contained in this prim's inventory |
230 | /// </summary> | 262 | /// </summary> |
@@ -348,6 +380,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
348 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | 380 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( |
349 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | 381 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); |
350 | StoreScriptErrors(item.ItemID, null); | 382 | StoreScriptErrors(item.ItemID, null); |
383 | if (!item.ScriptRunning) | ||
384 | m_part.ParentGroup.Scene.EventManager.TriggerStopScript( | ||
385 | m_part.LocalId, item.ItemID); | ||
351 | m_part.ParentGroup.AddActiveScriptCount(1); | 386 | m_part.ParentGroup.AddActiveScriptCount(1); |
352 | m_part.ScheduleFullUpdate(); | 387 | m_part.ScheduleFullUpdate(); |
353 | } | 388 | } |
@@ -952,6 +987,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
952 | { | 987 | { |
953 | bool changed = CreateInventoryFileName(); | 988 | bool changed = CreateInventoryFileName(); |
954 | 989 | ||
990 | bool includeAssets = false; | ||
991 | if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId)) | ||
992 | includeAssets = true; | ||
993 | |||
994 | if (m_inventoryPrivileged != includeAssets) | ||
995 | changed = true; | ||
996 | |||
955 | InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); | 997 | InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); |
956 | 998 | ||
957 | Items.LockItemsForRead(true); | 999 | Items.LockItemsForRead(true); |
@@ -977,9 +1019,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
977 | } | 1019 | } |
978 | } | 1020 | } |
979 | 1021 | ||
980 | bool includeAssets = false; | 1022 | m_inventoryPrivileged = includeAssets; |
981 | if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId)) | ||
982 | includeAssets = true; | ||
983 | 1023 | ||
984 | foreach (TaskInventoryItem item in m_items.Values) | 1024 | foreach (TaskInventoryItem item in m_items.Values) |
985 | { | 1025 | { |
@@ -1123,16 +1163,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1123 | 1163 | ||
1124 | foreach (TaskInventoryItem item in m_items.Values) | 1164 | foreach (TaskInventoryItem item in m_items.Values) |
1125 | { | 1165 | { |
1126 | if (item.InvType != (int)InventoryType.Object) | 1166 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0) |
1127 | { | 1167 | mask &= ~((uint)PermissionMask.Copy >> 13); |
1128 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0) | 1168 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0) |
1129 | mask &= ~((uint)PermissionMask.Copy >> 13); | 1169 | mask &= ~((uint)PermissionMask.Transfer >> 13); |
1130 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0) | 1170 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0) |
1131 | mask &= ~((uint)PermissionMask.Transfer >> 13); | 1171 | mask &= ~((uint)PermissionMask.Modify >> 13); |
1132 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0) | 1172 | |
1133 | mask &= ~((uint)PermissionMask.Modify >> 13); | 1173 | if (item.InvType == (int)InventoryType.Object) |
1134 | } | ||
1135 | else | ||
1136 | { | 1174 | { |
1137 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | 1175 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) |
1138 | mask &= ~((uint)PermissionMask.Copy >> 13); | 1176 | mask &= ~((uint)PermissionMask.Copy >> 13); |