From d97440c7cf307ec701cc5351a0075239ece44727 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 5 Dec 2012 21:37:41 +0000
Subject: On XEngine.ProcessEventHandler(), instead of creating a new
CultureInfo on every call use the single one set by
Culture.SetCurrentCulture()
This is slightly different in that SetCurrentCulture() does not use overridden settings if the system culture matches en-US but some settings there have been changed.
This is what we want - we do not want to use any system overriden settings.
---
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 3 +--
1 file changed, 1 insertion(+), 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 0460f22..1dab51e 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1415,8 +1415,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
///
private object ProcessEventHandler(object parms)
{
- CultureInfo USCulture = new CultureInfo("en-US");
- Thread.CurrentThread.CurrentCulture = USCulture;
+ Culture.SetCurrentCulture();
IScriptInstance instance = (ScriptInstance) parms;
--
cgit v1.1
From ea786414c283ed04a32905b177afd342c88a7471 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 5 Dec 2012 21:51:08 +0000
Subject: In XEngine.DoOnRezScript() use Culture.SetCurrentCulture() instead of
constructing a new CultureInfo separately
---
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 3 +--
1 file changed, 1 insertion(+), 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 1dab51e..d9d4494 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1018,8 +1018,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string assembly = "";
- CultureInfo USCulture = new CultureInfo("en-US");
- Thread.CurrentThread.CurrentCulture = USCulture;
+ Culture.SetCurrentCulture();
Dictionary, KeyValuePair> linemap;
--
cgit v1.1
From e8df0f1b4c3194c7f5c1a354b5d5d2f67d6a250c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 5 Dec 2012 22:33:28 +0000
Subject: Add IScriptInstance.EventsProcessed stat so that we can record this
information and display in "show scripts" for debug purposes
---
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/ScriptEngine/XEngine')
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index d9d4494..2136fe8 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -512,6 +512,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
lock (eq)
sb.AppendFormat("Queued events : {0}\n", eq.Count);
+ sb.AppendFormat("Processed events : {0}\n", instance.EventsProcessed);
sb.AppendFormat("Item UUID : {0}\n", instance.ItemID);
sb.AppendFormat("Containing part name: {0}\n", instance.PrimName);
sb.AppendFormat("Containing part UUID: {0}\n", instance.ObjectID);
--
cgit v1.1
From 652f4bcb425646aab2096da99aa00016dfe639fd Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 5 Dec 2012 23:27:50 +0000
Subject: For now, sort "show scripts" output in descending order sorted by
events processed.
For debug purposes - should later add options to allow different sorting or show only highest 10, etc.
---
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/XEngine')
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 2136fe8..394826e 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -30,6 +30,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
+using System.Linq;
using System.Reflection;
using System.Security;
using System.Security.Policy;
@@ -377,9 +378,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine
///
///
///
- /// true if we're okay to proceed, false if not.
+ /// Basis on which to sort output. Can be null if no sort needs to take place
private void HandleScriptsAction(string[] cmdparams, Action action)
{
+ HandleScriptsAction