From 76b59b8df776121708b7ff93312c25c341b19ea6 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 20 Jun 2010 06:23:08 +0200 Subject: Make dataserver() return a 0 when agent id offline, instead of a timeout --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 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 61c5add..5c6d382 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4232,22 +4232,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api UUID uuid = (UUID)id; UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); + if (account == null) + return UUID.Zero.ToString(); + PresenceInfo pinfo = null; PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); if (pinfos != null && pinfos.Length > 0) pinfo = pinfos[0]; - if (pinfo == null) - return UUID.Zero.ToString(); - string reply = String.Empty; switch (data) { case 1: // DATA_ONLINE (0|1) - // TODO: implement fetching of this information - if (pinfo != null) + if (pinfo != null && pinfo.RegionID != UUID.Zero) reply = "1"; else reply = "0"; -- cgit v1.1