do GridUserService.SetLastPosition async on crossings

LSLKeyTest
UbitUmarov 2016-07-26 22:09:06 +01:00
parent e0e8b784a5
commit f19b3d28bd
1 changed files with 23 additions and 10 deletions

View File

@ -63,18 +63,31 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
scene.EventManager.OnNewClient -= OnNewClient; scene.EventManager.OnNewClient -= OnNewClient;
} }
public void OnMakeRootAgent(ScenePresence sp) public void OnMakeRootAgent(ScenePresence sp)
{ {
if (sp.PresenceType != PresenceType.Npc) if (sp.isNPC)
return;
if(sp.gotCrossUpdate)
{ {
string userid; Util.FireAndForget(delegate
//m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", userid, sp.Scene.RegionInfo.RegionName);
if (sp.Scene.UserManagementModule.GetUserUUI(sp.UUID, out userid))
{ {
/* we only setposition on known agents that have a valid lookup */ DoOnMakeRootAgent(sp);
m_GridUserService.SetLastPosition( }, null, "ActivityDetector_MakeRoot");
userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); }
} else
DoOnMakeRootAgent(sp);
}
public void DoOnMakeRootAgent(ScenePresence sp)
{
string userid;
//m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", userid, sp.Scene.RegionInfo.RegionName);
if (sp.Scene.UserManagementModule.GetUserUUI(sp.UUID, out userid))
{
/* we only setposition on known agents that have a valid lookup */
m_GridUserService.SetLastPosition(
userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat);
} }
} }