Merge branch 'master' into careminster-presence-refactor
commit
4e0d62547d
|
@ -1237,9 +1237,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PresenceInfo[] pinfos = m_app.SceneManager.CurrentOrFirstScene.PresenceService.GetAgents(new string[] { account.PrincipalID.ToString() });
|
GridUserInfo guinfo = m_app.SceneManager.CurrentOrFirstScene.GridUserService.GetGridUserInfo(account.PrincipalID.ToString());
|
||||||
if (pinfos != null && pinfos.Length >= 1)
|
if (guinfo != null)
|
||||||
responseData["lastlogin"] = pinfos[0].Login;
|
responseData["lastlogin"] = guinfo.Login;
|
||||||
else
|
else
|
||||||
responseData["lastlogin"] = 0;
|
responseData["lastlogin"] = 0;
|
||||||
|
|
||||||
|
|
|
@ -161,8 +161,8 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
MySqlCommand cmd =
|
MySqlCommand cmd =
|
||||||
new MySqlCommand(
|
new MySqlCommand(
|
||||||
"replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, data)" +
|
"replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, data)" +
|
||||||
"VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)",
|
"VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?data)",
|
||||||
dbcon);
|
dbcon);
|
||||||
|
|
||||||
string assetName = asset.Name;
|
string assetName = asset.Name;
|
||||||
|
@ -194,6 +194,7 @@ namespace OpenSim.Data.MySQL
|
||||||
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
|
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
|
||||||
cmd.Parameters.AddWithValue("?create_time", now);
|
cmd.Parameters.AddWithValue("?create_time", now);
|
||||||
cmd.Parameters.AddWithValue("?access_time", now);
|
cmd.Parameters.AddWithValue("?access_time", now);
|
||||||
|
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
|
||||||
cmd.Parameters.AddWithValue("?data", asset.Data);
|
cmd.Parameters.AddWithValue("?data", asset.Data);
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
cmd.Dispose();
|
cmd.Dispose();
|
||||||
|
@ -302,7 +303,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id FROM assets LIMIT ?start, ?count", dbcon);
|
MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id,asset_flags FROM assets LIMIT ?start, ?count", dbcon);
|
||||||
cmd.Parameters.AddWithValue("?start", start);
|
cmd.Parameters.AddWithValue("?start", start);
|
||||||
cmd.Parameters.AddWithValue("?count", count);
|
cmd.Parameters.AddWithValue("?count", count);
|
||||||
|
|
||||||
|
@ -317,6 +318,7 @@ namespace OpenSim.Data.MySQL
|
||||||
metadata.Description = (string)dbReader["description"];
|
metadata.Description = (string)dbReader["description"];
|
||||||
metadata.Type = (sbyte)dbReader["assetType"];
|
metadata.Type = (sbyte)dbReader["assetType"];
|
||||||
metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct.
|
metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct.
|
||||||
|
metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
|
||||||
metadata.FullID = new UUID((string)dbReader["id"]);
|
metadata.FullID = new UUID((string)dbReader["id"]);
|
||||||
|
|
||||||
// Current SHA1s are not stored/computed.
|
// Current SHA1s are not stored/computed.
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
COMMIT;
|
|
@ -33,6 +33,15 @@ using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Framework
|
namespace OpenSim.Framework
|
||||||
{
|
{
|
||||||
|
[Flags]
|
||||||
|
public enum AssetFlags : int
|
||||||
|
{
|
||||||
|
Normal = 0,
|
||||||
|
Maptile = 1,
|
||||||
|
Rewritable = 2,
|
||||||
|
Collectable = 4
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asset class. All Assets are reference by this class or a class derived from this class
|
/// Asset class. All Assets are reference by this class or a class derived from this class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -206,6 +215,12 @@ namespace OpenSim.Framework
|
||||||
set { m_metadata.Temporary = value; }
|
set { m_metadata.Temporary = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AssetFlags Flags
|
||||||
|
{
|
||||||
|
get { return m_metadata.Flags; }
|
||||||
|
set { m_metadata.Flags = value; }
|
||||||
|
}
|
||||||
|
|
||||||
[XmlIgnore]
|
[XmlIgnore]
|
||||||
public AssetMetadata Metadata
|
public AssetMetadata Metadata
|
||||||
{
|
{
|
||||||
|
@ -233,6 +248,7 @@ namespace OpenSim.Framework
|
||||||
private bool m_local;
|
private bool m_local;
|
||||||
private bool m_temporary;
|
private bool m_temporary;
|
||||||
private string m_creatorid;
|
private string m_creatorid;
|
||||||
|
private AssetFlags m_flags;
|
||||||
|
|
||||||
public UUID FullID
|
public UUID FullID
|
||||||
{
|
{
|
||||||
|
@ -330,5 +346,11 @@ namespace OpenSim.Framework
|
||||||
get { return m_creatorid; }
|
get { return m_creatorid; }
|
||||||
set { m_creatorid = value; }
|
set { m_creatorid = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AssetFlags Flags
|
||||||
|
{
|
||||||
|
get { return m_flags; }
|
||||||
|
set { m_flags = value; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -345,8 +345,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, new UUID(im.fromAgentID));
|
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, new UUID(im.fromAgentID));
|
||||||
im.fromAgentName = account.FirstName + " " + account.LastName;
|
im.fromAgentName = account.FirstName + " " + account.LastName;
|
||||||
|
|
||||||
|
PresenceInfo presence = null;
|
||||||
PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid });
|
PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid });
|
||||||
PresenceInfo presence = PresenceInfo.GetOnlinePresence(presences);
|
if (presences != null && presences.Length > 0)
|
||||||
|
presence = presences[0];
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
im.offline = 0;
|
im.offline = 0;
|
||||||
|
|
||||||
|
@ -380,13 +382,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray());
|
PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray());
|
||||||
|
|
||||||
foreach (PresenceInfo pi in presence)
|
foreach (PresenceInfo pi in presence)
|
||||||
{
|
|
||||||
if (pi.Online)
|
|
||||||
{
|
|
||||||
online.Add(new UUID(pi.UserID));
|
online.Add(new UUID(pi.UserID));
|
||||||
//m_log.DebugFormat("[XXX] {0} friend online {1}", userID, pi.UserID);
|
//m_log.DebugFormat("[XXX] {0} friend online {1}", userID, pi.UserID);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return online;
|
return online;
|
||||||
}
|
}
|
||||||
|
@ -462,12 +459,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
|
|
||||||
// The friend is not here [as root]. Let's forward.
|
// The friend is not here [as root]. Let's forward.
|
||||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
||||||
PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions);
|
if (friendSessions != null && friendSessions.Length > 0)
|
||||||
|
{
|
||||||
|
PresenceInfo friendSession = friendSessions[0];
|
||||||
if (friendSession != null)
|
if (friendSession != null)
|
||||||
{
|
{
|
||||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||||
m_FriendsSimConnector.StatusNotify(region, userID, friendID, online);
|
m_FriendsSimConnector.StatusNotify(region, userID, friendID, online);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Friend is not online. Ignore.
|
// Friend is not online. Ignore.
|
||||||
}
|
}
|
||||||
|
@ -504,13 +504,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
|
|
||||||
// The prospective friend is not here [as root]. Let's forward.
|
// The prospective friend is not here [as root]. Let's forward.
|
||||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
||||||
PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions);
|
if (friendSessions != null && friendSessions.Length > 0)
|
||||||
|
{
|
||||||
|
PresenceInfo friendSession = friendSessions[0];
|
||||||
if (friendSession != null)
|
if (friendSession != null)
|
||||||
{
|
{
|
||||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||||
m_FriendsSimConnector.FriendshipOffered(region, agentID, friendID, im.message);
|
m_FriendsSimConnector.FriendshipOffered(region, agentID, friendID, im.message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// If the prospective friend is not online, he'll get the message upon login.
|
// If the prospective friend is not online, he'll get the message upon login.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,14 +538,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
|
|
||||||
// The friend is not here
|
// The friend is not here
|
||||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
||||||
PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions);
|
if (friendSessions != null && friendSessions.Length > 0)
|
||||||
|
{
|
||||||
|
PresenceInfo friendSession = friendSessions[0];
|
||||||
if (friendSession != null)
|
if (friendSession != null)
|
||||||
{
|
{
|
||||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||||
m_FriendsSimConnector.FriendshipApproved(region, agentID, client.Name, friendID);
|
m_FriendsSimConnector.FriendshipApproved(region, agentID, client.Name, friendID);
|
||||||
client.SendAgentOnline(new UUID[] { friendID });
|
client.SendAgentOnline(new UUID[] { friendID });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDenyFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders)
|
private void OnDenyFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders)
|
||||||
|
@ -562,13 +566,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
||||||
PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions);
|
if (friendSessions != null && friendSessions.Length > 0)
|
||||||
|
{
|
||||||
|
PresenceInfo friendSession = friendSessions[0];
|
||||||
if (friendSession != null)
|
if (friendSession != null)
|
||||||
{
|
{
|
||||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||||
m_FriendsSimConnector.FriendshipDenied(region, agentID, client.Name, friendID);
|
m_FriendsSimConnector.FriendshipDenied(region, agentID, client.Name, friendID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTerminateFriendship(IClientAPI client, UUID agentID, UUID exfriendID)
|
private void OnTerminateFriendship(IClientAPI client, UUID agentID, UUID exfriendID)
|
||||||
{
|
{
|
||||||
|
@ -589,13 +596,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { exfriendID.ToString() });
|
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { exfriendID.ToString() });
|
||||||
PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions);
|
if (friendSessions != null && friendSessions.Length > 0)
|
||||||
|
{
|
||||||
|
PresenceInfo friendSession = friendSessions[0];
|
||||||
if (friendSession != null)
|
if (friendSession != null)
|
||||||
{
|
{
|
||||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||||
m_FriendsSimConnector.FriendshipTerminated(region, agentID, exfriendID);
|
m_FriendsSimConnector.FriendshipTerminated(region, agentID, exfriendID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnGrantUserRights(IClientAPI remoteClient, UUID requester, UUID target, int rights)
|
private void OnGrantUserRights(IClientAPI remoteClient, UUID requester, UUID target, int rights)
|
||||||
{
|
{
|
||||||
|
@ -631,7 +641,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { target.ToString() });
|
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { target.ToString() });
|
||||||
PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions);
|
if (friendSessions != null && friendSessions.Length > 0)
|
||||||
|
{
|
||||||
|
PresenceInfo friendSession = friendSessions[0];
|
||||||
if (friendSession != null)
|
if (friendSession != null)
|
||||||
{
|
{
|
||||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||||
|
@ -641,6 +653,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Local
|
#region Local
|
||||||
|
|
||||||
|
|
|
@ -471,7 +471,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||||
if (m_UserRegionMap.ContainsKey(toAgentID))
|
if (m_UserRegionMap.ContainsKey(toAgentID))
|
||||||
{
|
{
|
||||||
upd = new PresenceInfo();
|
upd = new PresenceInfo();
|
||||||
upd.Online = true;
|
|
||||||
upd.RegionID = m_UserRegionMap[toAgentID];
|
upd.RegionID = m_UserRegionMap[toAgentID];
|
||||||
|
|
||||||
// We need to compare the current regionhandle with the previous region handle
|
// We need to compare the current regionhandle with the previous region handle
|
||||||
|
@ -493,15 +492,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||||
{
|
{
|
||||||
// Non-cached user agent lookup.
|
// Non-cached user agent lookup.
|
||||||
PresenceInfo[] presences = PresenceService.GetAgents(new string[] { toAgentID.ToString() });
|
PresenceInfo[] presences = PresenceService.GetAgents(new string[] { toAgentID.ToString() });
|
||||||
if (presences != null)
|
if (presences != null && presences.Length > 0)
|
||||||
{
|
|
||||||
foreach (PresenceInfo p in presences)
|
|
||||||
if (p.Online)
|
|
||||||
{
|
|
||||||
upd = presences[0];
|
upd = presences[0];
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (upd != null)
|
if (upd != null)
|
||||||
{
|
{
|
||||||
|
@ -524,8 +516,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||||
}
|
}
|
||||||
|
|
||||||
if (upd != null)
|
if (upd != null)
|
||||||
{
|
|
||||||
if (upd.Online)
|
|
||||||
{
|
{
|
||||||
GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID,
|
GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID,
|
||||||
upd.RegionID);
|
upd.RegionID);
|
||||||
|
@ -577,12 +567,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||||
HandleUndeliveredMessage(im, result);
|
HandleUndeliveredMessage(im, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.WarnFormat("[GRID INSTANT MESSAGE]: Unable to find user {0}", toAgentID);
|
|
||||||
HandleUndeliveredMessage(im, result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This actually does the XMLRPC Request
|
/// This actually does the XMLRPC Request
|
||||||
|
|
|
@ -133,21 +133,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||||
foreach (PresenceInfo pi in status)
|
foreach (PresenceInfo pi in status)
|
||||||
{
|
{
|
||||||
UUID uuid = new UUID(pi.UserID);
|
UUID uuid = new UUID(pi.UserID);
|
||||||
if (pi.Online)
|
|
||||||
{
|
|
||||||
if (!online.Contains(uuid))
|
if (!online.Contains(uuid))
|
||||||
{
|
|
||||||
online.Add(uuid);
|
online.Add(uuid);
|
||||||
if (offline.Contains(uuid))
|
|
||||||
offline.Remove(uuid);
|
|
||||||
}
|
}
|
||||||
}
|
foreach (string s in args)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
UUID uuid = new UUID(s);
|
||||||
if (!online.Contains(uuid) && !offline.Contains(uuid))
|
if (!online.Contains(uuid) && !offline.Contains(uuid))
|
||||||
offline.Add(uuid);
|
offline.Add(uuid);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (online.Count > 0)
|
if (online.Count > 0)
|
||||||
client.SendAgentOnline(online.ToArray());
|
client.SendAgentOnline(online.ToArray());
|
||||||
|
|
|
@ -245,6 +245,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Let's find out if this is a foreign user or a local user
|
||||||
|
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId);
|
||||||
|
if (account != null)
|
||||||
|
{
|
||||||
|
// local grid user
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode);
|
AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode);
|
||||||
|
|
||||||
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||||
|
|
|
@ -4108,8 +4108,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
|
UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
|
||||||
|
|
||||||
|
PresenceInfo pinfo = null;
|
||||||
PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
|
PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
|
||||||
PresenceInfo pinfo = PresenceInfo.GetOnlinePresence(pinfos);
|
if (pinfos != null && pinfos.Length > 0)
|
||||||
|
pinfo = pinfos[0];
|
||||||
|
|
||||||
if (pinfo == null)
|
if (pinfo == null)
|
||||||
return UUID.Zero.ToString();
|
return UUID.Zero.ToString();
|
||||||
|
|
|
@ -181,6 +181,7 @@ namespace OpenSim.Services.AssetService
|
||||||
MainConsole.Instance.Output(String.Format("Description: {0}", asset.Description));
|
MainConsole.Instance.Output(String.Format("Description: {0}", asset.Description));
|
||||||
MainConsole.Instance.Output(String.Format("Type: {0}", asset.Type));
|
MainConsole.Instance.Output(String.Format("Type: {0}", asset.Type));
|
||||||
MainConsole.Instance.Output(String.Format("Content-type: {0}", asset.Metadata.ContentType));
|
MainConsole.Instance.Output(String.Format("Content-type: {0}", asset.Metadata.ContentType));
|
||||||
|
MainConsole.Instance.Output(String.Format("Flags: {0}", asset.Metadata.Flags.ToString()));
|
||||||
|
|
||||||
for (i = 0 ; i < 5 ; i++)
|
for (i = 0 ; i < 5 ; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -511,20 +511,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
|
|
||||||
PresenceInfo info = new PresenceInfo();
|
PresenceInfo info = new PresenceInfo();
|
||||||
|
|
||||||
info.Online = true;
|
|
||||||
info.UserID = sessionResponse["UserID"].AsUUID().ToString();
|
info.UserID = sessionResponse["UserID"].AsUUID().ToString();
|
||||||
info.RegionID = sessionResponse["SceneID"].AsUUID();
|
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;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,6 +185,10 @@ namespace OpenSim.Services.HypergridService
|
||||||
foreach (UUID session in travels)
|
foreach (UUID session in travels)
|
||||||
m_TravelingAgents.Remove(session);
|
m_TravelingAgents.Remove(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(userID.ToString());
|
||||||
|
if (guinfo != null)
|
||||||
|
m_GridUserService.LoggedOut(userID.ToString(), guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to prevent foreign users with the same UUID as a local user
|
// We need to prevent foreign users with the same UUID as a local user
|
||||||
|
|
|
@ -36,14 +36,6 @@ namespace OpenSim.Services.Interfaces
|
||||||
{
|
{
|
||||||
public string UserID;
|
public string UserID;
|
||||||
public UUID RegionID;
|
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()
|
public PresenceInfo()
|
||||||
{
|
{
|
||||||
|
@ -65,26 +57,6 @@ namespace OpenSim.Services.Interfaces
|
||||||
|
|
||||||
return result;
|
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
|
public interface IPresenceService
|
||||||
|
|
|
@ -115,10 +115,6 @@ namespace OpenSim.Services.PresenceService
|
||||||
|
|
||||||
ret.UserID = data.UserID;
|
ret.UserID = data.UserID;
|
||||||
ret.RegionID = data.RegionID;
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -138,8 +134,6 @@ namespace OpenSim.Services.PresenceService
|
||||||
|
|
||||||
ret.UserID = d.UserID;
|
ret.UserID = d.UserID;
|
||||||
ret.RegionID = d.RegionID;
|
ret.RegionID = d.RegionID;
|
||||||
ret.Position = Vector3.Parse(d.Data["Position"]);
|
|
||||||
ret.LookAt = Vector3.Parse(d.Data["LookAt"]);
|
|
||||||
|
|
||||||
info.Add(ret);
|
info.Add(ret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,8 +73,8 @@ namespace OpenSim.Tests.Clients.PresenceClient
|
||||||
if (pinfo == null)
|
if (pinfo == null)
|
||||||
m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0}", user1);
|
m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0}", user1);
|
||||||
else
|
else
|
||||||
m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}",
|
m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={1}",
|
||||||
pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID);
|
pinfo.UserID, pinfo.RegionID);
|
||||||
|
|
||||||
System.Console.WriteLine("\n");
|
System.Console.WriteLine("\n");
|
||||||
success = m_Connector.ReportAgent(session1, region1);
|
success = m_Connector.ReportAgent(session1, region1);
|
||||||
|
@ -86,8 +86,8 @@ namespace OpenSim.Tests.Clients.PresenceClient
|
||||||
if (pinfo == null)
|
if (pinfo == null)
|
||||||
m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for second time", user1);
|
m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for second time", user1);
|
||||||
else
|
else
|
||||||
m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}",
|
m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={2}",
|
||||||
pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID);
|
pinfo.UserID, pinfo.RegionID);
|
||||||
|
|
||||||
System.Console.WriteLine("\n");
|
System.Console.WriteLine("\n");
|
||||||
success = m_Connector.LogoutAgent(session1);
|
success = m_Connector.LogoutAgent(session1);
|
||||||
|
@ -99,8 +99,8 @@ namespace OpenSim.Tests.Clients.PresenceClient
|
||||||
if (pinfo == null)
|
if (pinfo == null)
|
||||||
m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for fourth time", user1);
|
m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for fourth time", user1);
|
||||||
else
|
else
|
||||||
m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}",
|
m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={1}",
|
||||||
pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID);
|
pinfo.UserID, pinfo.RegionID);
|
||||||
|
|
||||||
System.Console.WriteLine("\n");
|
System.Console.WriteLine("\n");
|
||||||
success = m_Connector.ReportAgent(session1, UUID.Random());
|
success = m_Connector.ReportAgent(session1, UUID.Random());
|
||||||
|
|
|
@ -77,6 +77,9 @@
|
||||||
GridService = "OpenSim.Services.GridService.dll:GridService"
|
GridService = "OpenSim.Services.GridService.dll:GridService"
|
||||||
InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService"
|
InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService"
|
||||||
|
|
||||||
|
[GridUserService]
|
||||||
|
LocalServiceModule = "OpenSim.Services.UserAccountService.dll:GridUserService"
|
||||||
|
|
||||||
[FriendsService]
|
[FriendsService]
|
||||||
LocalServiceModule = "OpenSim.Services.FriendsService.dll"
|
LocalServiceModule = "OpenSim.Services.FriendsService.dll"
|
||||||
ConnectionString = "URI=file:friends.db,version=3"
|
ConnectionString = "URI=file:friends.db,version=3"
|
||||||
|
|
Loading…
Reference in New Issue