diff options
author | Diva Canto | 2011-05-24 09:38:03 -0700 |
---|---|---|
committer | Diva Canto | 2011-05-24 09:38:03 -0700 |
commit | e19031849ec2957f7312d7e2417bd8c8da0efc53 (patch) | |
tree | af29b1a7625422ef9b249537b1e5a17617ddbc7c /OpenSim/Region/CoreModules | |
parent | HG friends: Status notifications working. Also initial logins get the online ... (diff) | |
download | opensim-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')
3 files changed, 59 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; | |||
35 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
38 | using OpenSim.Services.Connectors.Hypergrid; | ||
38 | 39 | ||
39 | using OpenMetaverse; | 40 | using OpenMetaverse; |
40 | using log4net; | 41 | using 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) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 3f63db3..eef60a1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -58,6 +58,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
58 | 58 | ||
59 | private List<Scene> m_Scenes = new List<Scene>(); | 59 | private List<Scene> m_Scenes = new List<Scene>(); |
60 | 60 | ||
61 | protected IUserManagement m_UserManagement; | ||
62 | protected IUserManagement UserManagementModule | ||
63 | { | ||
64 | get | ||
65 | { | ||
66 | if (m_UserManagement == null) | ||
67 | m_UserManagement = m_Scenes[0].RequestModuleInterface<IUserManagement>(); | ||
68 | return m_UserManagement; | ||
69 | } | ||
70 | } | ||
71 | |||
61 | public Type ReplaceableInterface | 72 | public Type ReplaceableInterface |
62 | { | 73 | { |
63 | get { return null; } | 74 | get { return null; } |
@@ -206,6 +217,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
206 | return; | 217 | return; |
207 | } | 218 | } |
208 | } | 219 | } |
220 | else | ||
221 | { | ||
222 | inventoryURL = UserManagementModule.GetUserServerURL(userID, "InventoryServerURI"); | ||
223 | inventoryURL = inventoryURL.Trim(new char[] { '/' }); | ||
224 | } | ||
209 | } | 225 | } |
210 | } | 226 | } |
211 | } | 227 | } |