aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorUbitUmarov2017-06-10 02:48:51 +0100
committerUbitUmarov2017-06-10 02:48:51 +0100
commitb5910cfdb7461d523e2dc34dc9f33fe096766525 (patch)
treec8fa1bfd77c9b77f636117b953422f2cf66c0c07 /OpenSim/Region/Framework
parentMerge branch 'master' into httptests (diff)
parentadd a adicional in transit flag to signal HG tps, and use it to ignore userna... (diff)
downloadopensim-SC-b5910cfdb7461d523e2dc34dc9f33fe096766525.zip
opensim-SC-b5910cfdb7461d523e2dc34dc9f33fe096766525.tar.gz
opensim-SC-b5910cfdb7461d523e2dc34dc9f33fe096766525.tar.bz2
opensim-SC-b5910cfdb7461d523e2dc34dc9f33fe096766525.tar.xz
merge
Diffstat (limited to 'OpenSim/Region/Framework')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs121
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs24
5 files changed, 111 insertions, 71 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e1e06d0..ebef158 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -394,6 +394,7 @@ namespace OpenSim.Region.Framework.Scenes
394 /// asynchronously from the update loop. 394 /// asynchronously from the update loop.
395 /// </summary> 395 /// </summary>
396 private bool m_cleaningTemps = false; 396 private bool m_cleaningTemps = false;
397 private bool m_sendingCoarseLocations = false; // same for async course locations sending
397 398
398 /// <summary> 399 /// <summary>
399 /// Used to control main scene thread looping time when not updating via timer. 400 /// Used to control main scene thread looping time when not updating via timer.
@@ -1654,18 +1655,24 @@ namespace OpenSim.Region.Framework.Scenes
1654 if (Frame % m_update_entitymovement == 0) 1655 if (Frame % m_update_entitymovement == 0)
1655 m_sceneGraph.UpdateScenePresenceMovement(); 1656 m_sceneGraph.UpdateScenePresenceMovement();
1656 1657
1657 if (Frame % (m_update_coarse_locations) == 0) 1658 if (Frame % (m_update_coarse_locations) == 0 && !m_sendingCoarseLocations)
1658 { 1659 {
1659 List<Vector3> coarseLocations; 1660 m_sendingCoarseLocations = true;
1660 List<UUID> avatarUUIDs; 1661 WorkManager.RunInThreadPool(
1661 1662 delegate
1662 SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60); 1663 {
1663 // Send coarse locations to clients 1664 List<Vector3> coarseLocations;
1664 ForEachScenePresence(delegate(ScenePresence presence) 1665 List<UUID> avatarUUIDs;
1665 { 1666 SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60);
1666 presence.SendCoarseLocations(coarseLocations, avatarUUIDs); 1667 // Send coarse locations to clients
1667 }); 1668 ForEachScenePresence(delegate(ScenePresence presence)
1669 {
1670 presence.SendCoarseLocations(coarseLocations, avatarUUIDs);
1671 });
1672 m_sendingCoarseLocations = false;
1673 }, null, string.Format("SendCoarseLocations ({0})", Name));
1668 } 1674 }
1675
1669 // Get the simulation frame time that the avatar force input 1676 // Get the simulation frame time that the avatar force input
1670 // took 1677 // took
1671 tmpMS2 = Util.GetTimeStampMS(); 1678 tmpMS2 = Util.GetTimeStampMS();
@@ -1708,7 +1715,7 @@ namespace OpenSim.Region.Framework.Scenes
1708 if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps) 1715 if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps)
1709 { 1716 {
1710 m_cleaningTemps = true; 1717 m_cleaningTemps = true;
1711 WorkManager.RunInThread( 1718 WorkManager.RunInThreadPool(
1712 delegate { CleanTempObjects(); m_cleaningTemps = false; }, null, string.Format("CleanTempObjects ({0})", Name)); 1719 delegate { CleanTempObjects(); m_cleaningTemps = false; }, null, string.Format("CleanTempObjects ({0})", Name));
1713 tmpMS2 = Util.GetTimeStampMS(); 1720 tmpMS2 = Util.GetTimeStampMS();
1714 tempOnRezMS = (float)(tmpMS2 - tmpMS); // bad.. counts the FireAndForget, not CleanTempObjects 1721 tempOnRezMS = (float)(tmpMS2 - tmpMS); // bad.. counts the FireAndForget, not CleanTempObjects
@@ -1936,7 +1943,7 @@ namespace OpenSim.Region.Framework.Scenes
1936 if (!m_backingup) 1943 if (!m_backingup)
1937 { 1944 {
1938 m_backingup = true; 1945 m_backingup = true;
1939 WorkManager.RunInThread(o => Backup(false), null, string.Format("BackupWorker ({0})", Name)); 1946 WorkManager.RunInThreadPool(o => Backup(false), null, string.Format("BackupWorker ({0})", Name));
1940 } 1947 }
1941 } 1948 }
1942 1949
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 93c9b42..1695d9b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -807,6 +807,7 @@ namespace OpenSim.Region.Framework.Scenes
807 foreach (avtocrossInfo avinfo in avsToCross) 807 foreach (avtocrossInfo avinfo in avsToCross)
808 { 808 {
809 ScenePresence av = avinfo.av; 809 ScenePresence av = avinfo.av;
810 av.IsInLocalTransit = true;
810 av.IsInTransit = true; 811 av.IsInTransit = true;
811 m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val); 812 m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
812 813
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 60efc04..d8f2b80 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -91,7 +91,8 @@ namespace OpenSim.Region.Framework.Scenes
91 /// </value> 91 /// </value>
92 protected internal TaskInventoryDictionary Items 92 protected internal TaskInventoryDictionary Items
93 { 93 {
94 get { 94 get
95 {
95 return m_items; 96 return m_items;
96 } 97 }
97 set 98 set
@@ -141,45 +142,53 @@ namespace OpenSim.Region.Framework.Scenes
141 /// </remarks> 142 /// </remarks>
142 public void ResetInventoryIDs() 143 public void ResetInventoryIDs()
143 { 144 {
144 if (null == m_part) 145 if (m_part == null)
145 m_items.LockItemsForWrite(true); 146 return;
146 147
147 if (Items.Count == 0) 148 m_items.LockItemsForWrite(true);
149 if (m_items.Count == 0)
148 { 150 {
149 m_items.LockItemsForWrite(false); 151 m_items.LockItemsForWrite(false);
150 return; 152 return;
151 } 153 }
152 154
153 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); 155 UUID partID = m_part.UUID;
154 Items.Clear(); 156 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(m_items.Values);
157 m_items.Clear();
155 158
156 foreach (TaskInventoryItem item in items) 159 foreach (TaskInventoryItem item in items)
157 { 160 {
158 item.ResetIDs(m_part.UUID); 161 item.ResetIDs(partID);
159 Items.Add(item.ItemID, item); 162 m_items.Add(item.ItemID, item);
160 } 163 }
164 m_inventorySerial++;
161 m_items.LockItemsForWrite(false); 165 m_items.LockItemsForWrite(false);
162 } 166 }
163 167
164 public void ResetObjectID() 168 public void ResetObjectID()
165 { 169 {
170 if (m_part == null)
171 return;
172
166 m_items.LockItemsForWrite(true); 173 m_items.LockItemsForWrite(true);
167 174
168 if (Items.Count == 0) 175 if (m_items.Count == 0)
169 { 176 {
170 m_items.LockItemsForWrite(false); 177 m_items.LockItemsForWrite(false);
171 return; 178 return;
172 } 179 }
173 180
174 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); 181 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(m_items.Values);
175 Items.Clear(); 182 m_items.Clear();
176 183
184 UUID partID = m_part.UUID;
177 foreach (TaskInventoryItem item in items) 185 foreach (TaskInventoryItem item in items)
178 { 186 {
179 item.ParentPartID = m_part.UUID; 187 item.ParentPartID = partID;
180 item.ParentID = m_part.UUID; 188 item.ParentID = partID;
181 Items.Add(item.ItemID, item); 189 m_items.Add(item.ItemID, item);
182 } 190 }
191 m_inventorySerial++;
183 m_items.LockItemsForWrite(false); 192 m_items.LockItemsForWrite(false);
184 } 193 }
185 194
@@ -189,15 +198,17 @@ namespace OpenSim.Region.Framework.Scenes
189 /// <param name="ownerId"></param> 198 /// <param name="ownerId"></param>
190 public void ChangeInventoryOwner(UUID ownerId) 199 public void ChangeInventoryOwner(UUID ownerId)
191 { 200 {
192 List<TaskInventoryItem> items = GetInventoryItems(); 201 if(m_part == null)
193
194 if (items.Count == 0)
195 return; 202 return;
196 203
197 m_items.LockItemsForWrite(true); 204 m_items.LockItemsForWrite(true);
198 HasInventoryChanged = true; 205 if (m_items.Count == 0)
199 m_part.ParentGroup.HasGroupChanged = true; 206 {
200 foreach (TaskInventoryItem item in items) 207 m_items.LockItemsForWrite(false);
208 return;
209 }
210
211 foreach (TaskInventoryItem item in m_items.Values)
201 { 212 {
202 if (ownerId != item.OwnerID) 213 if (ownerId != item.OwnerID)
203 item.LastOwnerID = item.OwnerID; 214 item.LastOwnerID = item.OwnerID;
@@ -207,6 +218,8 @@ namespace OpenSim.Region.Framework.Scenes
207 item.PermsGranter = UUID.Zero; 218 item.PermsGranter = UUID.Zero;
208 item.OwnerChanged = true; 219 item.OwnerChanged = true;
209 } 220 }
221 HasInventoryChanged = true;
222 m_part.ParentGroup.HasGroupChanged = true;
210 m_inventorySerial++; 223 m_inventorySerial++;
211 m_items.LockItemsForWrite(false); 224 m_items.LockItemsForWrite(false);
212 } 225 }
@@ -217,8 +230,11 @@ namespace OpenSim.Region.Framework.Scenes
217 /// <param name="groupID"></param> 230 /// <param name="groupID"></param>
218 public void ChangeInventoryGroup(UUID groupID) 231 public void ChangeInventoryGroup(UUID groupID)
219 { 232 {
233 if(m_part == null)
234 return;
235
220 m_items.LockItemsForWrite(true); 236 m_items.LockItemsForWrite(true);
221 if (0 == Items.Count) 237 if (m_items.Count == 0)
222 { 238 {
223 m_items.LockItemsForWrite(false); 239 m_items.LockItemsForWrite(false);
224 return; 240 return;
@@ -233,11 +249,9 @@ namespace OpenSim.Region.Framework.Scenes
233 m_part.ParentGroup.HasGroupChanged = true; 249 m_part.ParentGroup.HasGroupChanged = true;
234 } 250 }
235 251
236 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); 252 foreach (TaskInventoryItem item in m_items.Values)
237 foreach (TaskInventoryItem item in items)
238 {
239 item.GroupID = groupID; 253 item.GroupID = groupID;
240 } 254
241 m_items.LockItemsForWrite(false); 255 m_items.LockItemsForWrite(false);
242 } 256 }
243 257
@@ -246,8 +260,8 @@ namespace OpenSim.Region.Framework.Scenes
246 if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null) 260 if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null)
247 return; 261 return;
248 262
249 Items.LockItemsForRead(true); 263 m_items.LockItemsForRead(true);
250 foreach (TaskInventoryItem item in Items.Values) 264 foreach (TaskInventoryItem item in m_items.Values)
251 { 265 {
252 if (item.InvType == (int)InventoryType.LSL) 266 if (item.InvType == (int)InventoryType.LSL)
253 { 267 {
@@ -257,7 +271,7 @@ namespace OpenSim.Region.Framework.Scenes
257 } 271 }
258 } 272 }
259 273
260 Items.LockItemsForRead(false); 274 m_items.LockItemsForRead(false);
261 } 275 }
262 276
263 public bool TryGetScriptInstanceRunning(UUID itemId, out bool running) 277 public bool TryGetScriptInstanceRunning(UUID itemId, out bool running)
@@ -345,7 +359,9 @@ namespace OpenSim.Region.Framework.Scenes
345 /// </summary> 359 /// </summary>
346 public void StopScriptInstances() 360 public void StopScriptInstances()
347 { 361 {
348 GetInventoryItems(InventoryType.LSL).ForEach(i => StopScriptInstance(i)); 362 List<TaskInventoryItem> scripts = GetInventoryItems(InventoryType.LSL);
363 foreach (TaskInventoryItem item in scripts)
364 StopScriptInstance(item);
349 } 365 }
350 366
351 /// <summary> 367 /// <summary>
@@ -807,7 +823,6 @@ namespace OpenSim.Region.Framework.Scenes
807 823
808 m_part.AggregateInnerPerms(); 824 m_part.AggregateInnerPerms();
809 m_inventorySerial++; 825 m_inventorySerial++;
810 //m_inventorySerial += 2;
811 HasInventoryChanged = true; 826 HasInventoryChanged = true;
812 m_part.ParentGroup.HasGroupChanged = true; 827 m_part.ParentGroup.HasGroupChanged = true;
813 } 828 }
@@ -1126,18 +1141,18 @@ namespace OpenSim.Region.Framework.Scenes
1126 { 1141 {
1127 bool changed = false; 1142 bool changed = false;
1128 1143
1129 Items.LockItemsForRead(true); 1144 m_items.LockItemsForRead(true);
1130 1145
1131 if (m_inventorySerial == 0) // No inventory 1146 if (m_inventorySerial == 0) // No inventory
1132 { 1147 {
1133 Items.LockItemsForRead(false); 1148 m_items.LockItemsForRead(false);
1134 client.SendTaskInventory(m_part.UUID, 0, new byte[0]); 1149 client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
1135 return; 1150 return;
1136 } 1151 }
1137 1152
1138 if (m_items.Count == 0) // No inventory 1153 if (m_items.Count == 0) // No inventory
1139 { 1154 {
1140 Items.LockItemsForRead(false); 1155 m_items.LockItemsForRead(false);
1141 client.SendTaskInventory(m_part.UUID, 0, new byte[0]); 1156 client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
1142 return; 1157 return;
1143 } 1158 }
@@ -1148,7 +1163,7 @@ namespace OpenSim.Region.Framework.Scenes
1148 changed = true; 1163 changed = true;
1149 } 1164 }
1150 1165
1151 Items.LockItemsForRead(false); 1166 m_items.LockItemsForRead(false);
1152 1167
1153 if (m_inventoryFileData.Length < 2) 1168 if (m_inventoryFileData.Length < 2)
1154 changed = true; 1169 changed = true;
@@ -1173,7 +1188,7 @@ namespace OpenSim.Region.Framework.Scenes
1173 1188
1174 InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); 1189 InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
1175 1190
1176 Items.LockItemsForRead(true); 1191 m_items.LockItemsForRead(true);
1177 1192
1178 foreach (TaskInventoryItem item in m_items.Values) 1193 foreach (TaskInventoryItem item in m_items.Values)
1179 { 1194 {
@@ -1234,7 +1249,7 @@ namespace OpenSim.Region.Framework.Scenes
1234 invString.AddSectionEnd(); 1249 invString.AddSectionEnd();
1235 } 1250 }
1236 1251
1237 Items.LockItemsForRead(false); 1252 m_items.LockItemsForRead(false);
1238 1253
1239 m_inventoryFileData = Utils.StringToBytes(invString.GetString()); 1254 m_inventoryFileData = Utils.StringToBytes(invString.GetString());
1240 1255
@@ -1264,10 +1279,10 @@ namespace OpenSim.Region.Framework.Scenes
1264// of prim inventory loss. 1279// of prim inventory loss.
1265// if (HasInventoryChanged) 1280// if (HasInventoryChanged)
1266// { 1281// {
1267 Items.LockItemsForRead(true); 1282 m_items.LockItemsForRead(true);
1268 ICollection<TaskInventoryItem> itemsvalues = Items.Values; 1283 ICollection<TaskInventoryItem> itemsvalues = m_items.Values;
1269 HasInventoryChanged = false; 1284 HasInventoryChanged = false;
1270 Items.LockItemsForRead(false); 1285 m_items.LockItemsForRead(false);
1271 try 1286 try
1272 { 1287 {
1273 datastore.StorePrimInventory(m_part.UUID, itemsvalues); 1288 datastore.StorePrimInventory(m_part.UUID, itemsvalues);
@@ -1434,15 +1449,13 @@ namespace OpenSim.Region.Framework.Scenes
1434 public int ScriptCount() 1449 public int ScriptCount()
1435 { 1450 {
1436 int count = 0; 1451 int count = 0;
1437 Items.LockItemsForRead(true); 1452 m_items.LockItemsForRead(true);
1438 foreach (TaskInventoryItem item in m_items.Values) 1453 foreach (TaskInventoryItem item in m_items.Values)
1439 { 1454 {
1440 if (item.InvType == (int)InventoryType.LSL) 1455 if (item.InvType == (int)InventoryType.LSL)
1441 {
1442 count++; 1456 count++;
1443 } 1457 }
1444 } 1458 m_items.LockItemsForRead(false);
1445 Items.LockItemsForRead(false);
1446 return count; 1459 return count;
1447 } 1460 }
1448 /// <summary> 1461 /// <summary>
@@ -1465,48 +1478,44 @@ namespace OpenSim.Region.Framework.Scenes
1465 if (engine != null) 1478 if (engine != null)
1466 { 1479 {
1467 if (engine.GetScriptState(item.ItemID)) 1480 if (engine.GetScriptState(item.ItemID))
1468 {
1469 count++; 1481 count++;
1470 } 1482 }
1471 } 1483 }
1472 } 1484 }
1473 }
1474 return count; 1485 return count;
1475 } 1486 }
1476 1487
1477 public List<UUID> GetInventoryList() 1488 public List<UUID> GetInventoryList()
1478 { 1489 {
1479 List<UUID> ret = new List<UUID>(); 1490 m_items.LockItemsForRead(true);
1480 1491
1492 List<UUID> ret = new List<UUID>(m_items.Count);
1481 foreach (TaskInventoryItem item in m_items.Values) 1493 foreach (TaskInventoryItem item in m_items.Values)
1482 ret.Add(item.ItemID); 1494 ret.Add(item.ItemID);
1483 1495
1496 m_items.LockItemsForRead(false);
1484 return ret; 1497 return ret;
1485 } 1498 }
1486 1499
1487 public List<TaskInventoryItem> GetInventoryItems() 1500 public List<TaskInventoryItem> GetInventoryItems()
1488 { 1501 {
1489 List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); 1502 m_items.LockItemsForRead(true);
1490 1503 List<TaskInventoryItem> ret = new List<TaskInventoryItem>(m_items.Values);
1491 Items.LockItemsForRead(true); 1504 m_items.LockItemsForRead(false);
1492 ret = new List<TaskInventoryItem>(m_items.Values);
1493 Items.LockItemsForRead(false);
1494 1505
1495 return ret; 1506 return ret;
1496 } 1507 }
1497 1508
1498 public List<TaskInventoryItem> GetInventoryItems(InventoryType type) 1509 public List<TaskInventoryItem> GetInventoryItems(InventoryType type)
1499 { 1510 {
1500 List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); 1511 m_items.LockItemsForRead(true);
1501
1502 Items.LockItemsForRead(true);
1503 1512
1513 List<TaskInventoryItem> ret = new List<TaskInventoryItem>(m_items.Count);
1504 foreach (TaskInventoryItem item in m_items.Values) 1514 foreach (TaskInventoryItem item in m_items.Values)
1505 if (item.InvType == (int)type) 1515 if (item.InvType == (int)type)
1506 ret.Add(item); 1516 ret.Add(item);
1507 1517
1508 Items.LockItemsForRead(false); 1518 m_items.LockItemsForRead(false);
1509
1510 return ret; 1519 return ret;
1511 } 1520 }
1512 1521
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index daa9e50..47af3b8 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -971,6 +971,10 @@ namespace OpenSim.Region.Framework.Scenes
971 m_inTransit = value; 971 m_inTransit = value;
972 } 972 }
973 } 973 }
974 // this is is only valid if IsInTransit is true
975 // only false on HG tps
976 // used work arounf viewers asking source region about destination user
977 public bool IsInLocalTransit {get; set; }
974 978
975 979
976 /// <summary> 980 /// <summary>
@@ -1040,6 +1044,7 @@ namespace OpenSim.Region.Framework.Scenes
1040 m_uuid = client.AgentId; 1044 m_uuid = client.AgentId;
1041 LocalId = m_scene.AllocateLocalId(); 1045 LocalId = m_scene.AllocateLocalId();
1042 LegacySitOffsets = m_scene.LegacySitOffsets; 1046 LegacySitOffsets = m_scene.LegacySitOffsets;
1047 IsInLocalTransit = true;
1043 1048
1044 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); 1049 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
1045 if (account != null) 1050 if (account != null)
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index b1b1fc5..b012a08 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -1361,9 +1361,27 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1361 1361
1362 private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlReader reader) 1362 private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlReader reader)
1363 { 1363 {
1364 // Get inner XML and pass to MediaList parser 1364 string value = String.Empty;
1365 string value = reader.ReadInnerXml(); 1365 try
1366 shp.Media = PrimitiveBaseShape.MediaList.FromXml(value); 1366 {
1367 // The STANDARD content of Media elemet is escaped XML string (with &gt; etc).
1368 value = reader.ReadElementContentAsString("Media", String.Empty);
1369 shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
1370 }
1371 catch (XmlException e)
1372 {
1373 // There are versions of OAR files that contain unquoted XML.
1374 // ie ONE comercial fork that never wanted their oars to be read by our code
1375 try
1376 {
1377 value = reader.ReadInnerXml();
1378 shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
1379 }
1380 catch
1381 {
1382 m_log.ErrorFormat("[SERIALIZER] Failed parsing halcyon MOAP information");
1383 }
1384 }
1367 } 1385 }
1368 1386
1369 #endregion 1387 #endregion