From 251f2444d049ed525ef41c4c4792ec446c53b973 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 17 Sep 2010 01:50:48 +0200 Subject: Revert "* Changed 11 calls for session info to the more optimized API method" This reverts commit 5dc9ea2f2487804d788b4b80d40d91bd792de4c2. Also makes online indicators and IM more robust --- .../Shared/Api/Implementation/LSL_Api.cs | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e299f96..0dd1787 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4296,7 +4296,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } - pinfo = World.PresenceService.GetAgent(uuid); + PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); + if (pinfos != null && pinfos.Length > 0) + { + foreach (PresenceInfo p in pinfos) + { + if (p.RegionID != UUID.Zero) + { + pinfo = p; + } + } + } ce = new UserInfoCacheEntry(); ce.time = Util.EnvironmentTickCount(); @@ -4315,7 +4325,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (Util.EnvironmentTickCount() < ce.time || (Util.EnvironmentTickCount() - ce.time) >= 20000) { - pinfo = World.PresenceService.GetAgent(uuid); + PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); + if (pinfos != null && pinfos.Length > 0) + { + foreach (PresenceInfo p in pinfos) + { + if (p.RegionID != UUID.Zero) + { + pinfo = p; + } + } + } + else + pinfo = null; ce.time = Util.EnvironmentTickCount(); ce.pinfo = pinfo; -- cgit v1.1