diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
6 files changed, 92 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index ef21834..67732ff 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -370,6 +370,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
370 | 370 | ||
371 | item = new InventoryItemBase(); | 371 | item = new InventoryItemBase(); |
372 | item.CreatorId = objectGroup.RootPart.CreatorID.ToString(); | 372 | item.CreatorId = objectGroup.RootPart.CreatorID.ToString(); |
373 | item.CreatorData = objectGroup.RootPart.CreatorData; | ||
373 | item.ID = UUID.Random(); | 374 | item.ID = UUID.Random(); |
374 | item.InvType = (int)InventoryType.Object; | 375 | item.InvType = (int)InventoryType.Object; |
375 | item.Folder = folder.ID; | 376 | item.Folder = folder.ID; |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 88ed763..0d94baa 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -164,7 +164,11 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
164 | AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData); | 164 | AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData); |
165 | 165 | ||
166 | foreach (SceneObjectPart sop in sog.Parts) | 166 | foreach (SceneObjectPart sop in sog.Parts) |
167 | { | ||
167 | AddUser(sop.CreatorID, sop.CreatorData); | 168 | AddUser(sop.CreatorID, sop.CreatorData); |
169 | foreach (TaskInventoryItem item in sop.TaskInventory.Values) | ||
170 | AddUser(item.CreatorID, item.CreatorData); | ||
171 | } | ||
168 | } | 172 | } |
169 | 173 | ||
170 | 174 | ||
@@ -226,40 +230,49 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
226 | UserData user = new UserData(); | 230 | UserData user = new UserData(); |
227 | user.Id = id; | 231 | user.Id = id; |
228 | 232 | ||
229 | if (creatorData != null && creatorData != string.Empty) | 233 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); |
230 | { | ||
231 | //creatorData = <endpoint>;<name> | ||
232 | 234 | ||
233 | string[] parts = creatorData.Split(';'); | 235 | if (account != null) |
234 | if (parts.Length >= 1) | ||
235 | { | ||
236 | user.ProfileURL = parts[0]; | ||
237 | try | ||
238 | { | ||
239 | Uri uri = new Uri(parts[0]); | ||
240 | user.LastName = "@" + uri.Authority; | ||
241 | } | ||
242 | catch | ||
243 | { | ||
244 | m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]); | ||
245 | user.LastName = "@unknown"; | ||
246 | } | ||
247 | } | ||
248 | if (parts.Length >= 2) | ||
249 | user.FirstName = parts[1].Replace(' ', '.'); | ||
250 | } | ||
251 | else | ||
252 | { | 236 | { |
253 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); | ||
254 | user.FirstName = account.FirstName; | 237 | user.FirstName = account.FirstName; |
255 | user.LastName = account.LastName; | 238 | user.LastName = account.LastName; |
256 | // user.ProfileURL = we should initialize this to the default | 239 | // user.ProfileURL = we should initialize this to the default |
257 | } | 240 | } |
241 | else | ||
242 | { | ||
243 | if (creatorData != null && creatorData != string.Empty) | ||
244 | { | ||
245 | //creatorData = <endpoint>;<name> | ||
246 | |||
247 | string[] parts = creatorData.Split(';'); | ||
248 | if (parts.Length >= 1) | ||
249 | { | ||
250 | user.ProfileURL = parts[0]; | ||
251 | try | ||
252 | { | ||
253 | Uri uri = new Uri(parts[0]); | ||
254 | user.LastName = "@" + uri.Authority; | ||
255 | } | ||
256 | catch | ||
257 | { | ||
258 | m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]); | ||
259 | user.LastName = "@unknown"; | ||
260 | } | ||
261 | } | ||
262 | if (parts.Length >= 2) | ||
263 | user.FirstName = parts[1].Replace(' ', '.'); | ||
264 | } | ||
265 | else | ||
266 | { | ||
267 | user.FirstName = "Unknown"; | ||
268 | user.LastName = "User"; | ||
269 | } | ||
270 | } | ||
258 | 271 | ||
259 | lock (m_UserCache) | 272 | lock (m_UserCache) |
260 | m_UserCache[id] = user; | 273 | m_UserCache[id] = user; |
261 | 274 | ||
262 | //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); | 275 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); |
263 | } | 276 | } |
264 | 277 | ||
265 | //public void AddUser(UUID uuid, string userData) | 278 | //public void AddUser(UUID uuid, string userData) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index ab6be50..c7244c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -49,6 +49,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
49 | 49 | ||
50 | private IInventoryService m_InventoryService; | 50 | private IInventoryService m_InventoryService; |
51 | 51 | ||
52 | private Scene m_Scene; | ||
53 | |||
54 | private IUserManagement m_UserManager; | ||
55 | private IUserManagement UserManager | ||
56 | { | ||
57 | get | ||
58 | { | ||
59 | if (m_UserManager == null) | ||
60 | { | ||
61 | m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>(); | ||
62 | } | ||
63 | return m_UserManager; | ||
64 | } | ||
65 | } | ||
66 | |||
52 | private bool m_Enabled = false; | 67 | private bool m_Enabled = false; |
53 | 68 | ||
54 | public Type ReplaceableInterface | 69 | public Type ReplaceableInterface |
@@ -115,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
115 | return; | 130 | return; |
116 | 131 | ||
117 | scene.RegisterModuleInterface<IInventoryService>(this); | 132 | scene.RegisterModuleInterface<IInventoryService>(this); |
133 | |||
134 | if (m_Scene == null) | ||
135 | m_Scene = scene; | ||
118 | } | 136 | } |
119 | 137 | ||
120 | public void RemoveRegion(Scene scene) | 138 | public void RemoveRegion(Scene scene) |
@@ -163,7 +181,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
163 | 181 | ||
164 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 182 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
165 | { | 183 | { |
166 | return m_InventoryService.GetFolderContent(userID, folderID); | 184 | InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID); |
185 | if (UserManager != null) | ||
186 | foreach (InventoryItemBase item in invCol.Items) | ||
187 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | ||
188 | |||
189 | return invCol; | ||
167 | } | 190 | } |
168 | 191 | ||
169 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 192 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 17d80c7..9213132 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -47,9 +47,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
47 | 47 | ||
48 | private bool m_Enabled = false; | 48 | private bool m_Enabled = false; |
49 | private bool m_Initialized = false; | 49 | private bool m_Initialized = false; |
50 | // private Scene m_Scene; | 50 | private Scene m_Scene; |
51 | private InventoryServicesConnector m_RemoteConnector; | 51 | private InventoryServicesConnector m_RemoteConnector; |
52 | 52 | ||
53 | private IUserManagement m_UserManager; | ||
54 | private IUserManagement UserManager | ||
55 | { | ||
56 | get | ||
57 | { | ||
58 | if (m_UserManager == null) | ||
59 | { | ||
60 | m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>(); | ||
61 | } | ||
62 | return m_UserManager; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | |||
53 | public Type ReplaceableInterface | 67 | public Type ReplaceableInterface |
54 | { | 68 | { |
55 | get { return null; } | 69 | get { return null; } |
@@ -116,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
116 | 130 | ||
117 | scene.RegisterModuleInterface<IInventoryService>(this); | 131 | scene.RegisterModuleInterface<IInventoryService>(this); |
118 | m_cache.AddRegion(scene); | 132 | m_cache.AddRegion(scene); |
133 | |||
134 | if (m_Scene == null) | ||
135 | m_Scene = scene; | ||
119 | } | 136 | } |
120 | 137 | ||
121 | public void RemoveRegion(Scene scene) | 138 | public void RemoveRegion(Scene scene) |
@@ -186,7 +203,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
186 | UUID sessionID = GetSessionID(userID); | 203 | UUID sessionID = GetSessionID(userID); |
187 | try | 204 | try |
188 | { | 205 | { |
189 | return m_RemoteConnector.GetFolderContent(userID.ToString(), folderID, sessionID); | 206 | InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID.ToString(), folderID, sessionID); |
207 | foreach (InventoryItemBase item in invCol.Items) | ||
208 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | ||
209 | return invCol; | ||
190 | } | 210 | } |
191 | catch (Exception e) | 211 | catch (Exception e) |
192 | { | 212 | { |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index b7fa799..3238a81 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -269,7 +269,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
269 | if (!ResolveUserUuid(part.CreatorID)) | 269 | if (!ResolveUserUuid(part.CreatorID)) |
270 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 270 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
271 | } | 271 | } |
272 | UserManager.AddUser(part.CreatorID, part.CreatorData); | 272 | if (UserManager != null) |
273 | UserManager.AddUser(part.CreatorID, part.CreatorData); | ||
273 | 274 | ||
274 | if (!ResolveUserUuid(part.OwnerID)) | 275 | if (!ResolveUserUuid(part.OwnerID)) |
275 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 276 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
@@ -293,10 +294,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
293 | { | 294 | { |
294 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 295 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
295 | } | 296 | } |
296 | if (!ResolveUserUuid(kvp.Value.CreatorID)) | 297 | if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty) |
297 | { | 298 | { |
298 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 299 | if (!ResolveUserUuid(kvp.Value.CreatorID)) |
300 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
299 | } | 301 | } |
302 | if (UserManager != null) | ||
303 | UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); | ||
300 | } | 304 | } |
301 | } | 305 | } |
302 | } | 306 | } |
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index c06ccb2..568ba19 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -189,6 +189,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
189 | 189 | ||
190 | InventoryItemBase item = new InventoryItemBase(); | 190 | InventoryItemBase item = new InventoryItemBase(); |
191 | item.CreatorId = part.CreatorID.ToString(); | 191 | item.CreatorId = part.CreatorID.ToString(); |
192 | item.CreatorData = part.CreatorData; | ||
192 | 193 | ||
193 | item.ID = UUID.Random(); | 194 | item.ID = UUID.Random(); |
194 | item.Owner = remoteClient.AgentId; | 195 | item.Owner = remoteClient.AgentId; |