mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
More cleaning on presence. Friends online/offline works again.
This commit is contained in:
@@ -511,20 +511,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||
|
||||
PresenceInfo info = new PresenceInfo();
|
||||
|
||||
info.Online = true;
|
||||
info.UserID = sessionResponse["UserID"].AsUUID().ToString();
|
||||
info.RegionID = sessionResponse["SceneID"].AsUUID();
|
||||
info.Position = sessionResponse["ScenePosition"].AsVector3();
|
||||
info.LookAt = sessionResponse["SceneLookAt"].AsVector3();
|
||||
|
||||
if (userResponse != null && userResponse["User"] is OSDMap)
|
||||
{
|
||||
OSDMap user = (OSDMap)userResponse["User"];
|
||||
|
||||
info.Login = user["LastLoginDate"].AsDate();
|
||||
info.Logout = user["LastLogoutDate"].AsDate();
|
||||
DeserializeLocation(user["HomeLocation"].AsString(), out info.HomeRegionID, out info.HomePosition, out info.HomeLookAt);
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -36,14 +36,6 @@ namespace OpenSim.Services.Interfaces
|
||||
{
|
||||
public string UserID;
|
||||
public UUID RegionID;
|
||||
public bool Online;
|
||||
public DateTime Login;
|
||||
public DateTime Logout;
|
||||
public Vector3 Position;
|
||||
public Vector3 LookAt;
|
||||
public UUID HomeRegionID;
|
||||
public Vector3 HomePosition;
|
||||
public Vector3 HomeLookAt;
|
||||
|
||||
public PresenceInfo()
|
||||
{
|
||||
@@ -65,26 +57,6 @@ namespace OpenSim.Services.Interfaces
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static PresenceInfo[] GetOnlinePresences(PresenceInfo[] pinfos)
|
||||
{
|
||||
if (pinfos == null)
|
||||
return null;
|
||||
|
||||
List<PresenceInfo> lst = new List<PresenceInfo>(pinfos);
|
||||
lst = lst.FindAll(delegate(PresenceInfo each) { return each.Online; });
|
||||
|
||||
return lst.ToArray();
|
||||
}
|
||||
|
||||
public static PresenceInfo GetOnlinePresence(PresenceInfo[] pinfos)
|
||||
{
|
||||
pinfos = GetOnlinePresences(pinfos);
|
||||
if (pinfos != null && pinfos.Length >= 1)
|
||||
return pinfos[0];
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IPresenceService
|
||||
|
||||
@@ -115,10 +115,6 @@ namespace OpenSim.Services.PresenceService
|
||||
|
||||
ret.UserID = data.UserID;
|
||||
ret.RegionID = data.RegionID;
|
||||
if (data.Data.ContainsKey("Position"))
|
||||
ret.Position = Vector3.Parse(data.Data["Position"]);
|
||||
if (data.Data.ContainsKey("LookAt"))
|
||||
ret.LookAt = Vector3.Parse(data.Data["LookAt"]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -138,8 +134,6 @@ namespace OpenSim.Services.PresenceService
|
||||
|
||||
ret.UserID = d.UserID;
|
||||
ret.RegionID = d.RegionID;
|
||||
ret.Position = Vector3.Parse(d.Data["Position"]);
|
||||
ret.LookAt = Vector3.Parse(d.Data["LookAt"]);
|
||||
|
||||
info.Add(ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user