aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
authorMelanie2011-11-03 00:06:14 +0000
committerMelanie2011-11-03 00:06:14 +0000
commit243acef917e8e61b9feef4587b440a77737e016e (patch)
treeaf80394d32977c53b729a395037dd080c8ffe214 /OpenSim/Region/CoreModules/Avatar
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/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs28
1 files changed, 21 insertions, 7 deletions
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 }