aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-06-12 01:23:40 +0100
committerJustin Clark-Casey (justincc)2012-06-12 01:25:09 +0100
commit8c7149063bce41cac6543757c7b917583f21ea90 (patch)
tree6fe9cee7b0eb9c2d174a0eec117c3f0f762d5e21 /OpenSim
parentComment out the scene presence sitting debug log messages for now (diff)
downloadopensim-SC_OLD-8c7149063bce41cac6543757c7b917583f21ea90.zip
opensim-SC_OLD-8c7149063bce41cac6543757c7b917583f21ea90.tar.gz
opensim-SC_OLD-8c7149063bce41cac6543757c7b917583f21ea90.tar.bz2
opensim-SC_OLD-8c7149063bce41cac6543757c7b917583f21ea90.tar.xz
In PresenceDetector.OnConnectionClose(), use the IsChildAgent check already available on IClientAPI.SceneAgent rather than retrieving it again by scanning all scenes.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IClientAPI.cs22
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs7
4 files changed, 22 insertions, 24 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 869b069..f8b6a84 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -740,14 +740,24 @@ namespace OpenSim.Framework
740 /// </summary> 740 /// </summary>
741 string Name { get; } 741 string Name { get; }
742 742
743 /// <value> 743 /// <summary>
744 /// Determines whether the client thread is doing anything or not. 744 /// True if the client is active (sending and receiving new UDP messages). False if the client is closing.
745 /// </value> 745 /// </summary>
746 bool IsActive { get; set; } 746 bool IsActive { get; set; }
747 747
748 /// <value> 748 /// <summary>
749 /// Determines whether the client is or has been removed from a given scene 749 /// Set if the client is closing due to a logout request or because of too much time since last ack.
750 /// </value> 750 /// </summary>
751 /// <remarks>
752 /// Do not use this flag if you want to know if the client is closing, since it will not be set in other
753 /// circumstances (e.g. if a child agent is closed or the agent is kicked off the simulator). Use IsActive
754 /// instead.
755 ///
756 /// Only set for root agents.
757 ///
758 /// TODO: Too much time since last ack should probably be a separate property, or possibly part of a state
759 /// machine.
760 /// </remarks>
751 bool IsLoggingOut { get; set; } 761 bool IsLoggingOut { get; set; }
752 762
753 bool SendLogoutPacketWhenClosing { set; } 763 bool SendLogoutPacketWhenClosing { set; }
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 74b9c6d..c4f167e 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -490,12 +490,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
490 /// </summary> 490 /// </summary>
491 public void Close() 491 public void Close()
492 { 492 {
493 IsActive = false;
494
493 m_log.DebugFormat( 495 m_log.DebugFormat(
494 "[CLIENT]: Close has been called for {0} attached to scene {1}", 496 "[CLIENT]: Close has been called for {0} attached to scene {1}",
495 Name, m_scene.RegionInfo.RegionName); 497 Name, m_scene.RegionInfo.RegionName);
496 498
497 IsActive = false;
498
499 // Shutdown the image manager 499 // Shutdown the image manager
500 ImageManager.Close(); 500 ImageManager.Close();
501 501
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
index ccfbf78..b43745c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
@@ -64,7 +64,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
64 scene.EventManager.OnNewClient -= OnNewClient; 64 scene.EventManager.OnNewClient -= OnNewClient;
65 65
66 m_PresenceService.LogoutRegionAgents(scene.RegionInfo.RegionID); 66 m_PresenceService.LogoutRegionAgents(scene.RegionInfo.RegionID);
67
68 } 67 }
69 68
70 public void OnMakeRootAgent(ScenePresence sp) 69 public void OnMakeRootAgent(ScenePresence sp)
@@ -80,18 +79,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
80 79
81 public void OnConnectionClose(IClientAPI client) 80 public void OnConnectionClose(IClientAPI client)
82 { 81 {
83 if (client.IsLoggingOut) 82 if (client.IsLoggingOut && !client.SceneAgent.IsChildAgent)
84 { 83 {
85 object sp = null;
86 if (client.Scene.TryGetScenePresence(client.AgentId, out sp))
87 {
88 if (sp is ScenePresence)
89 {
90 if (((ScenePresence)sp).IsChildAgent)
91 return;
92 }
93 }
94
95// m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); 84// m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
96 m_PresenceService.LogoutAgent(client.SessionId); 85 m_PresenceService.LogoutAgent(client.SessionId);
97 } 86 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7afde38..1305d83 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3463,10 +3463,9 @@ namespace OpenSim.Region.Framework.Scenes
3463 // Or the same user is trying to be root twice here, won't work. 3463 // Or the same user is trying to be root twice here, won't work.
3464 // Kill it. 3464 // Kill it.
3465 m_log.DebugFormat( 3465 m_log.DebugFormat(
3466 "[SCENE]: Zombie scene presence detected for {0} in {1}", 3466 "[SCENE]: Zombie scene presence detected for {0} {1} in {2}",
3467 agent.AgentID, 3467 sp.Name, sp.UUID, RegionInfo.RegionName);
3468 RegionInfo.RegionName 3468
3469 );
3470 sp.ControllingClient.Close(); 3469 sp.ControllingClient.Close();
3471 sp = null; 3470 sp = null;
3472 } 3471 }