aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2010-08-26 23:39:20 +0100
committerMelanie2010-08-26 23:39:20 +0100
commit1f1d72eba5ca2b1e4115e93af1ed88950dce585a (patch)
tree2dfcb626f9eb5fc6244b9fe7dac4b46a9c587703 /OpenSim/Region/Framework
parentSend a null result search packet when no results are passsed in (diff)
parentMore on mantis #4985 (diff)
downloadopensim-SC-1f1d72eba5ca2b1e4115e93af1ed88950dce585a.zip
opensim-SC-1f1d72eba5ca2b1e4115e93af1ed88950dce585a.tar.gz
opensim-SC-1f1d72eba5ca2b1e4115e93af1ed88950dce585a.tar.bz2
opensim-SC-1f1d72eba5ca2b1e4115e93af1ed88950dce585a.tar.xz
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs21
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs47
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs39
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs8
9 files changed, 48 insertions, 112 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index 2af2548..05c1e00 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -131,5 +131,13 @@ namespace OpenSim.Region.Framework.Interfaces
131 /// A <see cref="IClientAPI"/> 131 /// A <see cref="IClientAPI"/>
132 /// </param> 132 /// </param>
133 void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient); 133 void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
134
135 /// <summary>
136 /// Update the position of an attachment
137 /// </summary>
138 /// <param name="client"></param>
139 /// <param name="sog"></param>
140 /// <param name="pos"></param>
141 void UpdateAttachmentPosition(IClientAPI client, SceneObjectGroup sog, Vector3 pos);
134 } 142 }
135} \ No newline at end of file 143} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index de3c360..272f718 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -31,7 +31,7 @@ namespace OpenSim.Region.Framework.Scenes
31 31
32 public class Prioritizer 32 public class Prioritizer
33 { 33 {
34 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 34// private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
35 35
36 /// <summary> 36 /// <summary>
37 /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the 37 /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the
@@ -75,7 +75,6 @@ namespace OpenSim.Region.Framework.Scenes
75 break; 75 break;
76 default: 76 default:
77 throw new InvalidOperationException("UpdatePrioritizationScheme not defined."); 77 throw new InvalidOperationException("UpdatePrioritizationScheme not defined.");
78 break;
79 } 78 }
80 79
81 // Adjust priority so that root prims are sent to the viewer first. This is especially important for 80 // Adjust priority so that root prims are sent to the viewer first. This is especially important for
@@ -122,9 +121,16 @@ namespace OpenSim.Region.Framework.Scenes
122 // Use group position for child prims 121 // Use group position for child prims
123 Vector3 entityPos; 122 Vector3 entityPos;
124 if (entity is SceneObjectPart) 123 if (entity is SceneObjectPart)
125 entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; 124 {
125 // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
126 // before its scheduled update was triggered
127 //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
128 entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
129 }
126 else 130 else
131 {
127 entityPos = entity.AbsolutePosition; 132 entityPos = entity.AbsolutePosition;
133 }
128 134
129 return Vector3.DistanceSquared(presencePos, entityPos); 135 return Vector3.DistanceSquared(presencePos, entityPos);
130 } 136 }
@@ -144,9 +150,16 @@ namespace OpenSim.Region.Framework.Scenes
144 // Use group position for child prims 150 // Use group position for child prims
145 Vector3 entityPos = entity.AbsolutePosition; 151 Vector3 entityPos = entity.AbsolutePosition;
146 if (entity is SceneObjectPart) 152 if (entity is SceneObjectPart)
147 entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; 153 {
154 // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
155 // before its scheduled update was triggered
156 //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
157 entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
158 }
148 else 159 else
160 {
149 entityPos = entity.AbsolutePosition; 161 entityPos = entity.AbsolutePosition;
162 }
150 163
151 if (!presence.IsChildAgent) 164 if (!presence.IsChildAgent)
152 { 165 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 379128a..8ed8b96 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1799,53 +1799,6 @@ namespace OpenSim.Region.Framework.Scenes
1799 } 1799 }
1800 } 1800 }
1801 1801
1802 public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID)
1803 {
1804 SceneObjectGroup objectGroup = grp;
1805 if (objectGroup != null)
1806 {
1807 if (!grp.HasGroupChanged)
1808 {
1809 m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID);
1810 return;
1811 }
1812
1813 m_log.InfoFormat(
1814 "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}",
1815 grp.UUID, grp.GetAttachmentPoint());
1816
1817 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
1818
1819 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
1820 item = InventoryService.GetItem(item);
1821
1822 if (item != null)
1823 {
1824 AssetBase asset = CreateAsset(
1825 objectGroup.GetPartName(objectGroup.LocalId),
1826 objectGroup.GetPartDescription(objectGroup.LocalId),
1827 (sbyte)AssetType.Object,
1828 Utils.StringToBytes(sceneObjectXml),
1829 remoteClient.AgentId);
1830 AssetService.Store(asset);
1831
1832 item.AssetID = asset.FullID;
1833 item.Description = asset.Description;
1834 item.Name = asset.Name;
1835 item.AssetType = asset.Type;
1836 item.InvType = (int)InventoryType.Object;
1837
1838 InventoryService.UpdateItem(item);
1839
1840 // this gets called when the agent loggs off!
1841 if (remoteClient != null)
1842 {
1843 remoteClient.SendInventoryItemCreateUpdate(item, 0);
1844 }
1845 }
1846 }
1847 }
1848
1849 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID) 1802 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID)
1850 { 1803 {
1851 itemID = UUID.Zero; 1804 itemID = UUID.Zero;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1f4d022..5fe944d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3608,18 +3608,6 @@ namespace OpenSim.Region.Framework.Scenes
3608 return true; 3608 return true;
3609 } 3609 }
3610 3610
3611 private ILandObject GetParcelAtPoint(float x, float y)
3612 {
3613 foreach (var parcel in AllParcels())
3614 {
3615 if (parcel.ContainsPoint((int)x,(int)y))
3616 {
3617 return parcel;
3618 }
3619 }
3620 return null;
3621 }
3622
3623 /// <summary> 3611 /// <summary>
3624 /// Update an AgentCircuitData object with new information 3612 /// Update an AgentCircuitData object with new information
3625 /// </summary> 3613 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index c675322..88e084e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes
70 /// <summary> 70 /// <summary>
71 /// A user will arrive shortly, set up appropriate credentials so it can connect 71 /// A user will arrive shortly, set up appropriate credentials so it can connect
72 /// </summary> 72 /// </summary>
73 public event ExpectUserDelegate OnExpectUser; 73// public event ExpectUserDelegate OnExpectUser;
74 74
75 /// <summary> 75 /// <summary>
76 /// A Prim will arrive shortly 76 /// A Prim will arrive shortly
@@ -80,7 +80,7 @@ namespace OpenSim.Region.Framework.Scenes
80 /// <summary> 80 /// <summary>
81 /// A new prim has arrived 81 /// A new prim has arrived
82 /// </summary> 82 /// </summary>
83 public event PrimCrossing OnPrimCrossingIntoRegion; 83// public event PrimCrossing OnPrimCrossingIntoRegion;
84 84
85 ///// <summary> 85 ///// <summary>
86 ///// A New Region is up and available 86 ///// A New Region is up and available
@@ -90,7 +90,7 @@ namespace OpenSim.Region.Framework.Scenes
90 /// <summary> 90 /// <summary>
91 /// We have a child agent for this avatar and we're getting a status update about it 91 /// We have a child agent for this avatar and we're getting a status update about it
92 /// </summary> 92 /// </summary>
93 public event ChildAgentUpdate OnChildAgentUpdate; 93// public event ChildAgentUpdate OnChildAgentUpdate;
94 //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; 94 //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar;
95 95
96 /// <summary> 96 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 1da4287..9db2691 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1289,37 +1289,21 @@ namespace OpenSim.Region.Framework.Scenes
1289 /// <param name="localID"></param> 1289 /// <param name="localID"></param>
1290 /// <param name="pos"></param> 1290 /// <param name="pos"></param>
1291 /// <param name="remoteClient"></param> 1291 /// <param name="remoteClient"></param>
1292 protected internal void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient) 1292 public void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient)
1293 { 1293 {
1294 SceneObjectGroup group = GetGroupByPrim(localID); 1294 SceneObjectGroup group = GetGroupByPrim(localID);
1295
1295 if (group != null) 1296 if (group != null)
1296 { 1297 {
1297
1298 // Vector3 oldPos = group.AbsolutePosition;
1299 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) 1298 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0))
1300 { 1299 {
1301 1300 if (m_parentScene.AttachmentsModule != null)
1302 // If this is an attachment, then we need to save the modified 1301 m_parentScene.AttachmentsModule.UpdateAttachmentPosition(remoteClient, group, pos);
1303 // object back into the avatar's inventory. First we save the
1304 // attachment point information, then we update the relative
1305 // positioning (which caused this method to get driven in the
1306 // first place. Then we have to mark the object as NOT an
1307 // attachment. This is necessary in order to correctly save
1308 // and retrieve GroupPosition information for the attachment.
1309 // Then we save the asset back into the appropriate inventory
1310 // entry. Finally, we restore the object's attachment status.
1311
1312 byte attachmentPoint = group.GetAttachmentPoint();
1313 group.UpdateGroupPosition(pos);
1314 group.RootPart.IsAttachment = false;
1315 group.AbsolutePosition = group.RootPart.AttachedPos;
1316 m_parentScene.UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID);
1317 group.SetAttachmentPoint(attachmentPoint);
1318
1319 } 1302 }
1320 else 1303 else
1321 { 1304 {
1322 if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos)) 1305 if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)
1306 && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos))
1323 { 1307 {
1324 group.UpdateGroupPosition(pos); 1308 group.UpdateGroupPosition(pos);
1325 } 1309 }
@@ -1328,14 +1312,19 @@ namespace OpenSim.Region.Framework.Scenes
1328 } 1312 }
1329 1313
1330 /// <summary> 1314 /// <summary>
1331 /// 1315 /// Update the texture entry of the given prim.
1332 /// </summary> 1316 /// </summary>
1317 ///
1318 /// A texture entry is an object that contains details of all the textures of the prim's face. In this case,
1319 /// the texture is given in its byte serialized form.
1320 ///
1333 /// <param name="localID"></param> 1321 /// <param name="localID"></param>
1334 /// <param name="texture"></param> 1322 /// <param name="texture"></param>
1335 /// <param name="remoteClient"></param> 1323 /// <param name="remoteClient"></param>
1336 protected internal void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) 1324 protected internal void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
1337 { 1325 {
1338 SceneObjectGroup group = GetGroupByPrim(localID); 1326 SceneObjectGroup group = GetGroupByPrim(localID);
1327
1339 if (group != null) 1328 if (group != null)
1340 { 1329 {
1341 if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId)) 1330 if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId))
@@ -1700,8 +1689,6 @@ namespace OpenSim.Region.Framework.Scenes
1700 SceneObjectPart newRoot = newSet[0]; 1689 SceneObjectPart newRoot = newSet[0];
1701 newSet.RemoveAt(0); 1690 newSet.RemoveAt(0);
1702 1691
1703 List<uint> linkIDs = new List<uint>();
1704
1705 foreach (SceneObjectPart newChild in newSet) 1692 foreach (SceneObjectPart newChild in newSet)
1706 newChild.UpdateFlag = 0; 1693 newChild.UpdateFlag = 0;
1707 1694
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2ad4223..3ed74e1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4727,20 +4727,8 @@ namespace OpenSim.Region.Framework.Scenes
4727 if (ParentGroup == null || ParentGroup.IsDeleted) 4727 if (ParentGroup == null || ParentGroup.IsDeleted)
4728 return; 4728 return;
4729 4729
4730 Vector3 lPos = OffsetPosition; 4730 if (IsAttachment && ParentGroup.RootPart != this)
4731 4731 return;
4732 if (IsAttachment)
4733 {
4734 if (ParentGroup.RootPart != this)
4735 return;
4736
4737 lPos = ParentGroup.RootPart.AttachedPos;
4738 }
4739 else
4740 {
4741 if (ParentGroup.RootPart == this)
4742 lPos = AbsolutePosition;
4743 }
4744 4732
4745 // Causes this thread to dig into the Client Thread Data. 4733 // Causes this thread to dig into the Client Thread Data.
4746 // Remember your locking here! 4734 // Remember your locking here!
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index e08fa77..d7767bd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -576,8 +576,7 @@ namespace OpenSim.Region.Framework.Scenes
576 } 576 }
577 577
578 public SceneObjectGroup GetRezReadySceneObject(TaskInventoryItem item) 578 public SceneObjectGroup GetRezReadySceneObject(TaskInventoryItem item)
579 { 579 {
580 UUID ownerID = item.OwnerID;
581 AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); 580 AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString());
582 581
583 if (null == rezAsset) 582 if (null == rezAsset)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 08c6e27..fbb3177 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2326,15 +2326,15 @@ namespace OpenSim.Region.Framework.Scenes
2326 { 2326 {
2327 m_perfMonMS = Util.EnvironmentTickCount(); 2327 m_perfMonMS = Util.EnvironmentTickCount();
2328 2328
2329 PhysicsActor actor = m_physicsActor;
2330 Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero;
2331
2332 Vector3 pos = m_pos; 2329 Vector3 pos = m_pos;
2333 pos.Z += m_appearance.HipOffset; 2330 pos.Z += m_appearance.HipOffset;
2334 2331
2335 //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); 2332 //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity);
2336 2333
2337 remoteClient.SendPrimUpdate(this, PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); 2334 remoteClient.SendPrimUpdate(
2335 this,
2336 PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
2337 | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
2338 2338
2339 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); 2339 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2340 m_scene.StatsReporter.AddAgentUpdates(1); 2340 m_scene.StatsReporter.AddAgentUpdates(1);