mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
This commit is contained in:
@@ -26,15 +26,16 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Security;
|
||||
using System.Security.Policy;
|
||||
using System.Reflection;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Xml;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
@@ -340,6 +341,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
OnObjectRemoved += m_XmlRpcRouter.ObjectRemoved;
|
||||
}
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"scripts", false, "xengine status", "xengine status", "Show status information",
|
||||
"Show status information on the script engine.",
|
||||
HandleShowStatus);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information",
|
||||
"Show information on all scripts known to the script engine."
|
||||
@@ -386,6 +392,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
/// <returns>true if we're okay to proceed, false if not.</returns>
|
||||
private void HandleScriptsAction(string[] cmdparams, Action<IScriptInstance> action)
|
||||
{
|
||||
if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene))
|
||||
return;
|
||||
|
||||
lock (m_Scripts)
|
||||
{
|
||||
string rawItemId;
|
||||
@@ -427,8 +436,32 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleShowStatus(string module, string[] cmdparams)
|
||||
{
|
||||
if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene))
|
||||
return;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendFormat("Status of XEngine instance for {0}\n", m_Scene.RegionInfo.RegionName);
|
||||
|
||||
lock (m_Scripts)
|
||||
sb.AppendFormat("Scripts loaded : {0}\n", m_Scripts.Count);
|
||||
|
||||
sb.AppendFormat("Unique scripts : {0}\n", m_uniqueScripts.Count);
|
||||
sb.AppendFormat("Scripts waiting for load : {0}\n", m_CompileQueue.Count);
|
||||
sb.AppendFormat("Allocated threads : {0}\n", m_ThreadPool.ActiveThreads);
|
||||
sb.AppendFormat("In use threads : {0}\n", m_ThreadPool.InUseThreads);
|
||||
sb.AppendFormat("Work items waiting : {0}\n", m_ThreadPool.WaitingCallbacks);
|
||||
// sb.AppendFormat("Assemblies loaded : {0}\n", m_Assemblies.Count);
|
||||
|
||||
MainConsole.Instance.OutputFormat(sb.ToString());
|
||||
}
|
||||
|
||||
public void HandleShowScripts(string module, string[] cmdparams)
|
||||
{
|
||||
if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene))
|
||||
return;
|
||||
|
||||
if (cmdparams.Length == 2)
|
||||
{
|
||||
lock (m_Scripts)
|
||||
@@ -463,10 +496,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
status = "running";
|
||||
}
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"{0}.{1}, item UUID {2}, prim UUID {3} @ {4} ({5})",
|
||||
instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID,
|
||||
sop.AbsolutePosition, status);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Queue eq = instance.EventQueue;
|
||||
|
||||
sb.AppendFormat("Script name : {0}\n", instance.ScriptName);
|
||||
sb.AppendFormat("Status : {0}\n", status);
|
||||
|
||||
lock (eq)
|
||||
sb.AppendFormat("Queued events : {0}\n", eq.Count);
|
||||
|
||||
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);
|
||||
sb.AppendFormat("Position : {0}\n", sop.AbsolutePosition);
|
||||
|
||||
MainConsole.Instance.OutputFormat(sb.ToString());
|
||||
}
|
||||
|
||||
private void HandleSuspendScript(IScriptInstance instance)
|
||||
|
||||
Reference in New Issue
Block a user