aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2011-01-11 14:38:10 +0000
committerMelanie2011-01-11 14:38:10 +0000
commitd7fd4b2153df8fb59596ab419b730e153b7c8ae7 (patch)
tree69dab4134a498fd683397a993d556901b7f2677b /OpenSim
parentReplace the new, tricky MySql.Data.dll with the older version from 0.6.9 (diff)
parentPartial permissions fix for boxed items. (diff)
downloadopensim-SC-d7fd4b2153df8fb59596ab419b730e153b7c8ae7.zip
opensim-SC-d7fd4b2153df8fb59596ab419b730e153b7c8ae7.tar.gz
opensim-SC-d7fd4b2153df8fb59596ab419b730e153b7c8ae7.tar.bz2
opensim-SC-d7fd4b2153df8fb59596ab419b730e153b7c8ae7.tar.xz
Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/TaskInventoryItem.cs12
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs64
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs12
6 files changed, 95 insertions, 14 deletions
diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs
index 248502e..be2b8c8 100644
--- a/OpenSim/Framework/TaskInventoryItem.cs
+++ b/OpenSim/Framework/TaskInventoryItem.cs
@@ -124,6 +124,9 @@ namespace OpenSim.Framework
124 private UUID _oldID = UUID.Zero; 124 private UUID _oldID = UUID.Zero;
125 125
126 private bool _ownerChanged = false; 126 private bool _ownerChanged = false;
127
128 // This used ONLY during copy. It can't be relied on at other times!
129 private bool _scriptRunning = true;
127 130
128 public UUID AssetID { 131 public UUID AssetID {
129 get { 132 get {
@@ -387,6 +390,15 @@ namespace OpenSim.Framework
387 } 390 }
388 } 391 }
389 392
393 public bool ScriptRunning {
394 get {
395 return _scriptRunning;
396 }
397 set {
398 _scriptRunning = value;
399 }
400 }
401
390 // See ICloneable 402 // See ICloneable
391 403
392 #region ICloneable Members 404 #region ICloneable Members
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index fecdd1b..4a3c634 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -50,5 +50,7 @@ namespace OpenSim.Region.Framework.Interfaces
50 void ResumeScript(UUID itemID); 50 void ResumeScript(UUID itemID);
51 51
52 ArrayList GetScriptErrors(UUID itemID); 52 ArrayList GetScriptErrors(UUID itemID);
53
54 bool HasScript(UUID itemID, out bool running);
53 } 55 }
54} 56}
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);
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 35cc65b..6bdd4c8 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1695,5 +1695,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1695 1695
1696 instance.Resume(); 1696 instance.Resume();
1697 } 1697 }
1698
1699 public bool HasScript(UUID itemID, out bool running)
1700 {
1701 running = true;
1702
1703 IScriptInstance instance = GetInstance(itemID);
1704 if (instance == null)
1705 return false;
1706
1707 running = instance.Running;
1708 return true;
1709 }
1698 } 1710 }
1699} 1711}