diff options
author | John Hurliman | 2009-10-25 00:40:21 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-25 00:40:21 -0700 |
commit | 730930955a7edc0bfa69ff1cac93acd024cf8d24 (patch) | |
tree | ae38c7d82245acdc4499d9b39a227eba541132bb /OpenSim/Region/Framework | |
parent | * Changed various modules to not initialize timers unless the module is initi... (diff) | |
download | opensim-SC-730930955a7edc0bfa69ff1cac93acd024cf8d24.zip opensim-SC-730930955a7edc0bfa69ff1cac93acd024cf8d24.tar.gz opensim-SC-730930955a7edc0bfa69ff1cac93acd024cf8d24.tar.bz2 opensim-SC-730930955a7edc0bfa69ff1cac93acd024cf8d24.tar.xz |
Changing Scene.ForEachClient to use the synchronous for loop instead of Parallel. This is quite possibly the source of some deadlocking, and at the very least the synchronous version gives better stack traces
* Lock the LLUDPClient RTO math * Add a helper function for backing off the RTO, and follow the optional advice in RFC 2988 to clear existing SRTT and RTTVAR values during a backoff
* Removing the unused PrimitiveBaseShape.SculptImage parameter * Improved performance of SceneObjectPart instantiation * ZeroMesher now drops SculptData bytes like Meshmerizer, to allow the texture data to be GCed * Improved typecasting speed in MySQLLegacyRegionData.BuildShape()
* Improved the instantiation of PrimitiveBaseShape
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 109 |
3 files changed, 56 insertions, 57 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 47b13bd..f052c65 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -4246,7 +4246,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4246 | 4246 | ||
4247 | public void ForEachClient(Action<IClientAPI> action) | 4247 | public void ForEachClient(Action<IClientAPI> action) |
4248 | { | 4248 | { |
4249 | ClientManager.ForEach(action); | 4249 | ClientManager.ForEachSync(action); |
4250 | } | 4250 | } |
4251 | 4251 | ||
4252 | public void ForEachSOG(Action<SceneObjectGroup> action) | 4252 | public void ForEachSOG(Action<SceneObjectGroup> action) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index dd8da20..34ada4c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1334,7 +1334,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1334 | (parcel.LandData.GroupID != GroupID || | 1334 | (parcel.LandData.GroupID != GroupID || |
1335 | parcel.LandData.GroupID == UUID.Zero)) | 1335 | parcel.LandData.GroupID == UUID.Zero)) |
1336 | { | 1336 | { |
1337 | if ((DateTime.Now - RootPart.Rezzed).TotalMinutes > | 1337 | if ((DateTime.UtcNow - RootPart.Rezzed).TotalMinutes > |
1338 | parcel.LandData.OtherCleanTime) | 1338 | parcel.LandData.OtherCleanTime) |
1339 | { | 1339 | { |
1340 | DetachFromBackup(); | 1340 | DetachFromBackup(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 7193002..d84c35c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -102,16 +102,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
102 | 102 | ||
103 | #region Fields | 103 | #region Fields |
104 | 104 | ||
105 | public bool AllowedDrop = false; | 105 | public bool AllowedDrop; |
106 | 106 | ||
107 | [XmlIgnore] | 107 | [XmlIgnore] |
108 | public bool DIE_AT_EDGE = false; | 108 | public bool DIE_AT_EDGE; |
109 | 109 | ||
110 | // TODO: This needs to be persisted in next XML version update! | 110 | // TODO: This needs to be persisted in next XML version update! |
111 | [XmlIgnore] | 111 | [XmlIgnore] |
112 | public int[] PayPrice = {-2,-2,-2,-2,-2}; | 112 | public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; |
113 | [XmlIgnore] | 113 | [XmlIgnore] |
114 | public PhysicsActor PhysActor = null; | 114 | public PhysicsActor PhysActor; |
115 | 115 | ||
116 | //Xantor 20080528 Sound stuff: | 116 | //Xantor 20080528 Sound stuff: |
117 | // Note: This isn't persisted in the database right now, as the fields for that aren't just there yet. | 117 | // Note: This isn't persisted in the database right now, as the fields for that aren't just there yet. |
@@ -130,55 +130,56 @@ namespace OpenSim.Region.Framework.Scenes | |||
130 | public double SoundRadius; | 130 | public double SoundRadius; |
131 | 131 | ||
132 | [XmlIgnore] | 132 | [XmlIgnore] |
133 | public uint TimeStampFull = 0; | 133 | public uint TimeStampFull; |
134 | 134 | ||
135 | [XmlIgnore] | 135 | [XmlIgnore] |
136 | public uint TimeStampLastActivity = 0; // Will be used for AutoReturn | 136 | public uint TimeStampLastActivity; // Will be used for AutoReturn |
137 | 137 | ||
138 | [XmlIgnore] | 138 | [XmlIgnore] |
139 | public uint TimeStampTerse = 0; | 139 | public uint TimeStampTerse; |
140 | 140 | ||
141 | [XmlIgnore] | 141 | [XmlIgnore] |
142 | public UUID FromItemID = UUID.Zero; | 142 | public UUID FromItemID; |
143 | 143 | ||
144 | /// <value> | 144 | /// <value> |
145 | /// The UUID of the user inventory item from which this object was rezzed if this is a root part. | 145 | /// The UUID of the user inventory item from which this object was rezzed if this is a root part. |
146 | /// If UUID.Zero then either this is not a root part or there is no connection with a user inventory item. | 146 | /// If UUID.Zero then either this is not a root part or there is no connection with a user inventory item. |
147 | /// </value> | 147 | /// </value> |
148 | private UUID m_fromUserInventoryItemID = UUID.Zero; | 148 | private UUID m_fromUserInventoryItemID; |
149 | 149 | ||
150 | [XmlIgnore] | 150 | [XmlIgnore] |
151 | public UUID FromUserInventoryItemID | 151 | public UUID FromUserInventoryItemID |
152 | { | 152 | { |
153 | get { return m_fromUserInventoryItemID; } | 153 | get { return m_fromUserInventoryItemID; } |
154 | } | 154 | } |
155 | 155 | ||
156 | [XmlIgnore] | 156 | [XmlIgnore] |
157 | public bool IsAttachment = false; | 157 | public bool IsAttachment; |
158 | 158 | ||
159 | [XmlIgnore] | 159 | [XmlIgnore] |
160 | public scriptEvents AggregateScriptEvents = 0; | 160 | public scriptEvents AggregateScriptEvents; |
161 | 161 | ||
162 | [XmlIgnore] | 162 | [XmlIgnore] |
163 | public UUID AttachedAvatar = UUID.Zero; | 163 | public UUID AttachedAvatar; |
164 | 164 | ||
165 | [XmlIgnore] | 165 | [XmlIgnore] |
166 | public Vector3 AttachedPos = Vector3.Zero; | 166 | public Vector3 AttachedPos; |
167 | 167 | ||
168 | [XmlIgnore] | 168 | [XmlIgnore] |
169 | public uint AttachmentPoint = (byte)0; | 169 | public uint AttachmentPoint; |
170 | 170 | ||
171 | [XmlIgnore] | 171 | [XmlIgnore] |
172 | public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); | 172 | public PhysicsVector RotationAxis = new PhysicsVector(1f, 1f, 1f); |
173 | 173 | ||
174 | [XmlIgnore] | 174 | [XmlIgnore] |
175 | public bool VolumeDetectActive = false; // XmlIgnore set to avoid problems with persistance until I come to care for this | 175 | public bool VolumeDetectActive; // XmlIgnore set to avoid problems with persistance until I come to care for this |
176 | // Certainly this must be a persistant setting finally | 176 | // Certainly this must be a persistant setting finally |
177 | 177 | ||
178 | [XmlIgnore] | 178 | [XmlIgnore] |
179 | public bool IsWaitingForFirstSpinUpdatePacket = false; | 179 | public bool IsWaitingForFirstSpinUpdatePacket; |
180 | |||
180 | [XmlIgnore] | 181 | [XmlIgnore] |
181 | public Quaternion SpinOldOrientation = new Quaternion(); | 182 | public Quaternion SpinOldOrientation = Quaternion.Identity; |
182 | 183 | ||
183 | /// <summary> | 184 | /// <summary> |
184 | /// This part's inventory | 185 | /// This part's inventory |
@@ -191,34 +192,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
191 | protected SceneObjectPartInventory m_inventory; | 192 | protected SceneObjectPartInventory m_inventory; |
192 | 193 | ||
193 | [XmlIgnore] | 194 | [XmlIgnore] |
194 | public bool Undoing = false; | 195 | public bool Undoing; |
195 | 196 | ||
196 | [XmlIgnore] | 197 | [XmlIgnore] |
197 | private PrimFlags LocalFlags = 0; | 198 | private PrimFlags LocalFlags; |
198 | [XmlIgnore] | 199 | [XmlIgnore] |
199 | private float m_damage = -1.0f; | 200 | private float m_damage = -1.0f; |
200 | private byte[] m_TextureAnimation; | 201 | private byte[] m_TextureAnimation; |
201 | private byte m_clickAction = 0; | 202 | private byte m_clickAction; |
202 | private Color m_color = Color.Black; | 203 | private Color m_color = Color.Black; |
203 | private string m_description = String.Empty; | 204 | private string m_description = String.Empty; |
204 | private readonly List<uint> m_lastColliders = new List<uint>(); | 205 | private readonly List<uint> m_lastColliders = new List<uint>(); |
205 | // private PhysicsVector m_lastRotationalVelocity = PhysicsVector.Zero; | 206 | private int m_linkNum; |
206 | private int m_linkNum = 0; | ||
207 | [XmlIgnore] | 207 | [XmlIgnore] |
208 | private int m_scriptAccessPin = 0; | 208 | private int m_scriptAccessPin; |
209 | [XmlIgnore] | 209 | [XmlIgnore] |
210 | private readonly Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>(); | 210 | private readonly Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>(); |
211 | private string m_sitName = String.Empty; | 211 | private string m_sitName = String.Empty; |
212 | private Quaternion m_sitTargetOrientation = Quaternion.Identity; | 212 | private Quaternion m_sitTargetOrientation = Quaternion.Identity; |
213 | private Vector3 m_sitTargetPosition = Vector3.Zero; | 213 | private Vector3 m_sitTargetPosition; |
214 | private string m_sitAnimation = "SIT"; | 214 | private string m_sitAnimation = "SIT"; |
215 | private string m_text = String.Empty; | 215 | private string m_text = String.Empty; |
216 | private string m_touchName = String.Empty; | 216 | private string m_touchName = String.Empty; |
217 | private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5); | 217 | private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5); |
218 | private UUID _creatorID; | 218 | private UUID _creatorID; |
219 | 219 | ||
220 | 220 | private bool m_passTouches; | |
221 | private bool m_passTouches = false; | ||
222 | 221 | ||
223 | /// <summary> | 222 | /// <summary> |
224 | /// Only used internally to schedule client updates. | 223 | /// Only used internally to schedule client updates. |
@@ -236,28 +235,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
236 | //unkown if this will be kept, added as a way of removing the group position from the group class | 235 | //unkown if this will be kept, added as a way of removing the group position from the group class |
237 | protected Vector3 m_groupPosition; | 236 | protected Vector3 m_groupPosition; |
238 | protected uint m_localId; | 237 | protected uint m_localId; |
239 | protected Material m_material = (Material)3; // Wood | 238 | protected Material m_material = OpenMetaverse.Material.Wood; |
240 | protected string m_name; | 239 | protected string m_name; |
241 | protected Vector3 m_offsetPosition; | 240 | protected Vector3 m_offsetPosition; |
242 | 241 | ||
243 | // FIXME, TODO, ERROR: 'ParentGroup' can't be in here, move it out. | 242 | // FIXME, TODO, ERROR: 'ParentGroup' can't be in here, move it out. |
244 | protected SceneObjectGroup m_parentGroup; | 243 | protected SceneObjectGroup m_parentGroup; |
245 | protected byte[] m_particleSystem = new byte[0]; | 244 | protected byte[] m_particleSystem = Utils.EmptyBytes; |
246 | protected ulong m_regionHandle; | 245 | protected ulong m_regionHandle; |
247 | protected Quaternion m_rotationOffset; | 246 | protected Quaternion m_rotationOffset; |
248 | protected PrimitiveBaseShape m_shape = null; | 247 | protected PrimitiveBaseShape m_shape; |
249 | protected UUID m_uuid; | 248 | protected UUID m_uuid; |
250 | protected Vector3 m_velocity; | 249 | protected Vector3 m_velocity; |
251 | 250 | ||
252 | // TODO: Those have to be changed into persistent properties at some later point, | 251 | // TODO: Those have to be changed into persistent properties at some later point, |
253 | // or sit-camera on vehicles will break on sim-crossing. | 252 | // or sit-camera on vehicles will break on sim-crossing. |
254 | private Vector3 m_cameraEyeOffset = new Vector3(0.0f, 0.0f, 0.0f); | 253 | private Vector3 m_cameraEyeOffset; |
255 | private Vector3 m_cameraAtOffset = new Vector3(0.0f, 0.0f, 0.0f); | 254 | private Vector3 m_cameraAtOffset; |
256 | private bool m_forceMouselook = false; | 255 | private bool m_forceMouselook; |
257 | 256 | ||
258 | // TODO: Collision sound should have default. | 257 | // TODO: Collision sound should have default. |
259 | private UUID m_collisionSound = UUID.Zero; | 258 | private UUID m_collisionSound; |
260 | private float m_collisionSoundVolume = 0.0f; | 259 | private float m_collisionSoundVolume; |
261 | 260 | ||
262 | #endregion Fields | 261 | #endregion Fields |
263 | 262 | ||
@@ -269,9 +268,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
269 | public SceneObjectPart() | 268 | public SceneObjectPart() |
270 | { | 269 | { |
271 | // It's not necessary to persist this | 270 | // It's not necessary to persist this |
272 | m_TextureAnimation = new byte[0]; | 271 | m_TextureAnimation = Utils.EmptyBytes; |
273 | m_particleSystem = new byte[0]; | 272 | m_particleSystem = Utils.EmptyBytes; |
274 | Rezzed = DateTime.Now; | 273 | Rezzed = DateTime.UtcNow; |
275 | 274 | ||
276 | m_inventory = new SceneObjectPartInventory(this); | 275 | m_inventory = new SceneObjectPartInventory(this); |
277 | } | 276 | } |
@@ -290,8 +289,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
290 | { | 289 | { |
291 | m_name = "Primitive"; | 290 | m_name = "Primitive"; |
292 | 291 | ||
293 | Rezzed = DateTime.Now; | 292 | Rezzed = DateTime.UtcNow; |
294 | _creationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | 293 | _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed); |
295 | _ownerID = ownerID; | 294 | _ownerID = ownerID; |
296 | _creatorID = _ownerID; | 295 | _creatorID = _ownerID; |
297 | _lastOwnerID = UUID.Zero; | 296 | _lastOwnerID = UUID.Zero; |
@@ -299,19 +298,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
299 | Shape = shape; | 298 | Shape = shape; |
300 | // Todo: Add More Object Parameter from above! | 299 | // Todo: Add More Object Parameter from above! |
301 | _ownershipCost = 0; | 300 | _ownershipCost = 0; |
302 | _objectSaleType = (byte) 0; | 301 | _objectSaleType = 0; |
303 | _salePrice = 0; | 302 | _salePrice = 0; |
304 | _category = (uint) 0; | 303 | _category = 0; |
305 | _lastOwnerID = _creatorID; | 304 | _lastOwnerID = _creatorID; |
306 | // End Todo: /// | 305 | // End Todo: /// |
307 | GroupPosition = groupPosition; | 306 | GroupPosition = groupPosition; |
308 | OffsetPosition = offsetPosition; | 307 | OffsetPosition = offsetPosition; |
309 | RotationOffset = rotationOffset; | 308 | RotationOffset = rotationOffset; |
310 | Velocity = new Vector3(0, 0, 0); | 309 | Velocity = Vector3.Zero; |
311 | AngularVelocity = new Vector3(0, 0, 0); | 310 | AngularVelocity = Vector3.Zero; |
312 | Acceleration = new Vector3(0, 0, 0); | 311 | Acceleration = Vector3.Zero; |
313 | m_TextureAnimation = new byte[0]; | 312 | m_TextureAnimation = Utils.EmptyBytes; |
314 | m_particleSystem = new byte[0]; | 313 | m_particleSystem = Utils.EmptyBytes; |
315 | 314 | ||
316 | // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, | 315 | // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, |
317 | // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from | 316 | // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from |
@@ -3548,7 +3547,7 @@ if (m_shape != null) { | |||
3548 | // in SL. | 3547 | // in SL. |
3549 | // | 3548 | // |
3550 | if (ParentGroup.RootPart != this) | 3549 | if (ParentGroup.RootPart != this) |
3551 | ParentGroup.RootPart.Rezzed = DateTime.Now; | 3550 | ParentGroup.RootPart.Rezzed = DateTime.UtcNow; |
3552 | 3551 | ||
3553 | ParentGroup.HasGroupChanged = true; | 3552 | ParentGroup.HasGroupChanged = true; |
3554 | ScheduleFullUpdate(); | 3553 | ScheduleFullUpdate(); |