29 using System.Collections.Generic;
30 using OpenSim.Framework;
31 using OpenSim.Framework.Console;
32 using OpenSim.Region.ScriptEngine.Interfaces;
33 using OpenSim.Region.ScriptEngine.Shared.Api;
34 using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
36 namespace OpenSim.
Region.ScriptEngine.XEngine
49 MainConsole.Instance.Commands.AddCommand(
50 "Scripts",
false,
"show script sensors",
"show script sensors",
"Show script sensors information",
53 MainConsole.Instance.Commands.AddCommand(
54 "Scripts",
false,
"show script timers",
"show script timers",
"Show script sensors information",
58 private bool IsSceneSelected()
60 return MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_engine.World;
63 private void HandleShowSensors(
string module,
string[] cmdparams)
65 if (!IsSceneSelected())
68 SensorRepeat sr = AsyncCommandManager.GetSensorRepeatPlugin(m_engine);
72 MainConsole.Instance.Output(
"Plugin not yet initialized");
79 cdt.AddColumn(
"Part name", 40);
80 cdt.AddColumn(
"Script item ID", 36);
81 cdt.AddColumn(
"Type", 4);
82 cdt.AddColumn(
"Interval", 8);
83 cdt.AddColumn(
"Range", 8);
84 cdt.AddColumn(
"Arc", 8);
88 cdt.AddRow(s.host.Name, s.itemID, s.type, s.interval, s.range, s.arc);
91 MainConsole.Instance.Output(cdt.ToString());
92 MainConsole.Instance.OutputFormat(
"Total: {0}", sensorInfo.Count);
95 private void HandleShowTimers(
string module,
string[] cmdparams)
97 if (!IsSceneSelected())
100 Timer timerPlugin = AsyncCommandManager.GetTimerPlugin(m_engine);
102 if (timerPlugin == null)
104 MainConsole.Instance.Output(
"Plugin not yet initialized");
108 List<Timer.TimerInfo> timersInfo = timerPlugin.GetTimersInfo();
111 cdt.AddColumn(
"Part local ID", 13);
112 cdt.AddColumn(
"Script item ID", 36);
113 cdt.AddColumn(
"Interval", 10);
114 cdt.AddColumn(
"Next", 8);
116 foreach (
Timer.TimerInfo t in timersInfo)
119 cdt.AddRow(t.localID, t.itemID, (double)t.interval / 10000000, t.next);
122 MainConsole.Instance.Output(cdt.ToString());
123 MainConsole.Instance.OutputFormat(
"Total: {0}", timersInfo.Count);
Used to generated a formatted table for the console.
An interface for a script API module to communicate with the engine it's running under ...
ScriptEngineConsoleCommands(IScriptEngine engine)
Used by one-off and repeated sensors