aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-06-27 23:14:28 +0100
committerJustin Clark-Casey (justincc)2013-06-27 23:14:28 +0100
commitf7d09b898ad6df32b3f07cb64657623980178c2f (patch)
treef7f2b1117e9843267dab89993ad6d5492c1b3cc8 /OpenSim/Region/Framework
parentUpdate temporary "Unknown UserUMMTGUN2" name to "Unknown UserUMMTGUN3" to see... (diff)
downloadopensim-SC-f7d09b898ad6df32b3f07cb64657623980178c2f.zip
opensim-SC-f7d09b898ad6df32b3f07cb64657623980178c2f.tar.gz
opensim-SC-f7d09b898ad6df32b3f07cb64657623980178c2f.tar.bz2
opensim-SC-f7d09b898ad6df32b3f07cb64657623980178c2f.tar.xz
Make the concept of namespaces explicit in dynamic attributes
This is in order to reduce the likelihood of naming clashes, make it easier to filter in/out attributes, ensure uniformity, etc. All dynattrs in the opensim distro itself or likely future ones should be in the "OpenSim" namespace. This does alter the underlying dynattrs data structure. All data in previous structures may not be available, though old structures should not cause errors. This is done without notice since this feature has been explicitly labelled as experimental, subject to change and has not been in a release. However, existing materials data is being preserved by moving it to the "Materials" store in the "OpenSim" namespace.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs18
2 files changed, 11 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 3882b45..945745e 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -1290,7 +1290,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1290 if (sop.MediaUrl != null) 1290 if (sop.MediaUrl != null)
1291 writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); 1291 writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString());
1292 1292
1293 if (sop.DynAttrs.Count > 0) 1293 if (sop.DynAttrs.CountNamespaces > 0)
1294 { 1294 {
1295 writer.WriteStartElement("DynAttrs"); 1295 writer.WriteStartElement("DynAttrs");
1296 sop.DynAttrs.WriteXml(writer); 1296 sop.DynAttrs.WriteXml(writer);
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index 0e83781..586b59d 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -212,7 +212,6 @@ namespace OpenSim.Region.Framework.Scenes
212// } 212// }
213// } 213// }
214 214
215
216 /// <summary> 215 /// <summary>
217 /// Gather all of the texture asset UUIDs used to reference "Materials" such as normal and specular maps 216 /// Gather all of the texture asset UUIDs used to reference "Materials" such as normal and specular maps
218 /// </summary> 217 /// </summary>
@@ -221,20 +220,23 @@ namespace OpenSim.Region.Framework.Scenes
221 public void GatherMaterialsUuids(SceneObjectPart part, IDictionary<UUID, AssetType> assetUuids) 220 public void GatherMaterialsUuids(SceneObjectPart part, IDictionary<UUID, AssetType> assetUuids)
222 { 221 {
223 // scan thru the dynAttrs map of this part for any textures used as materials 222 // scan thru the dynAttrs map of this part for any textures used as materials
224 OSDMap OSMaterials = null; 223 OSD osdMaterials = null;
225 224
226 lock (part.DynAttrs) 225 lock (part.DynAttrs)
227 { 226 {
228 if (part.DynAttrs.ContainsKey("OS:Materials")) 227 if (part.DynAttrs.ContainsStore("OpenSim", "Materials"))
229 OSMaterials = part.DynAttrs["OS:Materials"]; 228 {
230 if (OSMaterials != null && OSMaterials.ContainsKey("Materials")) 229 OSDMap materialsStore = part.DynAttrs.GetStore("OpenSim", "Materials");
230 materialsStore.TryGetValue("Materials", out osdMaterials);
231 }
232
233 if (osdMaterials != null)
231 { 234 {
232 OSD osd = OSMaterials["Materials"];
233 //m_log.Info("[UUID Gatherer]: found Materials: " + OSDParser.SerializeJsonString(osd)); 235 //m_log.Info("[UUID Gatherer]: found Materials: " + OSDParser.SerializeJsonString(osd));
234 236
235 if (osd is OSDArray) 237 if (osdMaterials is OSDArray)
236 { 238 {
237 OSDArray matsArr = osd as OSDArray; 239 OSDArray matsArr = osdMaterials as OSDArray;
238 foreach (OSDMap matMap in matsArr) 240 foreach (OSDMap matMap in matsArr)
239 { 241 {
240 try 242 try