Make dataserver() return a 0 when agent id offline, instead of a timeout
parent
696b6c727f
commit
2257e39eda
|
@ -3918,22 +3918,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID uuid = (UUID)id;
|
UUID uuid = (UUID)id;
|
||||||
|
|
||||||
UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
|
UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
|
||||||
|
if (account == null)
|
||||||
|
return UUID.Zero.ToString();
|
||||||
|
|
||||||
|
|
||||||
PresenceInfo pinfo = null;
|
PresenceInfo pinfo = null;
|
||||||
PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
|
PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
|
||||||
if (pinfos != null && pinfos.Length > 0)
|
if (pinfos != null && pinfos.Length > 0)
|
||||||
pinfo = pinfos[0];
|
pinfo = pinfos[0];
|
||||||
|
|
||||||
if (pinfo == null)
|
|
||||||
return UUID.Zero.ToString();
|
|
||||||
|
|
||||||
string reply = String.Empty;
|
string reply = String.Empty;
|
||||||
|
|
||||||
switch (data)
|
switch (data)
|
||||||
{
|
{
|
||||||
case 1: // DATA_ONLINE (0|1)
|
case 1: // DATA_ONLINE (0|1)
|
||||||
// TODO: implement fetching of this information
|
if (pinfo != null && pinfo.RegionID != UUID.Zero)
|
||||||
if (pinfo != null)
|
|
||||||
reply = "1";
|
reply = "1";
|
||||||
else
|
else
|
||||||
reply = "0";
|
reply = "0";
|
||||||
|
|
Loading…
Reference in New Issue