From 8c7149063bce41cac6543757c7b917583f21ea90 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 12 Jun 2012 01:23:40 +0100 Subject: In PresenceDetector.OnConnectionClose(), use the IsChildAgent check already available on IClientAPI.SceneAgent rather than retrieving it again by scanning all scenes. --- OpenSim/Framework/IClientAPI.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') 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 /// string Name { get; } - /// - /// Determines whether the client thread is doing anything or not. - /// + /// + /// True if the client is active (sending and receiving new UDP messages). False if the client is closing. + /// bool IsActive { get; set; } - /// - /// Determines whether the client is or has been removed from a given scene - /// + /// + /// Set if the client is closing due to a logout request or because of too much time since last ack. + /// + /// + /// Do not use this flag if you want to know if the client is closing, since it will not be set in other + /// circumstances (e.g. if a child agent is closed or the agent is kicked off the simulator). Use IsActive + /// instead. + /// + /// Only set for root agents. + /// + /// TODO: Too much time since last ack should probably be a separate property, or possibly part of a state + /// machine. + /// bool IsLoggingOut { get; set; } bool SendLogoutPacketWhenClosing { set; } -- cgit v1.1 From b099f26376a7d671eeb9113dd7611cfcb0e57de0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 12 Jun 2012 02:16:36 +0100 Subject: Set IClientAPI.IsActive = false early on client removal due to ack timeout rather than using IsLoggingOut flag. IsActive is more appropriate since unack timeout is not due to voluntary logout. This is in line with operations such as manual kick that do not set the IsLoggingOut flag. It's also slightly better race-wise since it reduces the chance of this operation clashing with another reason for client deactivation (e.g. manual kick). --- OpenSim/Framework/IClientAPI.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index f8b6a84..2ea6de5 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -741,22 +741,19 @@ namespace OpenSim.Framework string Name { get; } /// - /// True if the client is active (sending and receiving new UDP messages). False if the client is closing. + /// True if the client is active (sending and receiving new UDP messages). False if the client is being closed. /// bool IsActive { get; set; } /// - /// Set if the client is closing due to a logout request or because of too much time since last ack. + /// Set if the client is closing due to a logout request /// /// /// Do not use this flag if you want to know if the client is closing, since it will not be set in other /// circumstances (e.g. if a child agent is closed or the agent is kicked off the simulator). Use IsActive - /// instead. + /// instead with a IClientAPI.SceneAgent.IsChildAgent check if necessary. /// /// Only set for root agents. - /// - /// TODO: Too much time since last ack should probably be a separate property, or possibly part of a state - /// machine. /// bool IsLoggingOut { get; set; } -- cgit v1.1 From 1b1f0a2d77fb4d2ac572f16c71a7560860c8c040 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 12 Jun 2012 02:43:33 +0100 Subject: OnConnectionClosed listeners, retrieve data from IClientAPI.SceneAgent rather than scanning all scene for the presence with the right id Stop checking IsLoggingOut on these listeners, if called with a root agent then we always want to perform these actions. This covers cases where the client is closed due to manual kick, simulator shutdown, etc. --- OpenSim/Framework/ISceneAgent.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/ISceneAgent.cs b/OpenSim/Framework/ISceneAgent.cs index 824172d..563d906 100644 --- a/OpenSim/Framework/ISceneAgent.cs +++ b/OpenSim/Framework/ISceneAgent.cs @@ -26,6 +26,7 @@ */ using System; +using OpenMetaverse; namespace OpenSim.Framework { @@ -71,5 +72,11 @@ namespace OpenSim.Framework /// This includes scene object data and the appearance data of other avatars. /// void SendInitialDataToMe(); + + /// + /// Direction in which the scene presence is looking. + /// + /// Will be Vector3.Zero for a child agent. + Vector3 Lookat { get; } } } \ No newline at end of file -- cgit v1.1