aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2012-01-12 17:52:29 +0000
committerMelanie2012-01-12 17:52:29 +0000
commit4492bc1bcd055ab5b6f187612462b14b6494fea9 (patch)
tree168e808c3931efc0e05f05ae60aafda6f0a4e946 /OpenSim/Region/CoreModules
parentRemove ViewObjectInventory method unsupported by core (diff)
parentAllow update of stored entries within User Management Module-this is needed f... (diff)
downloadopensim-SC-4492bc1bcd055ab5b6f187612462b14b6494fea9.zip
opensim-SC-4492bc1bcd055ab5b6f187612462b14b6494fea9.tar.gz
opensim-SC-4492bc1bcd055ab5b6f187612462b14b6494fea9.tar.bz2
opensim-SC-4492bc1bcd055ab5b6f187612462b14b6494fea9.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs5
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs10
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs9
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs100
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs8
6 files changed, 79 insertions, 59 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index a19bbfd..0833154 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -493,7 +493,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
493 } 493 }
494 else 494 else
495 { 495 {
496 sceneObjects.Add(SceneObjectSerializer.FromOriginalXmlFormat(xmlData)); 496 SceneObjectGroup deserializedObject = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
497
498 if (deserializedObject != null)
499 sceneObjects.Add(deserializedObject);
497 } 500 }
498 501
499 foreach (SceneObjectGroup sog in sceneObjects) 502 foreach (SceneObjectGroup sog in sceneObjects)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index d20c9eb..eaadc1b 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -55,16 +55,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
55// private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>(); 55// private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>();
56 56
57 private Scene m_scene; 57 private Scene m_scene;
58 private string m_ProfileServerURI; 58 private string m_HomeURI;
59 59
60 #endregion 60 #endregion
61 61
62 #region Constructor 62 #region Constructor
63 63
64 public HGAssetMapper(Scene scene, string profileURL) 64 public HGAssetMapper(Scene scene, string homeURL)
65 { 65 {
66 m_scene = scene; 66 m_scene = scene;
67 m_ProfileServerURI = profileURL; 67 m_HomeURI = homeURL;
68 } 68 }
69 69
70 #endregion 70 #endregion
@@ -150,7 +150,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
150 UUID.TryParse(meta.CreatorID, out uuid); 150 UUID.TryParse(meta.CreatorID, out uuid);
151 UserAccount creator = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid); 151 UserAccount creator = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid);
152 if (creator != null) 152 if (creator != null)
153 meta.CreatorID = m_ProfileServerURI + "/" + meta.CreatorID + ";" + creator.FirstName + " " + creator.LastName; 153 meta.CreatorID = m_HomeURI + ";" + creator.FirstName + " " + creator.LastName;
154 } 154 }
155 } 155 }
156 156
@@ -193,7 +193,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
193 if (!hasCreatorData && creator != null) 193 if (!hasCreatorData && creator != null)
194 { 194 {
195 XmlElement creatorData = doc.CreateElement("CreatorData"); 195 XmlElement creatorData = doc.CreateElement("CreatorData");
196 creatorData.InnerText = m_ProfileServerURI + "/" + creator.PrincipalID + ";" + creator.FirstName + " " + creator.LastName; 196 creatorData.InnerText = m_HomeURI + ";" + creator.FirstName + " " + creator.LastName;
197 sop.AppendChild(creatorData); 197 sop.AppendChild(creatorData);
198 } 198 }
199 } 199 }
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index bf24ebc..0c4ff7f 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
54 get { return m_assMapper; } 54 get { return m_assMapper; }
55 } 55 }
56 56
57 private string m_ProfileServerURI; 57 private string m_HomeURI;
58 private bool m_OutboundPermission; 58 private bool m_OutboundPermission;
59 private string m_ThisGatekeeper; 59 private string m_ThisGatekeeper;
60 60
@@ -84,7 +84,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
84 IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"]; 84 IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"];
85 if (thisModuleConfig != null) 85 if (thisModuleConfig != null)
86 { 86 {
87 m_ProfileServerURI = thisModuleConfig.GetString("ProfileServerURI", string.Empty); 87 // legacy configuration [obsolete]
88 m_HomeURI = thisModuleConfig.GetString("ProfileServerURI", string.Empty);
89 // preferred
90 m_HomeURI = thisModuleConfig.GetString("HomeURI", m_HomeURI);
88 m_OutboundPermission = thisModuleConfig.GetBoolean("OutboundPermission", true); 91 m_OutboundPermission = thisModuleConfig.GetBoolean("OutboundPermission", true);
89 m_ThisGatekeeper = thisModuleConfig.GetString("Gatekeeper", string.Empty); 92 m_ThisGatekeeper = thisModuleConfig.GetString("Gatekeeper", string.Empty);
90 } 93 }
@@ -100,7 +103,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
100 return; 103 return;
101 104
102 base.AddRegion(scene); 105 base.AddRegion(scene);
103 m_assMapper = new HGAssetMapper(scene, m_ProfileServerURI); 106 m_assMapper = new HGAssetMapper(scene, m_HomeURI);
104 scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem; 107 scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem;
105 108
106 } 109 }
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 37292d6..2ad30a0 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -423,58 +423,62 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
423 AddUser(uuid, profileURL + ";" + first + " " + last); 423 AddUser(uuid, profileURL + ";" + first + " " + last);
424 } 424 }
425 425
426 public void AddUser(UUID id, string creatorData) 426 public void AddUser (UUID id, string creatorData)
427 { 427 {
428 lock (m_UserCache) 428 UserData oldUser;
429 { 429 //lock the whole block - prevent concurrent update
430 if (m_UserCache.ContainsKey(id)) 430 lock (m_UserCache) {
431 return; 431 m_UserCache.TryGetValue (id, out oldUser);
432 } 432 if (oldUser != null) {
433 433 if (creatorData == null || creatorData == String.Empty) {
434// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, craetorData {1}", id, creatorData); 434 //ignore updates without creator data
435 435 return;
436 UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); 436 }
437 437 //try update unknown users
438 if (account != null) 438 //and creator's home URL's
439 { 439 if ((oldUser.FirstName == "Unknown" && !creatorData.Contains ("Unknown")) || (oldUser.HomeURL != null && !creatorData.StartsWith (oldUser.HomeURL))) {
440 AddUser(id, account.FirstName, account.LastName); 440 m_UserCache.Remove (id);
441 } 441// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Re-adding user with id {0}, creatorData [{1}] and old HomeURL {2}", id, creatorData,oldUser.HomeURL);
442 else 442 } else {
443 { 443 //we have already a valid user within the cache
444 UserData user = new UserData(); 444 return;
445 user.Id = id;
446 user.Flags = -1;
447 user.Created = -1;
448
449 if (creatorData != null && creatorData != string.Empty)
450 {
451 //creatorData = <endpoint>;<name>
452
453 string[] parts = creatorData.Split(';');
454 if (parts.Length >= 1)
455 {
456 user.HomeURL = parts[0];
457 try
458 {
459 Uri uri = new Uri(parts[0]);
460 user.LastName = "@" + uri.Authority;
461 }
462 catch (UriFormatException)
463 {
464 m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]);
465 user.LastName = "@unknown";
466 }
467 } 445 }
468 if (parts.Length >= 2)
469 user.FirstName = parts[1].Replace(' ', '.');
470 } 446 }
471 else 447// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData);
472 { 448
473 user.FirstName = "Unknown"; 449 UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount (m_Scenes[0].RegionInfo.ScopeID, id);
474 user.LastName = "User"; 450
451 if (account != null) {
452 AddUser (id, account.FirstName, account.LastName);
453 } else {
454 UserData user = new UserData ();
455 user.Id = id;
456 user.Flags = -1;
457 user.Created = -1;
458
459 if (creatorData != null && creatorData != string.Empty) {
460 //creatorData = <endpoint>;<name>
461
462 string[] parts = creatorData.Split (';');
463 if (parts.Length >= 1) {
464 user.HomeURL = parts[0];
465 try {
466 Uri uri = new Uri (parts[0]);
467 user.LastName = "@" + uri.Authority;
468 } catch (UriFormatException) {
469 m_log.DebugFormat ("[SCENE]: Unable to parse Uri {0}", parts[0]);
470 user.LastName = "@unknown";
471 }
472 }
473 if (parts.Length >= 2)
474 user.FirstName = parts[1].Replace (' ', '.');
475 } else {
476 user.FirstName = "Unknown";
477 user.LastName = "User";
478 }
479
480 AddUserInternal (user);
475 } 481 }
476
477 AddUserInternal(user);
478 } 482 }
479 } 483 }
480 484
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 238863e..a22f619 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -422,6 +422,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
422 string extension = filename.Substring(i); 422 string extension = filename.Substring(i);
423 string uuid = filename.Remove(filename.Length - extension.Length); 423 string uuid = filename.Remove(filename.Length - extension.Length);
424 424
425 if (m_scene.AssetService.GetMetadata(uuid) != null)
426 {
427 // m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid);
428 return true;
429 }
430
425 if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) 431 if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension))
426 { 432 {
427 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; 433 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index f44a3ba..0707cbe 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -125,8 +125,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
125 Dictionary<string, object> options = new Dictionary<string, object>(); 125 Dictionary<string, object> options = new Dictionary<string, object>();
126 126
127 OptionSet ops = new OptionSet(); 127 OptionSet ops = new OptionSet();
128// ops.Add("v|version=", delegate(string v) { options["version"] = v; }); 128
129 ops.Add("p|profile=", delegate(string v) { options["profile"] = v; }); 129 // legacy argument [obsolete]
130 ops.Add("p|profile=", delegate(string v) { Console.WriteLine("\n WARNING: -profile option is obsolete and it will not work. Use -home instead.\n"); });
131 // preferred
132 ops.Add("h|home=", delegate(string v) { options["home"] = v; });
133
130 ops.Add("noassets", delegate(string v) { options["noassets"] = v != null; }); 134 ops.Add("noassets", delegate(string v) { options["noassets"] = v != null; });
131 ops.Add("perm=", delegate(string v) { options["checkPermissions"] = v; }); 135 ops.Add("perm=", delegate(string v) { options["checkPermissions"] = v; });
132 136