mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Changed GetAgents to take string[] instead of UUID[]
This commit is contained in:
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
||||
|
||||
if (serviceDll == String.Empty)
|
||||
{
|
||||
m_log.Error("[LOCAL PRESENCE CONNECTOR]: No LocalServiceModule named in section InventoryService");
|
||||
m_log.Error("[LOCAL PRESENCE CONNECTOR]: No LocalServiceModule named in section PresenceService");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
||||
return m_PresenceService.GetAgent(sessionID);
|
||||
}
|
||||
|
||||
public PresenceInfo[] GetAgents(UUID[] principalIDs)
|
||||
public PresenceInfo[] GetAgents(string[] principalIDs)
|
||||
{
|
||||
return m_PresenceService.GetAgents(principalIDs);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,6 @@ namespace OpenSim.Services.Interfaces
|
||||
bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt);
|
||||
|
||||
PresenceInfo GetAgent(UUID sessionID);
|
||||
PresenceInfo[] GetAgents(UUID[] PrincipalIDs);
|
||||
PresenceInfo[] GetAgents(string[] principalIDs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,30 +116,34 @@ namespace OpenSim.Services.PresenceService
|
||||
return ret;
|
||||
}
|
||||
|
||||
public PresenceInfo[] GetAgents(UUID[] PrincipalIDs)
|
||||
public PresenceInfo[] GetAgents(string[] principalIDs)
|
||||
{
|
||||
List<PresenceInfo> info = new List<PresenceInfo>();
|
||||
|
||||
foreach (UUID principalID in PrincipalIDs)
|
||||
foreach (string principalIDStr in principalIDs)
|
||||
{
|
||||
PresenceData[] data = m_Database.Get("PrincipalID",
|
||||
principalID.ToString());
|
||||
|
||||
foreach (PresenceData d in data)
|
||||
UUID principalID = UUID.Zero;
|
||||
if (UUID.TryParse(principalIDStr, out principalID))
|
||||
{
|
||||
PresenceInfo ret = new PresenceInfo();
|
||||
PresenceData[] data = m_Database.Get("PrincipalID",
|
||||
principalID.ToString());
|
||||
|
||||
ret.PrincipalID = d.PrincipalID;
|
||||
ret.RegionID = d.RegionID;
|
||||
ret.Online = bool.Parse(d.Data["Online"]);
|
||||
ret.Login = Util.ToDateTime(Convert.ToInt32(
|
||||
d.Data["Login"]));
|
||||
ret.Logout = Util.ToDateTime(Convert.ToInt32(
|
||||
d.Data["Logout"]));
|
||||
ret.Position = Vector3.Parse(d.Data["Position"]);
|
||||
ret.LookAt = Vector3.Parse(d.Data["LookAt"]);
|
||||
foreach (PresenceData d in data)
|
||||
{
|
||||
PresenceInfo ret = new PresenceInfo();
|
||||
|
||||
info.Add(ret);
|
||||
ret.PrincipalID = d.PrincipalID;
|
||||
ret.RegionID = d.RegionID;
|
||||
ret.Online = bool.Parse(d.Data["Online"]);
|
||||
ret.Login = Util.ToDateTime(Convert.ToInt32(
|
||||
d.Data["Login"]));
|
||||
ret.Logout = Util.ToDateTime(Convert.ToInt32(
|
||||
d.Data["Logout"]));
|
||||
ret.Position = Vector3.Parse(d.Data["Position"]);
|
||||
ret.LookAt = Vector3.Parse(d.Data["LookAt"]);
|
||||
|
||||
info.Add(ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user