diff options
author | Melanie | 2012-02-04 11:48:20 +0000 |
---|---|---|
committer | Melanie | 2012-02-04 11:48:20 +0000 |
commit | ce5e900721cb0447f76bcb198faf5f7c31eeaf6e (patch) | |
tree | c906a2b8858f9c590e39e2a26f47017fd7b6b9c6 /OpenSim/Region/Framework/Scenes | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Add default value to TelehubObject (diff) | |
download | opensim-SC_OLD-ce5e900721cb0447f76bcb198faf5f7c31eeaf6e.zip opensim-SC_OLD-ce5e900721cb0447f76bcb198faf5f7c31eeaf6e.tar.gz opensim-SC_OLD-ce5e900721cb0447f76bcb198faf5f7c31eeaf6e.tar.bz2 opensim-SC_OLD-ce5e900721cb0447f76bcb198faf5f7c31eeaf6e.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Data/MySQL/Resources/RegionStore.migrations
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
5 files changed, 57 insertions, 88 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 817736f..58de44e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1491,12 +1491,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
1491 | // m_log.DebugFormat( | 1491 | // m_log.DebugFormat( |
1492 | // "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()", | 1492 | // "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()", |
1493 | // currentItem.Name, part.Name); | 1493 | // currentItem.Name, part.Name); |
1494 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); | 1494 | |
1495 | if (agentTransactions != null) | 1495 | // Only look for an uploaded updated asset if we are passed a transaction ID. This is only the |
1496 | // case for updates uploded through UDP. Updates uploaded via a capability (e.g. a script update) | ||
1497 | // will not pass in a transaction ID in the update message. | ||
1498 | if (transactionID != UUID.Zero) | ||
1496 | { | 1499 | { |
1497 | agentTransactions.HandleTaskItemUpdateFromTransaction( | 1500 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); |
1498 | remoteClient, part, transactionID, currentItem); | 1501 | if (agentTransactions != null) |
1502 | { | ||
1503 | agentTransactions.HandleTaskItemUpdateFromTransaction( | ||
1504 | remoteClient, part, transactionID, currentItem); | ||
1505 | |||
1506 | // if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) | ||
1507 | // remoteClient.SendAgentAlertMessage("Notecard saved", false); | ||
1508 | // else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) | ||
1509 | // remoteClient.SendAgentAlertMessage("Script saved", false); | ||
1510 | // else | ||
1511 | // remoteClient.SendAgentAlertMessage("Item saved", false); | ||
1512 | } | ||
1499 | } | 1513 | } |
1514 | |||
1500 | // Base ALWAYS has move | 1515 | // Base ALWAYS has move |
1501 | currentItem.BasePermissions |= (uint)PermissionMask.Move; | 1516 | currentItem.BasePermissions |= (uint)PermissionMask.Move; |
1502 | 1517 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 0d14963..a6c234e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2781,10 +2781,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2781 | if (ParentGroup == null) | 2781 | if (ParentGroup == null) |
2782 | return; | 2782 | return; |
2783 | 2783 | ||
2784 | // When running OpenSim tests, Scene (and EventManager can be null). | ||
2785 | // Need to fix tests before we can trigger this here | ||
2786 | // ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2787 | |||
2788 | ParentGroup.QueueForUpdateCheck(); | 2784 | ParentGroup.QueueForUpdateCheck(); |
2789 | 2785 | ||
2790 | int timeNow = Util.UnixTimeSinceEpoch(); | 2786 | int timeNow = Util.UnixTimeSinceEpoch(); |
@@ -2806,6 +2802,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2806 | // m_log.DebugFormat( | 2802 | // m_log.DebugFormat( |
2807 | // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", | 2803 | // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", |
2808 | // UUID, Name, TimeStampFull); | 2804 | // UUID, Name, TimeStampFull); |
2805 | |||
2806 | if (ParentGroup.Scene != null) | ||
2807 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2809 | } | 2808 | } |
2810 | 2809 | ||
2811 | /// <summary> | 2810 | /// <summary> |
@@ -2817,15 +2816,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2817 | if (ParentGroup == null) | 2816 | if (ParentGroup == null) |
2818 | return; | 2817 | return; |
2819 | 2818 | ||
2820 | // When running OpenSim tests, Scene (and EventManager can be null). | ||
2821 | // Need to fix tests before we can trigger this here | ||
2822 | // ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2823 | |||
2824 | // This was pulled from SceneViewer. Attachments always receive full updates. | 2819 | // This was pulled from SceneViewer. Attachments always receive full updates. |
2825 | // I could not verify if this is a requirement but this maintains existing behavior | 2820 | // I could not verify if this is a requirement but this maintains existing behavior |
2826 | if (ParentGroup.IsAttachment) | 2821 | if (ParentGroup.IsAttachment) |
2827 | { | 2822 | { |
2828 | ScheduleFullUpdate(); | 2823 | ScheduleFullUpdate(); |
2824 | return; | ||
2829 | } | 2825 | } |
2830 | 2826 | ||
2831 | if (UpdateFlag == UpdateRequired.NONE) | 2827 | if (UpdateFlag == UpdateRequired.NONE) |
@@ -2840,6 +2836,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2840 | // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", | 2836 | // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", |
2841 | // UUID, Name, TimeStampTerse); | 2837 | // UUID, Name, TimeStampTerse); |
2842 | } | 2838 | } |
2839 | |||
2840 | if (ParentGroup.Scene != null) | ||
2841 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2843 | } | 2842 | } |
2844 | 2843 | ||
2845 | public void ScriptSetPhysicsStatus(bool UsePhysics) | 2844 | public void ScriptSetPhysicsStatus(bool UsePhysics) |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 6303cb1..ba33122 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -34,6 +34,7 @@ using System.Xml; | |||
34 | using log4net; | 34 | using log4net; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Serialization.External; | ||
37 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
39 | 40 | ||
@@ -276,14 +277,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
276 | 277 | ||
277 | #region manual serialization | 278 | #region manual serialization |
278 | 279 | ||
279 | private delegate void SOPXmlProcessor(SceneObjectPart sop, XmlTextReader reader); | 280 | private static Dictionary<string, Action<SceneObjectPart, XmlTextReader>> m_SOPXmlProcessors |
280 | private static Dictionary<string, SOPXmlProcessor> m_SOPXmlProcessors = new Dictionary<string, SOPXmlProcessor>(); | 281 | = new Dictionary<string, Action<SceneObjectPart, XmlTextReader>>(); |
281 | 282 | ||
282 | private delegate void TaskInventoryXmlProcessor(TaskInventoryItem item, XmlTextReader reader); | 283 | private static Dictionary<string, Action<TaskInventoryItem, XmlTextReader>> m_TaskInventoryXmlProcessors |
283 | private static Dictionary<string, TaskInventoryXmlProcessor> m_TaskInventoryXmlProcessors = new Dictionary<string, TaskInventoryXmlProcessor>(); | 284 | = new Dictionary<string, Action<TaskInventoryItem, XmlTextReader>>(); |
284 | 285 | ||
285 | private delegate void ShapeXmlProcessor(PrimitiveBaseShape shape, XmlTextReader reader); | 286 | private static Dictionary<string, Action<PrimitiveBaseShape, XmlTextReader>> m_ShapeXmlProcessors |
286 | private static Dictionary<string, ShapeXmlProcessor> m_ShapeXmlProcessors = new Dictionary<string, ShapeXmlProcessor>(); | 287 | = new Dictionary<string, Action<PrimitiveBaseShape, XmlTextReader>>(); |
287 | 288 | ||
288 | static SceneObjectSerializer() | 289 | static SceneObjectSerializer() |
289 | { | 290 | { |
@@ -1480,34 +1481,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1480 | 1481 | ||
1481 | reader.ReadStartElement("SceneObjectPart"); | 1482 | reader.ReadStartElement("SceneObjectPart"); |
1482 | 1483 | ||
1483 | string nodeName = string.Empty; | 1484 | ExternalRepresentationUtils.ExecuteReadProcessors( |
1484 | while (reader.NodeType != XmlNodeType.EndElement) | 1485 | obj, |
1485 | { | 1486 | m_SOPXmlProcessors, |
1486 | nodeName = reader.Name; | 1487 | reader, |
1487 | SOPXmlProcessor p = null; | 1488 | (o, nodeName, e) |
1488 | if (m_SOPXmlProcessors.TryGetValue(reader.Name, out p)) | 1489 | => m_log.ErrorFormat( |
1489 | { | 1490 | "[SceneObjectSerializer]: Exception while parsing {0} in object {1} {2}: {3}{4}", |
1490 | //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); | 1491 | ((SceneObjectPart)o).Name, ((SceneObjectPart)o).UUID, nodeName, e.Message, e.StackTrace)); |
1491 | try | ||
1492 | { | ||
1493 | p(obj, reader); | ||
1494 | } | ||
1495 | catch (Exception e) | ||
1496 | { | ||
1497 | m_log.DebugFormat( | ||
1498 | "[SceneObjectSerializer]: exception while parsing {0} in object {1} {2}: {3}{4}", | ||
1499 | obj.Name, obj.UUID, nodeName, e.Message, e.StackTrace); | ||
1500 | if (reader.NodeType == XmlNodeType.EndElement) | ||
1501 | reader.Read(); | ||
1502 | } | ||
1503 | } | ||
1504 | else | ||
1505 | { | ||
1506 | // m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element {0}", nodeName); | ||
1507 | reader.ReadOuterXml(); // ignore | ||
1508 | } | ||
1509 | |||
1510 | } | ||
1511 | 1492 | ||
1512 | reader.ReadEndElement(); // SceneObjectPart | 1493 | reader.ReadEndElement(); // SceneObjectPart |
1513 | 1494 | ||
@@ -1526,17 +1507,12 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1526 | reader.ReadStartElement("TaskInventoryItem", String.Empty); // TaskInventory | 1507 | reader.ReadStartElement("TaskInventoryItem", String.Empty); // TaskInventory |
1527 | 1508 | ||
1528 | TaskInventoryItem item = new TaskInventoryItem(); | 1509 | TaskInventoryItem item = new TaskInventoryItem(); |
1529 | while (reader.NodeType != XmlNodeType.EndElement) | 1510 | |
1530 | { | 1511 | ExternalRepresentationUtils.ExecuteReadProcessors( |
1531 | TaskInventoryXmlProcessor p = null; | 1512 | item, |
1532 | if (m_TaskInventoryXmlProcessors.TryGetValue(reader.Name, out p)) | 1513 | m_TaskInventoryXmlProcessors, |
1533 | p(item, reader); | 1514 | reader); |
1534 | else | 1515 | |
1535 | { | ||
1536 | // m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in TaskInventory {0}, {1}", reader.Name, reader.Value); | ||
1537 | reader.ReadOuterXml(); | ||
1538 | } | ||
1539 | } | ||
1540 | reader.ReadEndElement(); // TaskInventoryItem | 1516 | reader.ReadEndElement(); // TaskInventoryItem |
1541 | tinv.Add(item.ItemID, item); | 1517 | tinv.Add(item.ItemID, item); |
1542 | 1518 | ||
@@ -1563,35 +1539,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1563 | 1539 | ||
1564 | reader.ReadStartElement(name, String.Empty); // Shape | 1540 | reader.ReadStartElement(name, String.Empty); // Shape |
1565 | 1541 | ||
1566 | string nodeName = string.Empty; | 1542 | ExternalRepresentationUtils.ExecuteReadProcessors( |
1567 | while (reader.NodeType != XmlNodeType.EndElement) | 1543 | shape, |
1568 | { | 1544 | m_ShapeXmlProcessors, |
1569 | nodeName = reader.Name; | 1545 | reader, |
1570 | //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); | 1546 | (o, nodeName, e) |
1571 | ShapeXmlProcessor p = null; | 1547 | => m_log.ErrorFormat( |
1572 | if (m_ShapeXmlProcessors.TryGetValue(reader.Name, out p)) | 1548 | "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", |
1573 | { | 1549 | nodeName, e.Message, e.StackTrace)); |
1574 | try | ||
1575 | { | ||
1576 | p(shape, reader); | ||
1577 | } | ||
1578 | catch (Exception e) | ||
1579 | { | ||
1580 | errors = true; | ||
1581 | m_log.DebugFormat( | ||
1582 | "[SceneObjectSerializer]: exception while parsing Shape property {0}: {1}{2}", | ||
1583 | nodeName, e.Message, e.StackTrace); | ||
1584 | |||
1585 | if (reader.NodeType == XmlNodeType.EndElement) | ||
1586 | reader.Read(); | ||
1587 | } | ||
1588 | } | ||
1589 | else | ||
1590 | { | ||
1591 | // m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in Shape {0}", reader.Name); | ||
1592 | reader.ReadOuterXml(); | ||
1593 | } | ||
1594 | } | ||
1595 | 1550 | ||
1596 | reader.ReadEndElement(); // Shape | 1551 | reader.ReadEndElement(); // Shape |
1597 | 1552 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs index 6f99abd..c582cf6 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
49 | // log4net.Config.XmlConfigurator.Configure(); | 49 | // log4net.Config.XmlConfigurator.Configure(); |
50 | 50 | ||
51 | UUID userId = TestHelpers.ParseTail(0x1); | 51 | UUID userId = TestHelpers.ParseTail(0x1); |
52 | UUID itemId = TestHelpers.ParseTail(0x2); | 52 | // UUID itemId = TestHelpers.ParseTail(0x2); |
53 | string itemName = "Test Script Item"; | 53 | string itemName = "Test Script Item"; |
54 | 54 | ||
55 | Scene scene = SceneHelpers.SetupScene(); | 55 | Scene scene = SceneHelpers.SetupScene(); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index d4c299f..ed9b179 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | |||
@@ -174,7 +174,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
174 | TestHelpers.InMethod(); | 174 | TestHelpers.InMethod(); |
175 | // log4net.Config.XmlConfigurator.Configure(); | 175 | // log4net.Config.XmlConfigurator.Configure(); |
176 | 176 | ||
177 | UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); | 177 | // UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); |
178 | 178 | ||
179 | TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); | 179 | TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); |
180 | TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); | 180 | TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); |