aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorDiva Canto2010-06-29 06:37:39 -0700
committerDiva Canto2010-06-29 06:37:39 -0700
commit1cd9118c7a72a6e80aafe56134630682f2bb04d0 (patch)
tree09f953b9b6150ea29153917b2c159fa621a1cf66 /OpenSim/Region/Framework
parentdon't report the null uuid as a missing asset on saving oars/iars (diff)
parentThis file wants to be committed. (diff)
downloadopensim-SC_OLD-1cd9118c7a72a6e80aafe56134630682f2bb04d0.zip
opensim-SC_OLD-1cd9118c7a72a6e80aafe56134630682f2bb04d0.tar.gz
opensim-SC_OLD-1cd9118c7a72a6e80aafe56134630682f2bb04d0.tar.bz2
opensim-SC_OLD-1cd9118c7a72a6e80aafe56134630682f2bb04d0.tar.xz
Merge branch 'master' into 0.7-post-fixes
Conflicts: OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEmailModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs22
6 files changed, 56 insertions, 42 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEmailModule.cs b/OpenSim/Region/Framework/Interfaces/IEmailModule.cs
index 3a2c423..4f1b91a 100644
--- a/OpenSim/Region/Framework/Interfaces/IEmailModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEmailModule.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Framework.Interfaces
38 public int numLeft; 38 public int numLeft;
39 } 39 }
40 40
41 public interface IEmailModule : IRegionModule 41 public interface IEmailModule
42 { 42 {
43 void SendEmail(UUID objectID, string address, string subject, string body); 43 void SendEmail(UUID objectID, string address, string subject, string body);
44 Email GetNextEmail(UUID objectID, string sender, string subject); 44 Email GetNextEmail(UUID objectID, string sender, string subject);
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index 7b7677b..de3c360 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -52,6 +52,9 @@ namespace OpenSim.Region.Framework.Scenes
52 public double GetUpdatePriority(IClientAPI client, ISceneEntity entity) 52 public double GetUpdatePriority(IClientAPI client, ISceneEntity entity)
53 { 53 {
54 double priority = 0; 54 double priority = 0;
55
56 if (entity == null)
57 return 100000;
55 58
56 switch (m_scene.UpdatePrioritizationScheme) 59 switch (m_scene.UpdatePrioritizationScheme)
57 { 60 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 64bdc99..9278164 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -385,9 +385,9 @@ namespace OpenSim.Region.Framework.Scenes
385 if (Permissions.PropagatePermissions() && recipient != senderId) 385 if (Permissions.PropagatePermissions() && recipient != senderId)
386 { 386 {
387 // First, make sore base is limited to the next perms 387 // First, make sore base is limited to the next perms
388 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; 388 itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move);
389 // By default, current equals base 389 // By default, current equals base
390 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 390 itemCopy.CurrentPermissions = itemCopy.BasePermissions & item.CurrentPermissions;
391 391
392 // If this is an object, replace current perms 392 // If this is an object, replace current perms
393 // with folded perms 393 // with folded perms
@@ -398,7 +398,7 @@ namespace OpenSim.Region.Framework.Scenes
398 } 398 }
399 399
400 // Ensure there is no escalation 400 // Ensure there is no escalation
401 itemCopy.CurrentPermissions &= item.NextPermissions; 401 itemCopy.CurrentPermissions &= (item.NextPermissions | (uint)PermissionMask.Move);
402 402
403 // Need slam bit on xfer 403 // Need slam bit on xfer
404 itemCopy.CurrentPermissions |= 8; 404 itemCopy.CurrentPermissions |= 8;
@@ -897,14 +897,15 @@ namespace OpenSim.Region.Framework.Scenes
897 897
898 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) 898 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
899 { 899 {
900 agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions; 900 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
901 if (taskItem.InvType == (int)InventoryType.Object) 901 if (taskItem.InvType == (int)InventoryType.Object)
902 agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); 902 agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
903 agentItem.CurrentPermissions = agentItem.BasePermissions ; 903 else
904 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
904 905
905 agentItem.CurrentPermissions |= 8; 906 agentItem.CurrentPermissions |= 8;
906 agentItem.NextPermissions = taskItem.NextPermissions; 907 agentItem.NextPermissions = taskItem.NextPermissions;
907 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; 908 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
908 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; 909 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
909 } 910 }
910 else 911 else
@@ -1086,13 +1087,13 @@ namespace OpenSim.Region.Framework.Scenes
1086 if (Permissions.PropagatePermissions()) 1087 if (Permissions.PropagatePermissions())
1087 { 1088 {
1088 destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions & 1089 destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
1089 srcTaskItem.NextPermissions; 1090 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1090 destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions & 1091 destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions &
1091 srcTaskItem.NextPermissions; 1092 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1092 destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions & 1093 destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
1093 srcTaskItem.NextPermissions; 1094 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1094 destTaskItem.BasePermissions = srcTaskItem.BasePermissions & 1095 destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
1095 srcTaskItem.NextPermissions; 1096 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1096 destTaskItem.CurrentPermissions |= 8; // Slam! 1097 destTaskItem.CurrentPermissions |= 8; // Slam!
1097 } 1098 }
1098 } 1099 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 240c688..40332a6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1747,9 +1747,31 @@ namespace OpenSim.Region.Framework.Scenes
1747 { 1747 {
1748 if (m_parentScene.Permissions.CanDuplicateObject(original.Children.Count, original.UUID, AgentID, original.AbsolutePosition)) 1748 if (m_parentScene.Permissions.CanDuplicateObject(original.Children.Count, original.UUID, AgentID, original.AbsolutePosition))
1749 { 1749 {
1750 SceneObjectGroup copy = original.Copy(AgentID, GroupID, true); 1750 SceneObjectGroup copy = original.Copy(true);
1751 copy.AbsolutePosition = copy.AbsolutePosition + offset; 1751 copy.AbsolutePosition = copy.AbsolutePosition + offset;
1752 1752
1753 if (original.OwnerID != AgentID)
1754 {
1755 copy.SetOwnerId(AgentID);
1756 copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID);
1757
1758 List<SceneObjectPart> partList =
1759 new List<SceneObjectPart>(copy.Children.Values);
1760
1761 if (m_parentScene.Permissions.PropagatePermissions())
1762 {
1763 foreach (SceneObjectPart child in partList)
1764 {
1765 child.Inventory.ChangeInventoryOwner(AgentID);
1766 child.TriggerScriptChangedEvent(Changed.OWNER);
1767 child.ApplyNextOwnerPermissions();
1768 }
1769 }
1770
1771 copy.RootPart.ObjectSaleType = 0;
1772 copy.RootPart.SalePrice = 10;
1773 }
1774
1753 Entities.Add(copy); 1775 Entities.Add(copy);
1754 1776
1755 // Since we copy from a source group that is in selected 1777 // Since we copy from a source group that is in selected
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e23f39f..1ca390a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1472,7 +1472,7 @@ namespace OpenSim.Region.Framework.Scenes
1472 "[SCENE]: Storing {0}, {1} in {2}", 1472 "[SCENE]: Storing {0}, {1} in {2}",
1473 Name, UUID, m_scene.RegionInfo.RegionName); 1473 Name, UUID, m_scene.RegionInfo.RegionName);
1474 1474
1475 SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); 1475 SceneObjectGroup backup_group = Copy(false);
1476 backup_group.RootPart.Velocity = RootPart.Velocity; 1476 backup_group.RootPart.Velocity = RootPart.Velocity;
1477 backup_group.RootPart.Acceleration = RootPart.Acceleration; 1477 backup_group.RootPart.Acceleration = RootPart.Acceleration;
1478 backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; 1478 backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
@@ -1528,7 +1528,7 @@ namespace OpenSim.Region.Framework.Scenes
1528 /// Duplicates this object, including operations such as physics set up and attaching to the backup event. 1528 /// Duplicates this object, including operations such as physics set up and attaching to the backup event.
1529 /// </summary> 1529 /// </summary>
1530 /// <returns></returns> 1530 /// <returns></returns>
1531 public SceneObjectGroup Copy(UUID cAgentID, UUID cGroupID, bool userExposed) 1531 public SceneObjectGroup Copy(bool userExposed)
1532 { 1532 {
1533 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); 1533 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
1534 dupe.m_isBackedUp = false; 1534 dupe.m_isBackedUp = false;
@@ -1551,7 +1551,9 @@ namespace OpenSim.Region.Framework.Scenes
1551 dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); 1551 dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
1552 1552
1553 if (!userExposed) 1553 if (!userExposed)
1554 {
1554 dupe.RootPart.IsAttachment = previousAttachmentStatus; 1555 dupe.RootPart.IsAttachment = previousAttachmentStatus;
1556 }
1555 1557
1556 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); 1558 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
1557 dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; 1559 dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
@@ -1576,16 +1578,6 @@ namespace OpenSim.Region.Framework.Scenes
1576 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); 1578 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
1577 } 1579 }
1578 1580
1579 // Now we've made a copy that replaces this one, we need to
1580 // switch the owner to the person who did the copying
1581 // Second Life copies an object and duplicates the first one in it's place
1582 // So, we have to make a copy of this one, set it in it's place then set the owner on this one
1583 if (userExposed)
1584 {
1585 SetRootPartOwner(m_rootPart, cAgentID, cGroupID);
1586 m_rootPart.ScheduleFullUpdate();
1587 }
1588
1589 List<SceneObjectPart> partList; 1581 List<SceneObjectPart> partList;
1590 1582
1591 lock (m_parts) 1583 lock (m_parts)
@@ -1606,12 +1598,6 @@ namespace OpenSim.Region.Framework.Scenes
1606 SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed); 1598 SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
1607 1599
1608 newPart.LinkNum = part.LinkNum; 1600 newPart.LinkNum = part.LinkNum;
1609
1610 if (userExposed)
1611 {
1612 SetPartOwner(newPart, cAgentID, cGroupID);
1613 newPart.ScheduleFullUpdate();
1614 }
1615 } 1601 }
1616 } 1602 }
1617 1603
@@ -3595,7 +3581,7 @@ namespace OpenSim.Region.Framework.Scenes
3595 3581
3596 public virtual ISceneObject CloneForNewScene() 3582 public virtual ISceneObject CloneForNewScene()
3597 { 3583 {
3598 SceneObjectGroup sog = Copy(this.OwnerID, this.GroupID, false); 3584 SceneObjectGroup sog = Copy(false);
3599 sog.m_isDeleted = false; 3585 sog.m_isDeleted = false;
3600 return sog; 3586 return sog;
3601 } 3587 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 866bb6e..3a8f168 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -31,6 +31,7 @@ using System.IO;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.Collections; 32using System.Collections;
33using System.Reflection; 33using System.Reflection;
34using System.Threading;
34using OpenMetaverse; 35using OpenMetaverse;
35using log4net; 36using log4net;
36using OpenSim.Framework; 37using OpenSim.Framework;
@@ -200,6 +201,7 @@ namespace OpenSim.Region.Framework.Scenes
200 if ((int)InventoryType.LSL == item.InvType) 201 if ((int)InventoryType.LSL == item.InvType)
201 { 202 {
202 CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); 203 CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
204 Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug
203 } 205 }
204 } 206 }
205 } 207 }
@@ -257,7 +259,7 @@ namespace OpenSim.Region.Framework.Scenes
257 // m_log.InfoFormat( 259 // m_log.InfoFormat(
258 // "[PRIM INVENTORY]: " + 260 // "[PRIM INVENTORY]: " +
259 // "Starting script {0}, {1} in prim {2}, {3}", 261 // "Starting script {0}, {1} in prim {2}, {3}",
260 // item.Name, item.ItemID, Name, UUID); 262 // item.Name, item.ItemID, m_part.Name, m_part.UUID);
261 263
262 if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) 264 if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
263 return; 265 return;
@@ -293,20 +295,20 @@ namespace OpenSim.Region.Framework.Scenes
293 } 295 }
294 else 296 else
295 { 297 {
296 if (m_part.ParentGroup.m_savedScriptState != null)
297 RestoreSavedScriptState(item.OldItemID, item.ItemID);
298
299 lock (m_items) 298 lock (m_items)
300 { 299 {
300 if (m_part.ParentGroup.m_savedScriptState != null)
301 RestoreSavedScriptState(item.OldItemID, item.ItemID);
302
301 m_items[item.ItemID].PermsMask = 0; 303 m_items[item.ItemID].PermsMask = 0;
302 m_items[item.ItemID].PermsGranter = UUID.Zero; 304 m_items[item.ItemID].PermsGranter = UUID.Zero;
305
306 string script = Utils.BytesToString(asset.Data);
307 m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
308 m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
309 m_part.ParentGroup.AddActiveScriptCount(1);
310 m_part.ScheduleFullUpdate();
303 } 311 }
304
305 string script = Utils.BytesToString(asset.Data);
306 m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
307 m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
308 m_part.ParentGroup.AddActiveScriptCount(1);
309 m_part.ScheduleFullUpdate();
310 } 312 }
311 } 313 }
312 } 314 }