diff options
15 files changed, 117 insertions, 107 deletions
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs index cac8cac..1b93176 100644 --- a/OpenSim/Data/Tests/RegionTests.cs +++ b/OpenSim/Data/Tests/RegionTests.cs | |||
@@ -297,7 +297,6 @@ namespace OpenSim.Data.Tests | |||
297 | pbshap.ProfileEnd = ushort.MaxValue; | 297 | pbshap.ProfileEnd = ushort.MaxValue; |
298 | pbshap.ProfileHollow = ushort.MaxValue; | 298 | pbshap.ProfileHollow = ushort.MaxValue; |
299 | Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); | 299 | Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); |
300 | byte updatef = (byte) random.Next(127); | ||
301 | 300 | ||
302 | RegionInfo regionInfo = new RegionInfo(); | 301 | RegionInfo regionInfo = new RegionInfo(); |
303 | regionInfo.RegionID = region3; | 302 | regionInfo.RegionID = region3; |
@@ -336,7 +335,6 @@ namespace OpenSim.Data.Tests | |||
336 | sop.LinkNum = linknum; | 335 | sop.LinkNum = linknum; |
337 | sop.ClickAction = clickaction; | 336 | sop.ClickAction = clickaction; |
338 | sop.Scale = scale; | 337 | sop.Scale = scale; |
339 | sop.UpdateFlag = updatef; | ||
340 | 338 | ||
341 | //Tests if local part accepted the parameters: | 339 | //Tests if local part accepted the parameters: |
342 | Assert.That(regionh,Is.EqualTo(sop.RegionHandle), "Assert.That(regionh,Is.EqualTo(sop.RegionHandle))"); | 340 | Assert.That(regionh,Is.EqualTo(sop.RegionHandle), "Assert.That(regionh,Is.EqualTo(sop.RegionHandle))"); |
@@ -369,7 +367,6 @@ namespace OpenSim.Data.Tests | |||
369 | Assert.That(linknum,Is.EqualTo(sop.LinkNum), "Assert.That(linknum,Is.EqualTo(sop.LinkNum))"); | 367 | Assert.That(linknum,Is.EqualTo(sop.LinkNum), "Assert.That(linknum,Is.EqualTo(sop.LinkNum))"); |
370 | Assert.That(clickaction,Is.EqualTo(sop.ClickAction), "Assert.That(clickaction,Is.EqualTo(sop.ClickAction))"); | 368 | Assert.That(clickaction,Is.EqualTo(sop.ClickAction), "Assert.That(clickaction,Is.EqualTo(sop.ClickAction))"); |
371 | Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))"); | 369 | Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))"); |
372 | Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))"); | ||
373 | 370 | ||
374 | // This is necessary or object will not be inserted in DB | 371 | // This is necessary or object will not be inserted in DB |
375 | sop.Flags = PrimFlags.None; | 372 | sop.Flags = PrimFlags.None; |
@@ -469,7 +466,6 @@ namespace OpenSim.Data.Tests | |||
469 | PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); | 466 | PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); |
470 | pbshap = PrimitiveBaseShape.Default; | 467 | pbshap = PrimitiveBaseShape.Default; |
471 | Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); | 468 | Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); |
472 | byte updatef = (byte) random.Next(127); | ||
473 | 469 | ||
474 | // Updates the region with new values | 470 | // Updates the region with new values |
475 | SceneObjectGroup sog2 = FindSOG("Adam West", region3); | 471 | SceneObjectGroup sog2 = FindSOG("Adam West", region3); |
@@ -499,7 +495,6 @@ namespace OpenSim.Data.Tests | |||
499 | sog2.RootPart.LinkNum = linknum; | 495 | sog2.RootPart.LinkNum = linknum; |
500 | sog2.RootPart.ClickAction = clickaction; | 496 | sog2.RootPart.ClickAction = clickaction; |
501 | sog2.RootPart.Scale = scale; | 497 | sog2.RootPart.Scale = scale; |
502 | sog2.RootPart.UpdateFlag = updatef; | ||
503 | 498 | ||
504 | db.StoreObject(sog2, region3); | 499 | db.StoreObject(sog2, region3); |
505 | List<SceneObjectGroup> sogs = db.LoadObjects(region3); | 500 | List<SceneObjectGroup> sogs = db.LoadObjects(region3); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs index c07fc73..e4bacd4 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs | |||
@@ -332,7 +332,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
332 | 332 | ||
333 | grp.IsAttachment = false; | 333 | grp.IsAttachment = false; |
334 | // Required for linking | 334 | // Required for linking |
335 | grp.RootPart.UpdateFlag = 0; | 335 | grp.RootPart.ClearUpdateSchedule(); |
336 | 336 | ||
337 | if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos)) | 337 | if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos)) |
338 | { | 338 | { |
@@ -345,8 +345,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
345 | 345 | ||
346 | for (int j = 1; j < allparts.Length; j++) | 346 | for (int j = 1; j < allparts.Length; j++) |
347 | { | 347 | { |
348 | rootGroup.RootPart.UpdateFlag = 0; | 348 | // Required for linking |
349 | allparts[j].RootPart.UpdateFlag = 0; | 349 | rootGroup.RootPart.ClearUpdateSchedule(); |
350 | allparts[j].RootPart.ClearUpdateSchedule(); | ||
350 | rootGroup.LinkToGroup(allparts[j]); | 351 | rootGroup.LinkToGroup(allparts[j]); |
351 | } | 352 | } |
352 | 353 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 236a47c..07d1cb3 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -169,6 +169,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
169 | 169 | ||
170 | public bool SendAppearance(UUID agentId) | 170 | public bool SendAppearance(UUID agentId) |
171 | { | 171 | { |
172 | // m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId); | ||
173 | |||
172 | ScenePresence sp = m_scene.GetScenePresence(agentId); | 174 | ScenePresence sp = m_scene.GetScenePresence(agentId); |
173 | if (sp == null) | 175 | if (sp == null) |
174 | { | 176 | { |
@@ -257,7 +259,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
257 | /// </summary> | 259 | /// </summary> |
258 | public void QueueAppearanceSend(UUID agentid) | 260 | public void QueueAppearanceSend(UUID agentid) |
259 | { | 261 | { |
260 | // m_log.WarnFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); | 262 | // m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); |
261 | 263 | ||
262 | // 10000 ticks per millisecond, 1000 milliseconds per second | 264 | // 10000 ticks per millisecond, 1000 milliseconds per second |
263 | long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 1000 * 10000); | 265 | long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 1000 * 10000); |
@@ -393,10 +395,17 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
393 | Dictionary<UUID, long> sends = new Dictionary<UUID, long>(m_sendqueue); | 395 | Dictionary<UUID, long> sends = new Dictionary<UUID, long>(m_sendqueue); |
394 | foreach (KeyValuePair<UUID, long> kvp in sends) | 396 | foreach (KeyValuePair<UUID, long> kvp in sends) |
395 | { | 397 | { |
396 | if (kvp.Value < now) | 398 | // We have to load the key and value into local parameters to avoid a race condition if we loop |
399 | // around and load kvp with a different value before FireAndForget has launched its thread. | ||
400 | UUID avatarID = kvp.Key; | ||
401 | long sendTime = kvp.Value; | ||
402 | |||
403 | // m_log.DebugFormat("[AVFACTORY]: Handling queued appearance updates for {0}, update delta to now is {1}", avatarID, sendTime - now); | ||
404 | |||
405 | if (sendTime < now) | ||
397 | { | 406 | { |
398 | Util.FireAndForget(delegate(object o) { SendAppearance(kvp.Key); }); | 407 | Util.FireAndForget(o => SendAppearance(avatarID)); |
399 | m_sendqueue.Remove(kvp.Key); | 408 | m_sendqueue.Remove(avatarID); |
400 | } | 409 | } |
401 | } | 410 | } |
402 | } | 411 | } |
@@ -406,10 +415,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
406 | Dictionary<UUID, long> saves = new Dictionary<UUID, long>(m_savequeue); | 415 | Dictionary<UUID, long> saves = new Dictionary<UUID, long>(m_savequeue); |
407 | foreach (KeyValuePair<UUID, long> kvp in saves) | 416 | foreach (KeyValuePair<UUID, long> kvp in saves) |
408 | { | 417 | { |
409 | if (kvp.Value < now) | 418 | // We have to load the key and value into local parameters to avoid a race condition if we loop |
419 | // around and load kvp with a different value before FireAndForget has launched its thread. | ||
420 | UUID avatarID = kvp.Key; | ||
421 | long sendTime = kvp.Value; | ||
422 | |||
423 | if (sendTime < now) | ||
410 | { | 424 | { |
411 | Util.FireAndForget(delegate(object o) { SaveAppearance(kvp.Key); }); | 425 | Util.FireAndForget(o => SaveAppearance(avatarID)); |
412 | m_savequeue.Remove(kvp.Key); | 426 | m_savequeue.Remove(avatarID); |
413 | } | 427 | } |
414 | } | 428 | } |
415 | } | 429 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 7324b26..7251bd8 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1714,7 +1714,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1714 | //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); | 1714 | //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); |
1715 | 1715 | ||
1716 | bool successYN = false; | 1716 | bool successYN = false; |
1717 | grp.RootPart.UpdateFlag = 0; | 1717 | grp.RootPart.ClearUpdateSchedule(); |
1718 | //int primcrossingXMLmethod = 0; | 1718 | //int primcrossingXMLmethod = 0; |
1719 | 1719 | ||
1720 | if (destination != null) | 1720 | if (destination != null) |
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 6075e19..f2c8b3d 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -395,9 +395,11 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
395 | { | 395 | { |
396 | result = OpenJPEG.EncodeFromImage(joint, true); | 396 | result = OpenJPEG.EncodeFromImage(joint, true); |
397 | } | 397 | } |
398 | catch (Exception) | 398 | catch (Exception e) |
399 | { | 399 | { |
400 | m_log.Error("[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); | 400 | m_log.ErrorFormat( |
401 | "[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Exception {0}{1}", | ||
402 | e.Message, e.StackTrace); | ||
401 | } | 403 | } |
402 | 404 | ||
403 | return result; | 405 | return result; |
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 7316e5b..c061868 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -338,10 +338,11 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
338 | { | 338 | { |
339 | imageJ2000 = OpenJPEG.EncodeFromImage(bitmap, true); | 339 | imageJ2000 = OpenJPEG.EncodeFromImage(bitmap, true); |
340 | } | 340 | } |
341 | catch (Exception) | 341 | catch (Exception e) |
342 | { | 342 | { |
343 | m_log.Error( | 343 | m_log.ErrorFormat( |
344 | "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); | 344 | "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Exception {0}{1}", |
345 | e.Message, e.StackTrace); | ||
345 | } | 346 | } |
346 | 347 | ||
347 | m_textureManager.ReturnData(id, imageJ2000); | 348 | m_textureManager.ReturnData(id, imageJ2000); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1af18e7..82ded28 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1799,7 +1799,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1799 | newSet.RemoveAt(0); | 1799 | newSet.RemoveAt(0); |
1800 | 1800 | ||
1801 | foreach (SceneObjectPart newChild in newSet) | 1801 | foreach (SceneObjectPart newChild in newSet) |
1802 | newChild.UpdateFlag = 0; | 1802 | newChild.ClearUpdateSchedule(); |
1803 | 1803 | ||
1804 | LinkObjects(newRoot, newSet); | 1804 | LinkObjects(newRoot, newSet); |
1805 | if (!affectedGroups.Contains(newRoot.ParentGroup)) | 1805 | if (!affectedGroups.Contains(newRoot.ParentGroup)) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 2ea9854..a0a7344 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1157,7 +1157,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1157 | 1157 | ||
1158 | if (!silent) | 1158 | if (!silent) |
1159 | { | 1159 | { |
1160 | part.UpdateFlag = 0; | 1160 | part.ClearUpdateSchedule(); |
1161 | if (part == m_rootPart) | 1161 | if (part == m_rootPart) |
1162 | { | 1162 | { |
1163 | if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) || | 1163 | if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) || |
@@ -1735,13 +1735,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1735 | 1735 | ||
1736 | if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) | 1736 | if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) |
1737 | { | 1737 | { |
1738 | m_rootPart.UpdateFlag = 1; | 1738 | m_rootPart.UpdateFlag = UpdateRequired.TERSE; |
1739 | lastPhysGroupPos = AbsolutePosition; | 1739 | lastPhysGroupPos = AbsolutePosition; |
1740 | } | 1740 | } |
1741 | 1741 | ||
1742 | if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) | 1742 | if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) |
1743 | { | 1743 | { |
1744 | m_rootPart.UpdateFlag = 1; | 1744 | m_rootPart.UpdateFlag = UpdateRequired.TERSE; |
1745 | lastPhysGroupRot = GroupRotation; | 1745 | lastPhysGroupRot = GroupRotation; |
1746 | } | 1746 | } |
1747 | 1747 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b68cc9f..44f822c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -106,6 +106,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
106 | SCULPT = 7 | 106 | SCULPT = 7 |
107 | } | 107 | } |
108 | 108 | ||
109 | public enum UpdateRequired : byte | ||
110 | { | ||
111 | NONE = 0, | ||
112 | TERSE = 1, | ||
113 | FULL = 2 | ||
114 | } | ||
115 | |||
109 | #endregion Enumerations | 116 | #endregion Enumerations |
110 | 117 | ||
111 | public class SceneObjectPart : IScriptHost, ISceneEntity | 118 | public class SceneObjectPart : IScriptHost, ISceneEntity |
@@ -254,15 +261,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
254 | 261 | ||
255 | private bool m_passTouches; | 262 | private bool m_passTouches; |
256 | 263 | ||
257 | /// <summary> | 264 | private UpdateRequired m_updateFlag; |
258 | /// Only used internally to schedule client updates. | ||
259 | /// 0 - no update is scheduled | ||
260 | /// 1 - terse update scheduled | ||
261 | /// 2 - full update scheduled | ||
262 | /// | ||
263 | /// TODO - This should be an enumeration | ||
264 | /// </summary> | ||
265 | private byte m_updateFlag; | ||
266 | 265 | ||
267 | private PhysicsActor m_physActor; | 266 | private PhysicsActor m_physActor; |
268 | protected Vector3 m_acceleration; | 267 | protected Vector3 m_acceleration; |
@@ -884,7 +883,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
884 | } | 883 | } |
885 | } | 884 | } |
886 | 885 | ||
887 | /// <summary></summary> | 886 | /// <summary>Update angular velocity and schedule terse update.</summary> |
887 | public void UpdateAngularVelocity(Vector3 avel) | ||
888 | { | ||
889 | AngularVelocity = avel; | ||
890 | ScheduleTerseUpdate(); | ||
891 | ParentGroup.HasGroupChanged = true; | ||
892 | } | ||
893 | |||
894 | /// <summary>Get or set angular velocity. Does not schedule update.</summary> | ||
888 | public Vector3 AngularVelocity | 895 | public Vector3 AngularVelocity |
889 | { | 896 | { |
890 | get | 897 | get |
@@ -1023,8 +1030,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1023 | TriggerScriptChangedEvent(Changed.SCALE); | 1030 | TriggerScriptChangedEvent(Changed.SCALE); |
1024 | } | 1031 | } |
1025 | } | 1032 | } |
1026 | 1033 | ||
1027 | public byte UpdateFlag | 1034 | public UpdateRequired UpdateFlag |
1028 | { | 1035 | { |
1029 | get { return m_updateFlag; } | 1036 | get { return m_updateFlag; } |
1030 | set { m_updateFlag = value; } | 1037 | set { m_updateFlag = value; } |
@@ -1309,9 +1316,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1309 | /// <summary> | 1316 | /// <summary> |
1310 | /// Clear all pending updates of parts to clients | 1317 | /// Clear all pending updates of parts to clients |
1311 | /// </summary> | 1318 | /// </summary> |
1312 | private void ClearUpdateSchedule() | 1319 | public void ClearUpdateSchedule() |
1313 | { | 1320 | { |
1314 | m_updateFlag = 0; | 1321 | UpdateFlag = UpdateRequired.NONE; |
1315 | } | 1322 | } |
1316 | 1323 | ||
1317 | /// <summary> | 1324 | /// <summary> |
@@ -2829,7 +2836,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2829 | TimeStampFull = (uint)timeNow; | 2836 | TimeStampFull = (uint)timeNow; |
2830 | } | 2837 | } |
2831 | 2838 | ||
2832 | m_updateFlag = 2; | 2839 | UpdateFlag = UpdateRequired.FULL; |
2833 | 2840 | ||
2834 | // m_log.DebugFormat( | 2841 | // m_log.DebugFormat( |
2835 | // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", | 2842 | // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", |
@@ -2845,13 +2852,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2845 | if (m_parentGroup == null) | 2852 | if (m_parentGroup == null) |
2846 | return; | 2853 | return; |
2847 | 2854 | ||
2848 | if (m_updateFlag < 1) | 2855 | if (UpdateFlag == UpdateRequired.NONE) |
2849 | { | 2856 | { |
2850 | m_parentGroup.HasGroupChanged = true; | 2857 | m_parentGroup.HasGroupChanged = true; |
2851 | m_parentGroup.QueueForUpdateCheck(); | 2858 | m_parentGroup.QueueForUpdateCheck(); |
2852 | 2859 | ||
2853 | TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); | 2860 | TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); |
2854 | m_updateFlag = 1; | 2861 | UpdateFlag = UpdateRequired.TERSE; |
2855 | 2862 | ||
2856 | // m_log.DebugFormat( | 2863 | // m_log.DebugFormat( |
2857 | // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", | 2864 | // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", |
@@ -3018,45 +3025,39 @@ namespace OpenSim.Region.Framework.Scenes | |||
3018 | const float POSITION_TOLERANCE = 0.05f; | 3025 | const float POSITION_TOLERANCE = 0.05f; |
3019 | const int TIME_MS_TOLERANCE = 3000; | 3026 | const int TIME_MS_TOLERANCE = 3000; |
3020 | 3027 | ||
3021 | if (m_updateFlag == 1) | 3028 | switch (UpdateFlag) |
3022 | { | 3029 | { |
3023 | // Throw away duplicate or insignificant updates | 3030 | case UpdateRequired.TERSE: |
3024 | if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || | ||
3025 | !Acceleration.Equals(m_lastAcceleration) || | ||
3026 | !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || | ||
3027 | Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) || | ||
3028 | !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) || | ||
3029 | !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || | ||
3030 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) | ||
3031 | { | 3031 | { |
3032 | AddTerseUpdateToAllAvatars(); | 3032 | // Throw away duplicate or insignificant updates |
3033 | ClearUpdateSchedule(); | 3033 | if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || |
3034 | 3034 | !Acceleration.Equals(m_lastAcceleration) || | |
3035 | // This causes the Scene to 'poll' physical objects every couple of frames | 3035 | !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || |
3036 | // bad, so it's been replaced by an event driven method. | 3036 | Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) || |
3037 | //if ((ObjectFlags & (uint)PrimFlags.Physics) != 0) | 3037 | !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) || |
3038 | //{ | 3038 | !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || |
3039 | // Only send the constant terse updates on physical objects! | 3039 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) |
3040 | //ScheduleTerseUpdate(); | 3040 | { |
3041 | //} | 3041 | AddTerseUpdateToAllAvatars(); |
3042 | 3042 | ClearUpdateSchedule(); | |
3043 | // Update the "last" values | 3043 | |
3044 | m_lastPosition = OffsetPosition; | 3044 | // Update the "last" values |
3045 | m_lastRotation = RotationOffset; | 3045 | m_lastPosition = OffsetPosition; |
3046 | m_lastVelocity = Velocity; | 3046 | m_lastRotation = RotationOffset; |
3047 | m_lastAcceleration = Acceleration; | 3047 | m_lastVelocity = Velocity; |
3048 | m_lastAngularVelocity = AngularVelocity; | 3048 | m_lastAcceleration = Acceleration; |
3049 | m_lastTerseSent = Environment.TickCount; | 3049 | m_lastAngularVelocity = AngularVelocity; |
3050 | m_lastTerseSent = Environment.TickCount; | ||
3051 | } | ||
3052 | break; | ||
3050 | } | 3053 | } |
3051 | } | 3054 | case UpdateRequired.FULL: |
3052 | else | ||
3053 | { | ||
3054 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes | ||
3055 | { | 3055 | { |
3056 | AddFullUpdateToAllAvatars(); | 3056 | AddFullUpdateToAllAvatars(); |
3057 | ClearUpdateSchedule(); | 3057 | break; |
3058 | } | 3058 | } |
3059 | } | 3059 | } |
3060 | |||
3060 | ClearUpdateSchedule(); | 3061 | ClearUpdateSchedule(); |
3061 | } | 3062 | } |
3062 | 3063 | ||
@@ -3436,7 +3437,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3436 | _groupID = groupID; | 3437 | _groupID = groupID; |
3437 | if (client != null) | 3438 | if (client != null) |
3438 | SendPropertiesToClient(client); | 3439 | SendPropertiesToClient(client); |
3439 | m_updateFlag = 2; | 3440 | UpdateFlag = UpdateRequired.FULL; |
3440 | } | 3441 | } |
3441 | 3442 | ||
3442 | /// <summary> | 3443 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 29966f9..1d77b06 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2628,7 +2628,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2628 | /// </summary> | 2628 | /// </summary> |
2629 | public void SendAppearanceToAllOtherAgents() | 2629 | public void SendAppearanceToAllOtherAgents() |
2630 | { | 2630 | { |
2631 | //m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} ({1})", Name, UUID); | 2631 | // m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} {1}", Name, UUID); |
2632 | |||
2632 | // only send update from root agents to other clients; children are only "listening posts" | 2633 | // only send update from root agents to other clients; children are only "listening posts" |
2633 | if (IsChildAgent) | 2634 | if (IsChildAgent) |
2634 | { | 2635 | { |
@@ -2656,7 +2657,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2656 | /// </summary> | 2657 | /// </summary> |
2657 | public void SendOtherAgentsAppearanceToMe() | 2658 | public void SendOtherAgentsAppearanceToMe() |
2658 | { | 2659 | { |
2659 | //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID); | 2660 | // m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID); |
2660 | 2661 | ||
2661 | int count = 0; | 2662 | int count = 0; |
2662 | m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) | 2663 | m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) |
@@ -3211,7 +3212,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3211 | foreach (ISceneObject so in cAgent.AttachmentObjects) | 3212 | foreach (ISceneObject so in cAgent.AttachmentObjects) |
3212 | { | 3213 | { |
3213 | ((SceneObjectGroup)so).LocalId = 0; | 3214 | ((SceneObjectGroup)so).LocalId = 0; |
3214 | ((SceneObjectGroup)so).RootPart.UpdateFlag = 0; | 3215 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); |
3215 | so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); | 3216 | so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); |
3216 | m_scene.IncomingCreateObject(so); | 3217 | m_scene.IncomingCreateObject(so); |
3217 | } | 3218 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index e06a222..60cc788 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -316,7 +316,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
316 | m_SOPXmlProcessors.Add("ClickAction", ProcessClickAction); | 316 | m_SOPXmlProcessors.Add("ClickAction", ProcessClickAction); |
317 | m_SOPXmlProcessors.Add("Shape", ProcessShape); | 317 | m_SOPXmlProcessors.Add("Shape", ProcessShape); |
318 | m_SOPXmlProcessors.Add("Scale", ProcessScale); | 318 | m_SOPXmlProcessors.Add("Scale", ProcessScale); |
319 | m_SOPXmlProcessors.Add("UpdateFlag", ProcessUpdateFlag); | ||
320 | m_SOPXmlProcessors.Add("SitTargetOrientation", ProcessSitTargetOrientation); | 319 | m_SOPXmlProcessors.Add("SitTargetOrientation", ProcessSitTargetOrientation); |
321 | m_SOPXmlProcessors.Add("SitTargetPosition", ProcessSitTargetPosition); | 320 | m_SOPXmlProcessors.Add("SitTargetPosition", ProcessSitTargetPosition); |
322 | m_SOPXmlProcessors.Add("SitTargetPositionLL", ProcessSitTargetPositionLL); | 321 | m_SOPXmlProcessors.Add("SitTargetPositionLL", ProcessSitTargetPositionLL); |
@@ -584,11 +583,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
584 | obj.Scale = Util.ReadVector(reader, "Scale"); | 583 | obj.Scale = Util.ReadVector(reader, "Scale"); |
585 | } | 584 | } |
586 | 585 | ||
587 | private static void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader) | ||
588 | { | ||
589 | obj.UpdateFlag = (byte)reader.ReadElementContentAsInt("UpdateFlag", String.Empty); | ||
590 | } | ||
591 | |||
592 | private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader) | 586 | private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader) |
593 | { | 587 | { |
594 | obj.SitTargetOrientation = Util.ReadQuaternion(reader, "SitTargetOrientation"); | 588 | obj.SitTargetOrientation = Util.ReadQuaternion(reader, "SitTargetOrientation"); |
@@ -1187,7 +1181,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1187 | WriteShape(writer, sop.Shape, options); | 1181 | WriteShape(writer, sop.Shape, options); |
1188 | 1182 | ||
1189 | WriteVector(writer, "Scale", sop.Scale); | 1183 | WriteVector(writer, "Scale", sop.Scale); |
1190 | writer.WriteElementString("UpdateFlag", sop.UpdateFlag.ToString()); | ||
1191 | WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation); | 1184 | WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation); |
1192 | WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition); | 1185 | WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition); |
1193 | WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL); | 1186 | WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 90cdd7b..a2332bb 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -70,8 +70,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
70 | grp2.UpdateGroupRotationR(Quaternion.CreateFromEulers(180 * Utils.DEG_TO_RAD, 0, 0)); | 70 | grp2.UpdateGroupRotationR(Quaternion.CreateFromEulers(180 * Utils.DEG_TO_RAD, 0, 0)); |
71 | 71 | ||
72 | // Required for linking | 72 | // Required for linking |
73 | grp1.RootPart.UpdateFlag = 0; | 73 | grp1.RootPart.ClearUpdateSchedule(); |
74 | grp2.RootPart.UpdateFlag = 0; | 74 | grp2.RootPart.ClearUpdateSchedule(); |
75 | 75 | ||
76 | // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated. | 76 | // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated. |
77 | grp1.LinkToGroup(grp2); | 77 | grp1.LinkToGroup(grp2); |
@@ -164,10 +164,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
164 | grp4.UpdateGroupRotationR(Quaternion.CreateFromEulers(0, 90 * Utils.DEG_TO_RAD, 0)); | 164 | grp4.UpdateGroupRotationR(Quaternion.CreateFromEulers(0, 90 * Utils.DEG_TO_RAD, 0)); |
165 | 165 | ||
166 | // Required for linking | 166 | // Required for linking |
167 | grp1.RootPart.UpdateFlag = 0; | 167 | grp1.RootPart.ClearUpdateSchedule(); |
168 | grp2.RootPart.UpdateFlag = 0; | 168 | grp2.RootPart.ClearUpdateSchedule(); |
169 | grp3.RootPart.UpdateFlag = 0; | 169 | grp3.RootPart.ClearUpdateSchedule(); |
170 | grp4.RootPart.UpdateFlag = 0; | 170 | grp4.RootPart.ClearUpdateSchedule(); |
171 | 171 | ||
172 | // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated. | 172 | // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated. |
173 | grp1.LinkToGroup(grp2); | 173 | grp1.LinkToGroup(grp2); |
@@ -198,8 +198,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
198 | } | 198 | } |
199 | 199 | ||
200 | // Required for linking | 200 | // Required for linking |
201 | grp1.RootPart.UpdateFlag = 0; | 201 | grp1.RootPart.ClearUpdateSchedule(); |
202 | grp3.RootPart.UpdateFlag = 0; | 202 | grp3.RootPart.ClearUpdateSchedule(); |
203 | 203 | ||
204 | // root part should have no offset position or rotation | 204 | // root part should have no offset position or rotation |
205 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, | 205 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, |
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs index d34d8e5..860172c 100644 --- a/OpenSim/Region/Framework/Scenes/UndoState.cs +++ b/OpenSim/Region/Framework/Scenes/UndoState.cs | |||
@@ -158,6 +158,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
158 | } | 158 | } |
159 | else | 159 | else |
160 | { | 160 | { |
161 | // Note: Updating these properties on sop automatically schedules an update if needed | ||
161 | if (Position != Vector3.Zero) | 162 | if (Position != Vector3.Zero) |
162 | { | 163 | { |
163 | // m_log.DebugFormat( | 164 | // m_log.DebugFormat( |
@@ -181,8 +182,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
181 | 182 | ||
182 | part.Resize(Scale); | 183 | part.Resize(Scale); |
183 | } | 184 | } |
184 | |||
185 | part.ScheduleTerseUpdate(); | ||
186 | } | 185 | } |
187 | 186 | ||
188 | part.Undoing = false; | 187 | part.Undoing = false; |
@@ -212,6 +211,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
212 | } | 211 | } |
213 | else | 212 | else |
214 | { | 213 | { |
214 | // Note: Updating these properties on sop automatically schedules an update if needed | ||
215 | if (Position != Vector3.Zero) | 215 | if (Position != Vector3.Zero) |
216 | part.OffsetPosition = Position; | 216 | part.OffsetPosition = Position; |
217 | 217 | ||
@@ -220,8 +220,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
220 | 220 | ||
221 | if (Scale != Vector3.Zero) | 221 | if (Scale != Vector3.Zero) |
222 | part.Resize(Scale); | 222 | part.Resize(Scale); |
223 | |||
224 | part.ScheduleTerseUpdate(); | ||
225 | } | 223 | } |
226 | 224 | ||
227 | part.Undoing = false; | 225 | part.Undoing = false; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a51a88b..0750579 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3351,10 +3351,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3351 | 3351 | ||
3352 | protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain) | 3352 | protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain) |
3353 | { | 3353 | { |
3354 | part.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); | 3354 | part.UpdateAngularVelocity(new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate))); |
3355 | part.ScheduleTerseUpdate(); | ||
3356 | part.SendTerseUpdateToAllClients(); | ||
3357 | part.ParentGroup.HasGroupChanged = true; | ||
3358 | } | 3355 | } |
3359 | 3356 | ||
3360 | public LSL_Integer llGetStartParameter() | 3357 | public LSL_Integer llGetStartParameter() |
@@ -3616,11 +3613,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3616 | parentPrim = targetPart.ParentGroup; | 3613 | parentPrim = targetPart.ParentGroup; |
3617 | childPrim = m_host.ParentGroup; | 3614 | childPrim = m_host.ParentGroup; |
3618 | } | 3615 | } |
3619 | // byte uf = childPrim.RootPart.UpdateFlag; | 3616 | |
3620 | childPrim.RootPart.UpdateFlag = 0; | 3617 | // Required for linking |
3618 | childPrim.RootPart.ClearUpdateSchedule(); | ||
3621 | parentPrim.LinkToGroup(childPrim); | 3619 | parentPrim.LinkToGroup(childPrim); |
3622 | // if (uf != (Byte)0) | ||
3623 | // parent.RootPart.UpdateFlag = uf; | ||
3624 | } | 3620 | } |
3625 | 3621 | ||
3626 | parentPrim.TriggerScriptChangedEvent(Changed.LINK); | 3622 | parentPrim.TriggerScriptChangedEvent(Changed.LINK); |
@@ -3701,7 +3697,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3701 | parts.Remove(newRoot); | 3697 | parts.Remove(newRoot); |
3702 | foreach (SceneObjectPart part in parts) | 3698 | foreach (SceneObjectPart part in parts) |
3703 | { | 3699 | { |
3704 | part.UpdateFlag = 0; | 3700 | // Required for linking |
3701 | part.ClearUpdateSchedule(); | ||
3705 | newRoot.ParentGroup.LinkToGroup(part.ParentGroup); | 3702 | newRoot.ParentGroup.LinkToGroup(part.ParentGroup); |
3706 | } | 3703 | } |
3707 | newRoot.ParentGroup.HasGroupChanged = true; | 3704 | newRoot.ParentGroup.HasGroupChanged = true; |
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index 36e6665..aeba35f 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs | |||
@@ -266,7 +266,14 @@ namespace OpenSim.Server.Base | |||
266 | { | 266 | { |
267 | while (m_Running) | 267 | while (m_Running) |
268 | { | 268 | { |
269 | MainConsole.Instance.Prompt(); | 269 | try |
270 | { | ||
271 | MainConsole.Instance.Prompt(); | ||
272 | } | ||
273 | catch (Exception e) | ||
274 | { | ||
275 | m_log.ErrorFormat("Command error: {0}", e); | ||
276 | } | ||
270 | } | 277 | } |
271 | 278 | ||
272 | if (m_pidFile != String.Empty) | 279 | if (m_pidFile != String.Empty) |