mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Added necessary code to drop inventory on hg friends using the profile window, but can't test because this mechanism doesn't seem to work without a profile service.
This commit is contained in:
@@ -110,7 +110,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
public void UploadInventoryItem(UUID avatarID, UUID assetID, string name, int userlevel)
|
||||
{
|
||||
string userAssetServer = string.Empty;
|
||||
if (IsForeignUser(avatarID, out userAssetServer) && m_OutboundPermission)
|
||||
if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission)
|
||||
{
|
||||
Util.FireAndForget(delegate { m_assMapper.Post(assetID, avatarID, userAssetServer); });
|
||||
}
|
||||
@@ -180,10 +180,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
public override void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver)
|
||||
{
|
||||
string userAssetServer = string.Empty;
|
||||
if (IsForeignUser(sender, out userAssetServer))
|
||||
if (IsForeignUser(sender, out userAssetServer) && userAssetServer != string.Empty)
|
||||
m_assMapper.Get(item.AssetID, sender, userAssetServer);
|
||||
|
||||
if (IsForeignUser(receiver, out userAssetServer) && m_OutboundPermission)
|
||||
if (IsForeignUser(receiver, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission)
|
||||
m_assMapper.Post(item.AssetID, receiver, userAssetServer);
|
||||
}
|
||||
|
||||
@@ -203,9 +203,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
if (aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
|
||||
{
|
||||
assetServerURL = aCircuit.ServiceURLs["AssetServerURI"].ToString();
|
||||
assetServerURL = assetServerURL.Trim(new char[] { '/' }); return true;
|
||||
assetServerURL = assetServerURL.Trim(new char[] { '/' });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
assetServerURL = UserManagementModule.GetUserServerURL(userID, "AssetServerURI");
|
||||
assetServerURL = assetServerURL.Trim(new char[] { '/' });
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -35,6 +35,7 @@ using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Services.Connectors.Hypergrid;
|
||||
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
@@ -47,7 +48,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
public UUID Id;
|
||||
public string FirstName;
|
||||
public string LastName;
|
||||
public string ProfileURL;
|
||||
public string HomeURL;
|
||||
public Dictionary<string, object> ServerURLs;
|
||||
}
|
||||
|
||||
public class UserManagementModule : ISharedRegionModule, IUserManagement
|
||||
@@ -224,6 +226,34 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
return "(hippos)";
|
||||
}
|
||||
|
||||
public string GetUserHomeURL(UUID userID)
|
||||
{
|
||||
if (m_UserCache.ContainsKey(userID))
|
||||
return m_UserCache[userID].HomeURL;
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public string GetUserServerURL(UUID userID, string serverType)
|
||||
{
|
||||
if (m_UserCache.ContainsKey(userID))
|
||||
{
|
||||
UserData userdata = m_UserCache[userID];
|
||||
if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null)
|
||||
return userdata.ServerURLs[serverType].ToString();
|
||||
|
||||
if (userdata.HomeURL != string.Empty)
|
||||
{
|
||||
UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL);
|
||||
userdata.ServerURLs = uConn.GetServerURLs(userID);
|
||||
if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null)
|
||||
return userdata.ServerURLs[serverType].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public void AddUser(UUID id, string creatorData)
|
||||
{
|
||||
if (m_UserCache.ContainsKey(id))
|
||||
@@ -249,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
string[] parts = creatorData.Split(';');
|
||||
if (parts.Length >= 1)
|
||||
{
|
||||
user.ProfileURL = parts[0];
|
||||
user.HomeURL = parts[0];
|
||||
try
|
||||
{
|
||||
Uri uri = new Uri(parts[0]);
|
||||
@@ -274,7 +304,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
lock (m_UserCache)
|
||||
m_UserCache[id] = user;
|
||||
|
||||
m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL);
|
||||
m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.HomeURL);
|
||||
}
|
||||
|
||||
public void AddUser(UUID uuid, string first, string last, string profileURL)
|
||||
|
||||
Reference in New Issue
Block a user