aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework
diff options
context:
space:
mode:
authorDiva Canto2011-05-24 09:38:03 -0700
committerDiva Canto2011-05-24 09:38:03 -0700
commite19031849ec2957f7312d7e2417bd8c8da0efc53 (patch)
treeaf29b1a7625422ef9b249537b1e5a17617ddbc7c /OpenSim/Region/CoreModules/Framework
parentHG friends: Status notifications working. Also initial logins get the online ... (diff)
downloadopensim-SC_OLD-e19031849ec2957f7312d7e2417bd8c8da0efc53.zip
opensim-SC_OLD-e19031849ec2957f7312d7e2417bd8c8da0efc53.tar.gz
opensim-SC_OLD-e19031849ec2957f7312d7e2417bd8c8da0efc53.tar.bz2
opensim-SC_OLD-e19031849ec2957f7312d7e2417bd8c8da0efc53.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs36
2 files changed, 43 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 52791cb..429dda7 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -110,7 +110,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
110 public void UploadInventoryItem(UUID avatarID, UUID assetID, string name, int userlevel) 110 public void UploadInventoryItem(UUID avatarID, UUID assetID, string name, int userlevel)
111 { 111 {
112 string userAssetServer = string.Empty; 112 string userAssetServer = string.Empty;
113 if (IsForeignUser(avatarID, out userAssetServer) && m_OutboundPermission) 113 if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission)
114 { 114 {
115 Util.FireAndForget(delegate { m_assMapper.Post(assetID, avatarID, userAssetServer); }); 115 Util.FireAndForget(delegate { m_assMapper.Post(assetID, avatarID, userAssetServer); });
116 } 116 }
@@ -180,10 +180,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
180 public override void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver) 180 public override void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver)
181 { 181 {
182 string userAssetServer = string.Empty; 182 string userAssetServer = string.Empty;
183 if (IsForeignUser(sender, out userAssetServer)) 183 if (IsForeignUser(sender, out userAssetServer) && userAssetServer != string.Empty)
184 m_assMapper.Get(item.AssetID, sender, userAssetServer); 184 m_assMapper.Get(item.AssetID, sender, userAssetServer);
185 185
186 if (IsForeignUser(receiver, out userAssetServer) && m_OutboundPermission) 186 if (IsForeignUser(receiver, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission)
187 m_assMapper.Post(item.AssetID, receiver, userAssetServer); 187 m_assMapper.Post(item.AssetID, receiver, userAssetServer);
188 } 188 }
189 189
@@ -203,9 +203,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
203 if (aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) 203 if (aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
204 { 204 {
205 assetServerURL = aCircuit.ServiceURLs["AssetServerURI"].ToString(); 205 assetServerURL = aCircuit.ServiceURLs["AssetServerURI"].ToString();
206 assetServerURL = assetServerURL.Trim(new char[] { '/' }); return true; 206 assetServerURL = assetServerURL.Trim(new char[] { '/' });
207 } 207 }
208 } 208 }
209 else
210 {
211 assetServerURL = UserManagementModule.GetUserServerURL(userID, "AssetServerURI");
212 assetServerURL = assetServerURL.Trim(new char[] { '/' });
213 }
214 return true;
209 } 215 }
210 216
211 return false; 217 return false;
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 795de09..4d073b2 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -35,6 +35,7 @@ using OpenSim.Region.Framework;
35using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes; 36using OpenSim.Region.Framework.Scenes;
37using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
38using OpenSim.Services.Connectors.Hypergrid;
38 39
39using OpenMetaverse; 40using OpenMetaverse;
40using log4net; 41using log4net;
@@ -47,7 +48,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
47 public UUID Id; 48 public UUID Id;
48 public string FirstName; 49 public string FirstName;
49 public string LastName; 50 public string LastName;
50 public string ProfileURL; 51 public string HomeURL;
52 public Dictionary<string, object> ServerURLs;
51 } 53 }
52 54
53 public class UserManagementModule : ISharedRegionModule, IUserManagement 55 public class UserManagementModule : ISharedRegionModule, IUserManagement
@@ -224,6 +226,34 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
224 return "(hippos)"; 226 return "(hippos)";
225 } 227 }
226 228
229 public string GetUserHomeURL(UUID userID)
230 {
231 if (m_UserCache.ContainsKey(userID))
232 return m_UserCache[userID].HomeURL;
233
234 return string.Empty;
235 }
236
237 public string GetUserServerURL(UUID userID, string serverType)
238 {
239 if (m_UserCache.ContainsKey(userID))
240 {
241 UserData userdata = m_UserCache[userID];
242 if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null)
243 return userdata.ServerURLs[serverType].ToString();
244
245 if (userdata.HomeURL != string.Empty)
246 {
247 UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL);
248 userdata.ServerURLs = uConn.GetServerURLs(userID);
249 if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null)
250 return userdata.ServerURLs[serverType].ToString();
251 }
252 }
253
254 return string.Empty;
255 }
256
227 public void AddUser(UUID id, string creatorData) 257 public void AddUser(UUID id, string creatorData)
228 { 258 {
229 if (m_UserCache.ContainsKey(id)) 259 if (m_UserCache.ContainsKey(id))
@@ -249,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
249 string[] parts = creatorData.Split(';'); 279 string[] parts = creatorData.Split(';');
250 if (parts.Length >= 1) 280 if (parts.Length >= 1)
251 { 281 {
252 user.ProfileURL = parts[0]; 282 user.HomeURL = parts[0];
253 try 283 try
254 { 284 {
255 Uri uri = new Uri(parts[0]); 285 Uri uri = new Uri(parts[0]);
@@ -274,7 +304,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
274 lock (m_UserCache) 304 lock (m_UserCache)
275 m_UserCache[id] = user; 305 m_UserCache[id] = user;
276 306
277 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); 307 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.HomeURL);
278 } 308 }
279 309
280 public void AddUser(UUID uuid, string first, string last, string profileURL) 310 public void AddUser(UUID uuid, string first, string last, string profileURL)