From 0860a0d856ee667bf20db074b778f2518c4d061c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 17 Aug 2012 22:30:01 +0100 Subject: minor: Make xengine debug message on script load a scripting loading message instead. This is more useful if compilation fails due to an uncatchable exception since we know what was being compiled. --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 2dba029..1571fb4 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -982,10 +982,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine return false; } - UUID assetID = item.AssetID; + 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); - //m_log.DebugFormat("[XEngine] Compiling script {0} ({1} on object {2})", - // item.Name, itemID.ToString(), part.ParentGroup.RootPart.Name); + UUID assetID = item.AssetID; ScenePresence presence = m_Scene.GetScenePresence(item.OwnerID); @@ -1164,10 +1166,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine stateSource, m_MaxScriptQueue); // if (DebugLevel >= 1) - m_log.DebugFormat( - "[XEngine] Loaded 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); +// m_log.DebugFormat( +// "[XEngine] Loaded 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); if (presence != null) { -- cgit v1.1 From 5d7751da891360c665622562f06a15e02fea4922 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 18 Aug 2012 01:17:01 +0100 Subject: refactoring for Vector3 operator & constructor tweaks --- OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | 20 ++++++-------------- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 4 ++-- 2 files changed, 8 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 5c4174e..a1ad07d 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -152,9 +152,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine det[0] = new DetectParams(); det[0].Key = remoteClient.AgentId; det[0].Populate(myScriptEngine.World); - det[0].OffsetPos = new LSL_Types.Vector3(offsetPos.X, - offsetPos.Y, - offsetPos.Z); + det[0].OffsetPos = offsetPos; if (originalID == 0) { @@ -298,9 +296,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine foreach (DetectedObject detobj in col.Colliders) { DetectParams d = new DetectParams(); - d.Position = new LSL_Types.Vector3(detobj.posVector.X, - detobj.posVector.Y, - detobj.posVector.Z); + d.Position = detobj.posVector; d.Populate(myScriptEngine.World); det.Add(d); myScriptEngine.PostObjectEvent(localID, new EventParams( @@ -318,9 +314,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine foreach (DetectedObject detobj in col.Colliders) { DetectParams d = new DetectParams(); - d.Position = new LSL_Types.Vector3(detobj.posVector.X, - detobj.posVector.Y, - detobj.posVector.Z); + d.Position = detobj.posVector; d.Populate(myScriptEngine.World); det.Add(d); myScriptEngine.PostObjectEvent(localID, new EventParams( @@ -337,9 +331,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine foreach (DetectedObject detobj in col.Colliders) { DetectParams d = new DetectParams(); - d.Position = new LSL_Types.Vector3(detobj.posVector.X, - detobj.posVector.Y, - detobj.posVector.Z); + d.Position = detobj.posVector; d.Populate(myScriptEngine.World); det.Add(d); myScriptEngine.PostObjectEvent(localID, new EventParams( @@ -381,8 +373,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.X,targetpos.Y,targetpos.Z), - new LSL_Types.Vector3(atpos.X,atpos.Y,atpos.Z) }, + new LSL_Types.Vector3(targetpos), + new LSL_Types.Vector3(atpos) }, new DetectParams[0])); } diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 1571fb4..a05650a 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -1467,7 +1467,7 @@ 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]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z); + lsl_p[i] = new LSL_Types.Vector3((Vector3)p[i]); else if (p[i] is Quaternion) 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) @@ -1493,7 +1493,7 @@ 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]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z); + lsl_p[i] = new LSL_Types.Vector3((Vector3)p[i]); else if (p[i] is Quaternion) 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) -- cgit v1.1 From ffdde05bb7d3d2ca71807c3197411bf66c29aa45 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 18 Aug 2012 15:10:44 +0100 Subject: constructor means not having to manually refer to individual properties --- OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | 4 ++-- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index a1ad07d..cee10df 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -391,8 +391,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.X,targetrot.Y,targetrot.Z,targetrot.W), - new LSL_Types.Quaternion(atrot.X,atrot.Y,atrot.Z,atrot.W) }, + new LSL_Types.Quaternion(targetrot), + new LSL_Types.Quaternion(atrot) }, new DetectParams[0])); } diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index a05650a..53f899a 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -1469,7 +1469,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine else if (p[i] is Vector3) lsl_p[i] = new LSL_Types.Vector3((Vector3)p[i]); else if (p[i] is Quaternion) - lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W); + lsl_p[i] = new LSL_Types.Quaternion((Quaternion)p[i]); else if (p[i] is float) lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]); else @@ -1495,7 +1495,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine else if (p[i] is Vector3) lsl_p[i] = new LSL_Types.Vector3((Vector3)p[i]); else if (p[i] is Quaternion) - lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W); + lsl_p[i] = new LSL_Types.Quaternion((Quaternion)p[i]); else if (p[i] is float) lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]); else -- cgit v1.1 From aede42b87559aa1f8f3197b53b9bf5c2b547701a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 23 Aug 2012 23:13:53 +0100 Subject: If a script state save fails for some reason on shutdown/region removal, get xengine to spit out some useful information and continue to save other script states --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 27 ++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 53f899a..5a3f002 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -589,7 +589,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (m_Assemblies.ContainsKey(instance.AssetID)) { string assembly = m_Assemblies[instance.AssetID]; - instance.SaveState(assembly); + + 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); + } } // Clear the event queue and abort the instance thread @@ -707,7 +719,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine assembly = m_Assemblies[i.AssetID]; } - i.SaveState(assembly); + 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); + } } instances.Clear(); -- cgit v1.1 From f3a5e3a02b5422fad607695aac0bffd17152434b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 25 Aug 2012 00:42:32 +0100 Subject: Log initial script startup info notice when xengine actually starts to do this for debugging purposes, rather than before it actually starts to do this. --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 5a3f002..0460f22 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -923,6 +923,8 @@ 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; @@ -938,13 +940,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.RegionInfo.RegionName); + "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name); } } if (m_InitialStartup) m_log.InfoFormat( - "[XEngine]: Completed starting {0} scripts on {1}", scriptsStarted, m_Scene.RegionInfo.RegionName); + "[XEngine]: Completed starting {0} scripts on {1}", scriptsStarted, m_Scene.Name); // NOTE: Despite having a lockless queue, this lock is required // to make sure there is never no compile thread while there -- cgit v1.1 From 14b659e550b4e24ecffa87fc28ee0196c36c73e3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 2 Oct 2012 01:17:46 +0100 Subject: Send money() events to the clicked prim. Reverting a change I made over a year ago. --- OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index cee10df..74baaf9 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -98,7 +98,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); - part = part.ParentGroup.RootPart; +// part = part.ParentGroup.RootPart; money(part.LocalId, agentID, amount); } -- cgit v1.1 From 54ec8b197b9119d0443bed0797563a88bdf49f6f Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 2 Oct 2012 01:25:55 +0100 Subject: Add money event routing to the script engine. --- OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 74baaf9..9405075 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -96,6 +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; -- cgit v1.1 From 6235d16c3148bb6f9f881b0dc286deccfdf9148a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 31 Oct 2012 00:31:18 +0000 Subject: Make "show object part" command correctly display script status. Uses new IEntityInventory.TryGetScriptInstanceRunning() Makes it clearer that TaskInventoryItem.ScriptRunning cannot be used as it is temporary and not updated. --- OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs index f247a0b..f331658 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(0x2); +// UUID objectId = TestHelpers.ParseTail(0x100); // UUID itemId = TestHelpers.ParseTail(0x3); string itemName = "TestStartScript() Item"; @@ -105,12 +105,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests m_scene.EventManager.OnChatFromWorld += OnChatFromWorld; - m_scene.RezNewScript(userId, itemTemplate); + SceneObjectPart partWhereRezzed = 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) -- cgit v1.1 From aeeaa3a0a9b965dfe5d1111b178234c94de9ba9d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 14 Nov 2012 11:09:43 -0800 Subject: Added AssemblyInfos to every dll in the OpenSim.Region namespace. --- .../XEngine/Properties/AssemblyInfo.cs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bd26a8b --- /dev/null +++ b/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OpenSim.Region.ScriptEngine.XEngine")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("http://opensimulator.org")] +[assembly: AssemblyProduct("OpenSim")] +[assembly: AssemblyCopyright("OpenSimulator developers")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1feed7de-3d45-4d3d-80e2-b57566284df5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("0.7.5.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] -- cgit v1.1