From e9153e1d1aae50024d8cd05fe14a9bce34343a0e Mon Sep 17 00:00:00 2001 From: teravus Date: Thu, 15 Nov 2012 10:05:16 -0500 Subject: Revert "Merge master into teravuswork", it should have been avination, not master. This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64. --- .../Region/ScriptEngine/XEngine/EventManager.cs | 29 ++++++----- .../ScriptEngine/XEngine/Tests/XEngineTest.cs | 10 +--- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 57 ++++++---------------- 3 files changed, 34 insertions(+), 62 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 9405075..5c4174e 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -96,12 +96,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (part == null) return; - if ((part.ScriptEvents & scriptEvents.money) == 0) - part = part.ParentGroup.RootPart; - m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); -// part = part.ParentGroup.RootPart; + part = part.ParentGroup.RootPart; money(part.LocalId, agentID, amount); } @@ -155,7 +152,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine det[0] = new DetectParams(); det[0].Key = remoteClient.AgentId; det[0].Populate(myScriptEngine.World); - det[0].OffsetPos = offsetPos; + det[0].OffsetPos = new LSL_Types.Vector3(offsetPos.X, + offsetPos.Y, + offsetPos.Z); if (originalID == 0) { @@ -299,7 +298,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine foreach (DetectedObject detobj in col.Colliders) { DetectParams d = new DetectParams(); - d.Position = detobj.posVector; + d.Position = new LSL_Types.Vector3(detobj.posVector.X, + detobj.posVector.Y, + detobj.posVector.Z); d.Populate(myScriptEngine.World); det.Add(d); myScriptEngine.PostObjectEvent(localID, new EventParams( @@ -317,7 +318,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine foreach (DetectedObject detobj in col.Colliders) { DetectParams d = new DetectParams(); - d.Position = detobj.posVector; + d.Position = new LSL_Types.Vector3(detobj.posVector.X, + detobj.posVector.Y, + detobj.posVector.Z); d.Populate(myScriptEngine.World); det.Add(d); myScriptEngine.PostObjectEvent(localID, new EventParams( @@ -334,7 +337,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine foreach (DetectedObject detobj in col.Colliders) { DetectParams d = new DetectParams(); - d.Position = detobj.posVector; + d.Position = new LSL_Types.Vector3(detobj.posVector.X, + detobj.posVector.Y, + detobj.posVector.Z); d.Populate(myScriptEngine.World); det.Add(d); myScriptEngine.PostObjectEvent(localID, new EventParams( @@ -376,8 +381,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine myScriptEngine.PostObjectEvent(localID, new EventParams( "at_target", new object[] { new LSL_Types.LSLInteger(handle), - new LSL_Types.Vector3(targetpos), - new LSL_Types.Vector3(atpos) }, + new LSL_Types.Vector3(targetpos.X,targetpos.Y,targetpos.Z), + new LSL_Types.Vector3(atpos.X,atpos.Y,atpos.Z) }, new DetectParams[0])); } @@ -394,8 +399,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine myScriptEngine.PostObjectEvent(localID, new EventParams( "at_rot_target", new object[] { new LSL_Types.LSLInteger(handle), - new LSL_Types.Quaternion(targetrot), - new LSL_Types.Quaternion(atrot) }, + new LSL_Types.Quaternion(targetrot.X,targetrot.Y,targetrot.Z,targetrot.W), + new LSL_Types.Quaternion(atrot.X,atrot.Y,atrot.Z,atrot.W) }, new DetectParams[0])); } diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs index f331658..f247a0b 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs @@ -90,7 +90,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests // log4net.Config.XmlConfigurator.Configure(); UUID userId = TestHelpers.ParseTail(0x1); -// UUID objectId = TestHelpers.ParseTail(0x100); +// UUID objectId = TestHelpers.ParseTail(0x2); // UUID itemId = TestHelpers.ParseTail(0x3); string itemName = "TestStartScript() Item"; @@ -105,18 +105,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests m_scene.EventManager.OnChatFromWorld += OnChatFromWorld; - SceneObjectPart partWhereRezzed = m_scene.RezNewScript(userId, itemTemplate); + m_scene.RezNewScript(userId, itemTemplate); m_chatEvent.WaitOne(60000); Assert.That(m_osChatMessageReceived, Is.Not.Null, "No chat message received in TestStartScript()"); Assert.That(m_osChatMessageReceived.Message, Is.EqualTo("Script running")); - - bool running; - TaskInventoryItem scriptItem = partWhereRezzed.Inventory.GetInventoryItem(itemName); - Assert.That( - SceneObjectPartInventory.TryGetScriptInstanceRunning(m_scene, scriptItem, out running), Is.True); - Assert.That(running, Is.True); } private void OnChatFromWorld(object sender, OSChatMessage oscm) diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 9f05666..f6cb7df 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -656,19 +656,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (m_Assemblies.ContainsKey(instance.AssetID)) { string assembly = m_Assemblies[instance.AssetID]; - - try - { - instance.SaveState(assembly); - } - catch (Exception e) - { - m_log.Error( - string.Format( - "[XEngine]: Failed final state save for script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", - instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, World.Name) - , e); - } + instance.SaveState(assembly); } // Clear the event queue and abort the instance thread @@ -790,18 +778,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine assembly = m_Assemblies[i.AssetID]; - try - { - i.SaveState(assembly); - } - catch (Exception e) - { - m_log.Error( - string.Format( - "[XEngine]: Failed to save state of script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", - i.PrimName, i.ScriptName, i.ItemID, i.ObjectID, World.Name) - , e); - } + i.SaveState(assembly); } instances.Clear(); @@ -994,8 +971,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine // This delay exists to stop mono problems where script compilation and startup would stop the sim // working properly for the session. System.Threading.Thread.Sleep(m_StartDelay); - - m_log.InfoFormat("[XEngine]: Performing initial script startup on {0}", m_Scene.Name); } object[] o; @@ -1011,13 +986,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (m_InitialStartup) if (scriptsStarted % 50 == 0) m_log.InfoFormat( - "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name); + "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.RegionInfo.RegionName); } } if (m_InitialStartup) m_log.InfoFormat( - "[XEngine]: Completed starting {0} scripts on {1}", scriptsStarted, m_Scene.Name); + "[XEngine]: Completed starting {0} scripts on {1}", scriptsStarted, m_Scene.RegionInfo.RegionName); // NOTE: Despite having a lockless queue, this lock is required // to make sure there is never no compile thread while there @@ -1078,13 +1053,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine return false; } - m_log.DebugFormat( - "[XEngine] Loading script {0}.{1}, item UUID {2}, prim UUID {3} @ {4}.{5}", - part.ParentGroup.RootPart.Name, item.Name, itemID, part.UUID, - part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); - UUID assetID = item.AssetID; + //m_log.DebugFormat("[XEngine] Compiling script {0} ({1} on object {2})", + // item.Name, itemID.ToString(), part.ParentGroup.RootPart.Name); + ScenePresence presence = m_Scene.GetScenePresence(item.OwnerID); string assembly = ""; @@ -1262,10 +1235,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine item.Name, startParam, postOnRez, stateSource, m_MaxScriptQueue); -// m_log.DebugFormat( -// "[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}.{5}", -// part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, -// part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); + m_log.DebugFormat( + "[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}.{5}", + part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, + part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); if (presence != null) { @@ -1581,9 +1554,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine else if (p[i] is string) lsl_p[i] = new LSL_Types.LSLString((string)p[i]); else if (p[i] is Vector3) - lsl_p[i] = new LSL_Types.Vector3((Vector3)p[i]); + lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z); else if (p[i] is Quaternion) - lsl_p[i] = new LSL_Types.Quaternion((Quaternion)p[i]); + lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W); else if (p[i] is float) lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]); else @@ -1607,9 +1580,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine else if (p[i] is string) lsl_p[i] = new LSL_Types.LSLString((string)p[i]); else if (p[i] is Vector3) - lsl_p[i] = new LSL_Types.Vector3((Vector3)p[i]); + lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z); else if (p[i] is Quaternion) - lsl_p[i] = new LSL_Types.Quaternion((Quaternion)p[i]); + lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W); else if (p[i] is float) lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]); else -- cgit v1.1