diff options
author | Diva Canto | 2010-11-21 17:19:24 -0800 |
---|---|---|
committer | Diva Canto | 2010-11-21 17:19:24 -0800 |
commit | c617d658dda92ad97de678d477a98c3df0659303 (patch) | |
tree | 9a86356af2fcf4ae4eab18b53dc7330bf3e26a86 /OpenSim/Region/CoreModules/Framework | |
parent | Updated SQLiteLegacy/SQLiteSimulationData with the same. Is this crap still u... (diff) | |
download | opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.zip opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.tar.gz opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.tar.bz2 opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.tar.xz |
Added creator info across the board -- TaskInventoryItems and InventoryItems themselves. Tested. Seems to be working, main tests pass. Nothing done for IARs or HG transfers yet -- this only works for OARs for the time being.
New migration in inventory table in order to make CreatorID varchar(255).
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 61 |
2 files changed, 38 insertions, 24 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) |