aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs35
1 files changed, 24 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
index 2238c90..1529fc2 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs
@@ -37,7 +37,7 @@ using log4net;
37 37
38namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser 38namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
39{ 39{
40 public class ActivityDetector 40 public class ActivityDetector
41 { 41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 43
@@ -63,18 +63,31 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
63 scene.EventManager.OnNewClient -= OnNewClient; 63 scene.EventManager.OnNewClient -= OnNewClient;
64 } 64 }
65 65
66 public void OnMakeRootAgent(ScenePresence sp) 66 public void OnMakeRootAgent(ScenePresence sp)
67 { 67 {
68 if (sp.PresenceType != PresenceType.Npc) 68 if (sp.IsNPC)
69 return;
70
71 if(sp.gotCrossUpdate)
69 { 72 {
70 string userid; 73 Util.FireAndForget(delegate
71 //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", userid, sp.Scene.RegionInfo.RegionName);
72 if (sp.Scene.UserManagementModule.GetUserUUI(sp.UUID, out userid))
73 { 74 {
74 /* we only setposition on known agents that have a valid lookup */ 75 DoOnMakeRootAgent(sp);
75 m_GridUserService.SetLastPosition( 76 }, null, "ActivityDetector_MakeRoot");
76 userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); 77 }
77 } 78 else
79 DoOnMakeRootAgent(sp);
80 }
81
82 public void DoOnMakeRootAgent(ScenePresence sp)
83 {
84 string userid;
85 //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", userid, sp.Scene.RegionInfo.RegionName);
86 if (sp.Scene.UserManagementModule.GetUserUUI(sp.UUID, out userid))
87 {
88 /* we only setposition on known agents that have a valid lookup */
89 m_GridUserService.SetLastPosition(
90 userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat);
78 } 91 }
79 } 92 }
80 93