aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2011-11-03 00:06:14 +0000
committerMelanie2011-11-03 00:06:14 +0000
commit243acef917e8e61b9feef4587b440a77737e016e (patch)
treeaf80394d32977c53b729a395037dd080c8ffe214 /OpenSim
parentMerge branch 'master' into bigmerge (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-243acef917e8e61b9feef4587b440a77737e016e.zip
opensim-SC-243acef917e8e61b9feef4587b440a77737e016e.tar.gz
opensim-SC-243acef917e8e61b9feef4587b440a77737e016e.tar.bz2
opensim-SC-243acef917e8e61b9feef4587b440a77737e016e.tar.xz
Merge branch 'master' into bigmerge
Conflicts: OpenSim/Region/Framework/Scenes/SceneGraph.cs OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs OpenSim/Region/Framework/Scenes/SceneObjectPart.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/Tests/RegionTests.cs5
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs28
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs107
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/UndoState.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs14
-rw-r--r--OpenSim/Server/Base/ServicesServerBase.cs9
15 files changed, 120 insertions, 113 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 eff6911..d866636 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);
@@ -391,10 +393,17 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
391 Dictionary<UUID, long> sends = new Dictionary<UUID, long>(m_sendqueue); 393 Dictionary<UUID, long> sends = new Dictionary<UUID, long>(m_sendqueue);
392 foreach (KeyValuePair<UUID, long> kvp in sends) 394 foreach (KeyValuePair<UUID, long> kvp in sends)
393 { 395 {
394 if (kvp.Value < now) 396 // We have to load the key and value into local parameters to avoid a race condition if we loop
397 // around and load kvp with a different value before FireAndForget has launched its thread.
398 UUID avatarID = kvp.Key;
399 long sendTime = kvp.Value;
400
401// m_log.DebugFormat("[AVFACTORY]: Handling queued appearance updates for {0}, update delta to now is {1}", avatarID, sendTime - now);
402
403 if (sendTime < now)
395 { 404 {
396 Util.FireAndForget(delegate(object o) { SendAppearance(kvp.Key); }); 405 Util.FireAndForget(o => SendAppearance(avatarID));
397 m_sendqueue.Remove(kvp.Key); 406 m_sendqueue.Remove(avatarID);
398 } 407 }
399 } 408 }
400 } 409 }
@@ -404,10 +413,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
404 Dictionary<UUID, long> saves = new Dictionary<UUID, long>(m_savequeue); 413 Dictionary<UUID, long> saves = new Dictionary<UUID, long>(m_savequeue);
405 foreach (KeyValuePair<UUID, long> kvp in saves) 414 foreach (KeyValuePair<UUID, long> kvp in saves)
406 { 415 {
407 if (kvp.Value < now) 416 // We have to load the key and value into local parameters to avoid a race condition if we loop
417 // around and load kvp with a different value before FireAndForget has launched its thread.
418 UUID avatarID = kvp.Key;
419 long sendTime = kvp.Value;
420
421 if (sendTime < now)
408 { 422 {
409 Util.FireAndForget(delegate(object o) { SaveAppearance(kvp.Key); }); 423 Util.FireAndForget(o => SaveAppearance(avatarID));
410 m_savequeue.Remove(kvp.Key); 424 m_savequeue.Remove(avatarID);
411 } 425 }
412 } 426 }
413 } 427 }
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 26151bf..e47d2a7 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1740,7 +1740,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1740 //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); 1740 //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<");
1741 1741
1742 bool successYN = false; 1742 bool successYN = false;
1743 grp.RootPart.UpdateFlag = 0; 1743 grp.RootPart.ClearUpdateSchedule();
1744 //int primcrossingXMLmethod = 0; 1744 //int primcrossingXMLmethod = 0;
1745 1745
1746 if (destination != null) 1746 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 a6178e7..bcbd966 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1901,8 +1901,8 @@ namespace OpenSim.Region.Framework.Scenes
1901 SceneObjectPart newRoot = newSet[0]; 1901 SceneObjectPart newRoot = newSet[0];
1902 newSet.RemoveAt(0); 1902 newSet.RemoveAt(0);
1903 1903
1904 foreach (SceneObjectPart newChild in newSet) 1904 foreach (SceneObjectPart newChild in newSet)
1905 newChild.UpdateFlag = 0; 1905 newChild.ClearUpdateSchedule();
1906 1906
1907 newRoot.ParentGroup.areUpdatesSuspended = true; 1907 newRoot.ParentGroup.areUpdatesSuspended = true;
1908 LinkObjects(newRoot, newSet); 1908 LinkObjects(newRoot, newSet);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8b71f5b..6d906b7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1479,8 +1479,8 @@ namespace OpenSim.Region.Framework.Scenes
1479 avatar.StandUp(); 1479 avatar.StandUp();
1480 1480
1481 if (!silent) 1481 if (!silent)
1482 { 1482 {
1483 part.UpdateFlag = 0; 1483 part.ClearUpdateSchedule();
1484 if (part == m_rootPart) 1484 if (part == m_rootPart)
1485 { 1485 {
1486 if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) || 1486 if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) ||
@@ -2123,13 +2123,13 @@ namespace OpenSim.Region.Framework.Scenes
2123 2123
2124 if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) 2124 if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
2125 { 2125 {
2126 m_rootPart.UpdateFlag = 1; 2126 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
2127 lastPhysGroupPos = AbsolutePosition; 2127 lastPhysGroupPos = AbsolutePosition;
2128 } 2128 }
2129 2129
2130 if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) 2130 if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
2131 { 2131 {
2132 m_rootPart.UpdateFlag = 1; 2132 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
2133 lastPhysGroupRot = GroupRotation; 2133 lastPhysGroupRot = GroupRotation;
2134 } 2134 }
2135 2135
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index a2e13ce..948518a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -107,6 +107,13 @@ namespace OpenSim.Region.Framework.Scenes
107 SCULPT = 7 107 SCULPT = 7
108 } 108 }
109 109
110 public enum UpdateRequired : byte
111 {
112 NONE = 0,
113 TERSE = 1,
114 FULL = 2
115 }
116
110 #endregion Enumerations 117 #endregion Enumerations
111 118
112 public class SceneObjectPart : IScriptHost, ISceneEntity 119 public class SceneObjectPart : IScriptHost, ISceneEntity
@@ -265,15 +272,7 @@ namespace OpenSim.Region.Framework.Scenes
265 272
266 private bool m_passTouches; 273 private bool m_passTouches;
267 274
268 /// <summary> 275 private UpdateRequired m_updateFlag;
269 /// Only used internally to schedule client updates.
270 /// 0 - no update is scheduled
271 /// 1 - terse update scheduled
272 /// 2 - full update scheduled
273 ///
274 /// TODO - This should be an enumeration
275 /// </summary>
276 private byte m_updateFlag;
277 276
278 private PhysicsActor m_physActor; 277 private PhysicsActor m_physActor;
279 protected Vector3 m_acceleration; 278 protected Vector3 m_acceleration;
@@ -908,7 +907,15 @@ namespace OpenSim.Region.Framework.Scenes
908 } 907 }
909 } 908 }
910 909
911 /// <summary></summary> 910 /// <summary>Update angular velocity and schedule terse update.</summary>
911 public void UpdateAngularVelocity(Vector3 avel)
912 {
913 AngularVelocity = avel;
914 ScheduleTerseUpdate();
915 ParentGroup.HasGroupChanged = true;
916 }
917
918 /// <summary>Get or set angular velocity. Does not schedule update.</summary>
912 public Vector3 AngularVelocity 919 public Vector3 AngularVelocity
913 { 920 {
914 get 921 get
@@ -1056,8 +1063,8 @@ namespace OpenSim.Region.Framework.Scenes
1056 TriggerScriptChangedEvent(Changed.SCALE); 1063 TriggerScriptChangedEvent(Changed.SCALE);
1057 } 1064 }
1058 } 1065 }
1059 1066
1060 public byte UpdateFlag 1067 public UpdateRequired UpdateFlag
1061 { 1068 {
1062 get { return m_updateFlag; } 1069 get { return m_updateFlag; }
1063 set { m_updateFlag = value; } 1070 set { m_updateFlag = value; }
@@ -1362,9 +1369,9 @@ namespace OpenSim.Region.Framework.Scenes
1362 /// <summary> 1369 /// <summary>
1363 /// Clear all pending updates of parts to clients 1370 /// Clear all pending updates of parts to clients
1364 /// </summary> 1371 /// </summary>
1365 private void ClearUpdateSchedule() 1372 public void ClearUpdateSchedule()
1366 { 1373 {
1367 m_updateFlag = 0; 1374 UpdateFlag = UpdateRequired.NONE;
1368 } 1375 }
1369 1376
1370 /// <summary> 1377 /// <summary>
@@ -2884,7 +2891,7 @@ namespace OpenSim.Region.Framework.Scenes
2884 TimeStampFull = (uint)timeNow; 2891 TimeStampFull = (uint)timeNow;
2885 } 2892 }
2886 2893
2887 m_updateFlag = 2; 2894 UpdateFlag = UpdateRequired.FULL;
2888 2895
2889 // m_log.DebugFormat( 2896 // m_log.DebugFormat(
2890 // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", 2897 // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}",
@@ -2900,13 +2907,13 @@ namespace OpenSim.Region.Framework.Scenes
2900 if (m_parentGroup == null) 2907 if (m_parentGroup == null)
2901 return; 2908 return;
2902 2909
2903 if (m_updateFlag < 1) 2910 if (UpdateFlag == UpdateRequired.NONE)
2904 { 2911 {
2905 m_parentGroup.HasGroupChanged = true; 2912 m_parentGroup.HasGroupChanged = true;
2906 m_parentGroup.QueueForUpdateCheck(); 2913 m_parentGroup.QueueForUpdateCheck();
2907 2914
2908 TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); 2915 TimeStampTerse = (uint) Util.UnixTimeSinceEpoch();
2909 m_updateFlag = 1; 2916 UpdateFlag = UpdateRequired.TERSE;
2910 2917
2911 // m_log.DebugFormat( 2918 // m_log.DebugFormat(
2912 // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", 2919 // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
@@ -3073,48 +3080,40 @@ namespace OpenSim.Region.Framework.Scenes
3073 const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary 3080 const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary
3074 const int TIME_MS_TOLERANCE = 200; //llSetPos has a 200ms delay. This should NOT be 3 seconds. 3081 const int TIME_MS_TOLERANCE = 200; //llSetPos has a 200ms delay. This should NOT be 3 seconds.
3075 3082
3076 if (m_updateFlag == 1) 3083 switch (UpdateFlag)
3077 { 3084 {
3078 // Throw away duplicate or insignificant updates 3085 case UpdateRequired.TERSE:
3079 if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
3080 !Acceleration.Equals(m_lastAcceleration) ||
3081 !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
3082 Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) ||
3083 !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) ||
3084 !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
3085 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
3086 { 3086 {
3087 AddTerseUpdateToAllAvatars(); 3087 // Throw away duplicate or insignificant updates
3088 3088 if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
3089 3089 !Acceleration.Equals(m_lastAcceleration) ||
3090 // This causes the Scene to 'poll' physical objects every couple of frames 3090 !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
3091 // bad, so it's been replaced by an event driven method. 3091 Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) ||
3092 //if ((ObjectFlags & (uint)PrimFlags.Physics) != 0) 3092 !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) ||
3093 //{ 3093 !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
3094 // Only send the constant terse updates on physical objects! 3094 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
3095 //ScheduleTerseUpdate(); 3095 {
3096 //} 3096 AddTerseUpdateToAllAvatars();
3097 3097 ClearUpdateSchedule();
3098 // Update the "last" values 3098
3099 m_lastPosition = OffsetPosition; 3099 // Update the "last" values
3100 m_lastRotation = RotationOffset; 3100 m_lastPosition = OffsetPosition;
3101 m_lastVelocity = Velocity; 3101 m_lastRotation = RotationOffset;
3102 m_lastAcceleration = Acceleration; 3102 m_lastVelocity = Velocity;
3103 m_lastAngularVelocity = AngularVelocity; 3103 m_lastAcceleration = Acceleration;
3104 m_lastTerseSent = Environment.TickCount; 3104 m_lastAngularVelocity = AngularVelocity;
3105 m_lastTerseSent = Environment.TickCount;
3106 }
3107 break;
3105 } 3108 }
3106 //Moved this outside of the if clause so updates don't get blocked.. *sigh* 3109 case UpdateRequired.FULL:
3107 m_updateFlag = 0; //Why were we calling a function to do this? Inefficient! *screams*
3108 }
3109 else
3110 {
3111 if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes
3112 { 3110 {
3113 AddFullUpdateToAllAvatars(); 3111 AddFullUpdateToAllAvatars();
3114 m_updateFlag = 0; //Same here 3112 break;
3115 } 3113 }
3116 } 3114 }
3117 m_updateFlag = 0; 3115
3116 ClearUpdateSchedule();
3118 } 3117 }
3119 3118
3120 /// <summary> 3119 /// <summary>
@@ -3492,7 +3491,7 @@ namespace OpenSim.Region.Framework.Scenes
3492 _groupID = groupID; 3491 _groupID = groupID;
3493 if (client != null) 3492 if (client != null)
3494 SendPropertiesToClient(client); 3493 SendPropertiesToClient(client);
3495 m_updateFlag = 2; 3494 UpdateFlag = UpdateRequired.FULL;
3496 } 3495 }
3497 3496
3498 /// <summary> 3497 /// <summary>
@@ -4699,7 +4698,7 @@ namespace OpenSim.Region.Framework.Scenes
4699 { 4698 {
4700 m_shape.TextureEntry = textureEntry; 4699 m_shape.TextureEntry = textureEntry;
4701 TriggerScriptChangedEvent(Changed.TEXTURE); 4700 TriggerScriptChangedEvent(Changed.TEXTURE);
4702 m_updateFlag = 1; 4701 UpdateFlag = UpdateRequired.FULL;
4703 ParentGroup.HasGroupChanged = true; 4702 ParentGroup.HasGroupChanged = true;
4704 4703
4705 //This is madness.. 4704 //This is madness..
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index bba746f..aa1c15e 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2980,7 +2980,8 @@ namespace OpenSim.Region.Framework.Scenes
2980 /// </summary> 2980 /// </summary>
2981 public void SendAppearanceToAllOtherAgents() 2981 public void SendAppearanceToAllOtherAgents()
2982 { 2982 {
2983 //m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} ({1})", Name, UUID); 2983// m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} {1}", Name, UUID);
2984
2984 // only send update from root agents to other clients; children are only "listening posts" 2985 // only send update from root agents to other clients; children are only "listening posts"
2985 if (IsChildAgent) 2986 if (IsChildAgent)
2986 { 2987 {
@@ -3008,7 +3009,7 @@ namespace OpenSim.Region.Framework.Scenes
3008 /// </summary> 3009 /// </summary>
3009 public void SendOtherAgentsAppearanceToMe() 3010 public void SendOtherAgentsAppearanceToMe()
3010 { 3011 {
3011 //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID); 3012// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID);
3012 3013
3013 int count = 0; 3014 int count = 0;
3014 m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) 3015 m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
@@ -3564,7 +3565,7 @@ namespace OpenSim.Region.Framework.Scenes
3564 foreach (ISceneObject so in cAgent.AttachmentObjects) 3565 foreach (ISceneObject so in cAgent.AttachmentObjects)
3565 { 3566 {
3566 ((SceneObjectGroup)so).LocalId = 0; 3567 ((SceneObjectGroup)so).LocalId = 0;
3567 ((SceneObjectGroup)so).RootPart.UpdateFlag = 0; 3568 ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule();
3568 so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); 3569 so.SetState(cAgent.AttachmentObjectStates[i++], m_scene);
3569 m_scene.IncomingCreateObject(so); 3570 m_scene.IncomingCreateObject(so);
3570 } 3571 }
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 11dad6c..680a6fa 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);
@@ -586,11 +585,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
586 obj.Scale = Util.ReadVector(reader, "Scale"); 585 obj.Scale = Util.ReadVector(reader, "Scale");
587 } 586 }
588 587
589 private static void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader)
590 {
591 obj.UpdateFlag = (byte)reader.ReadElementContentAsInt("UpdateFlag", String.Empty);
592 }
593
594 private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader) 588 private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader)
595 { 589 {
596 obj.SitTargetOrientation = Util.ReadQuaternion(reader, "SitTargetOrientation"); 590 obj.SitTargetOrientation = Util.ReadQuaternion(reader, "SitTargetOrientation");
@@ -1194,7 +1188,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1194 WriteShape(writer, sop.Shape, options); 1188 WriteShape(writer, sop.Shape, options);
1195 1189
1196 WriteVector(writer, "Scale", sop.Scale); 1190 WriteVector(writer, "Scale", sop.Scale);
1197 writer.WriteElementString("UpdateFlag", sop.UpdateFlag.ToString());
1198 WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation); 1191 WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation);
1199 WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition); 1192 WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition);
1200 WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL); 1193 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 0a30f4b..5ed3c79 100644
--- a/OpenSim/Region/Framework/Scenes/UndoState.cs
+++ b/OpenSim/Region/Framework/Scenes/UndoState.cs
@@ -173,6 +173,7 @@ namespace OpenSim.Region.Framework.Scenes
173 } 173 }
174 else 174 else
175 { 175 {
176 // Note: Updating these properties on sop automatically schedules an update if needed
176 if (Position != Vector3.Zero) 177 if (Position != Vector3.Zero)
177 { 178 {
178 // m_log.DebugFormat( 179 // m_log.DebugFormat(
@@ -196,8 +197,6 @@ namespace OpenSim.Region.Framework.Scenes
196 197
197 part.Resize(Scale); 198 part.Resize(Scale);
198 } 199 }
199
200 part.ScheduleTerseUpdate();
201 } 200 }
202 201
203 part.Undoing = false; 202 part.Undoing = false;
@@ -227,6 +226,7 @@ namespace OpenSim.Region.Framework.Scenes
227 } 226 }
228 else 227 else
229 { 228 {
229 // Note: Updating these properties on sop automatically schedules an update if needed
230 if (Position != Vector3.Zero) 230 if (Position != Vector3.Zero)
231 part.OffsetPosition = Position; 231 part.OffsetPosition = Position;
232 232
@@ -235,8 +235,6 @@ namespace OpenSim.Region.Framework.Scenes
235 235
236 if (Scale != Vector3.Zero) 236 if (Scale != Vector3.Zero)
237 part.Resize(Scale); 237 part.Resize(Scale);
238
239 part.ScheduleTerseUpdate();
240 } 238 }
241 239
242 part.Undoing = false; 240 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 652fa7e..45a5f9a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3653,10 +3653,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3653 3653
3654 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain) 3654 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
3655 { 3655 {
3656 part.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 3656 part.UpdateAngularVelocity(new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)));
3657 part.ScheduleTerseUpdate();
3658 part.SendTerseUpdateToAllClients();
3659 part.ParentGroup.HasGroupChanged = true;
3660 } 3657 }
3661 3658
3662 public LSL_Integer llGetStartParameter() 3659 public LSL_Integer llGetStartParameter()
@@ -3958,11 +3955,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3958 parentPrim = targetPart.ParentGroup; 3955 parentPrim = targetPart.ParentGroup;
3959 childPrim = m_host.ParentGroup; 3956 childPrim = m_host.ParentGroup;
3960 } 3957 }
3961// byte uf = childPrim.RootPart.UpdateFlag; 3958
3962 childPrim.RootPart.UpdateFlag = 0; 3959 // Required for linking
3960 childPrim.RootPart.ClearUpdateSchedule();
3963 parentPrim.LinkToGroup(childPrim); 3961 parentPrim.LinkToGroup(childPrim);
3964// if (uf != (Byte)0)
3965// parent.RootPart.UpdateFlag = uf;
3966 } 3962 }
3967 3963
3968 parentPrim.TriggerScriptChangedEvent(Changed.LINK); 3964 parentPrim.TriggerScriptChangedEvent(Changed.LINK);
@@ -4059,7 +4055,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4059 parts[0].ParentGroup.areUpdatesSuspended = true; 4055 parts[0].ParentGroup.areUpdatesSuspended = true;
4060 foreach (SceneObjectPart part in parts) 4056 foreach (SceneObjectPart part in parts)
4061 { 4057 {
4062 part.UpdateFlag = 0; 4058 part.ClearUpdateSchedule();
4063 newRoot.ParentGroup.LinkToGroup(part.ParentGroup); 4059 newRoot.ParentGroup.LinkToGroup(part.ParentGroup);
4064 } 4060 }
4065 } 4061 }
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)