aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs142
1 files changed, 122 insertions, 20 deletions
diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
index 12169ab..0927c4f 100644
--- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
+++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using System.Linq; 30using System.Linq;
31using System.Reflection; 31using System.Reflection;
32using System.Text; 32using System.Text;
33using System.Threading;
33using log4net; 34using log4net;
34using Mono.Addins; 35using Mono.Addins;
35using Nini.Config; 36using Nini.Config;
@@ -48,7 +49,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
48 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SceneCommandsModule")] 49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SceneCommandsModule")]
49 public class SceneCommandsModule : ISceneCommandsModule, INonSharedRegionModule 50 public class SceneCommandsModule : ISceneCommandsModule, INonSharedRegionModule
50 { 51 {
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 53
53 private Scene m_scene; 54 private Scene m_scene;
54 55
@@ -93,28 +94,44 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
93 "Debug", this, "debug scene get", 94 "Debug", this, "debug scene get",
94 "debug scene get", 95 "debug scene get",
95 "List current scene options.", 96 "List current scene options.",
96 "If active is false then main scene update and maintenance loops are suspended.\n" 97 "active - if false then main scene update and maintenance loops are suspended.\n"
97 + "If animations is true then extra animations debug information is logged.\n" 98 + "animations - if true then extra animations debug information is logged.\n"
98 + "If collisions is false then collisions with other objects are turned off.\n" 99 + "appear-refresh - if true then appearance is resent to other avatars every 60 seconds.\n"
99 + "If pbackup is false then periodic scene backup is turned off.\n" 100 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n"
100 + "If physics is false then all physics objects are non-physical.\n" 101 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
101 + "If scripting is false then no scripting operations happen.\n" 102 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
102 + "If teleport is true then some extra teleport debug information is logged.\n" 103 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
103 + "If updates is true then any frame which exceeds double the maximum desired frame time is logged.", 104 + "root-upd-per - if greater than 1, terse updates are only sent to root agents other than the originator on every n updates.\n"
105 + "child-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
106 + "collisions - if false then collisions with other objects are turned off.\n"
107 + "pbackup - if false then periodic scene backup is turned off.\n"
108 + "physics - if false then all physics objects are non-physical.\n"
109 + "scripting - if false then no scripting operations happen.\n"
110 + "teleport - if true then some extra teleport debug information is logged.\n"
111 + "update-on-timer - If true then the scene is updated via a timer. If false then a thread with sleep is used.\n"
112 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.",
104 HandleDebugSceneGetCommand); 113 HandleDebugSceneGetCommand);
105 114
106 scene.AddCommand( 115 scene.AddCommand(
107 "Debug", this, "debug scene set", 116 "Debug", this, "debug scene set",
108 "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false", 117 "debug scene set <param> <value>",
109 "Turn on scene debugging options.", 118 "Turn on scene debugging options.",
110 "If active is false then main scene update and maintenance loops are suspended.\n" 119 "active - if false then main scene update and maintenance loops are suspended.\n"
111 + "If animations is true then extra animations debug information is logged.\n" 120 + "animations - if true then extra animations debug information is logged.\n"
112 + "If collisions is false then collisions with other objects are turned off.\n" 121 + "appear-refresh - if true then appearance is resent to other avatars every 60 seconds.\n"
113 + "If pbackup is false then periodic scene backup is turned off.\n" 122 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n"
114 + "If physics is false then all physics objects are non-physical.\n" 123 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
115 + "If scripting is false then no scripting operations happen.\n" 124 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
116 + "If teleport is true then some extra teleport debug information is logged.\n" 125 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
117 + "If updates is true then any frame which exceeds double the maximum desired frame time is logged.", 126 + "root-upd-per - if greater than 1, terse updates are only sent to root agents other than the originator on every n updates.\n"
127 + "child-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
128 + "collisions - if false then collisions with other objects are turned off.\n"
129 + "pbackup - if false then periodic scene backup is turned off.\n"
130 + "physics - if false then all physics objects are non-physical.\n"
131 + "scripting - if false then no scripting operations happen.\n"
132 + "teleport - if true then some extra teleport debug information is logged.\n"
133 + "update-on-timer - If true then the scene is updated via a timer. If false then a thread with sleep is used.\n"
134 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.",
118 HandleDebugSceneSetCommand); 135 HandleDebugSceneSetCommand);
119 } 136 }
120 137
@@ -138,10 +155,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
138 ConsoleDisplayList cdl = new ConsoleDisplayList(); 155 ConsoleDisplayList cdl = new ConsoleDisplayList();
139 cdl.AddRow("active", m_scene.Active); 156 cdl.AddRow("active", m_scene.Active);
140 cdl.AddRow("animations", m_scene.DebugAnimations); 157 cdl.AddRow("animations", m_scene.DebugAnimations);
158 cdl.AddRow("appear-refresh", m_scene.SendPeriodicAppearanceUpdates);
159 cdl.AddRow("child-repri", m_scene.ChildReprioritizationDistance);
160 cdl.AddRow("client-pos-upd", m_scene.RootPositionUpdateTolerance);
161 cdl.AddRow("client-rot-upd", m_scene.RootRotationUpdateTolerance);
162 cdl.AddRow("client-vel-upd", m_scene.RootVelocityUpdateTolerance);
163 cdl.AddRow("root-upd-per", m_scene.RootTerseUpdatePeriod);
164 cdl.AddRow("child-upd-per", m_scene.ChildTerseUpdatePeriod);
141 cdl.AddRow("pbackup", m_scene.PeriodicBackup); 165 cdl.AddRow("pbackup", m_scene.PeriodicBackup);
142 cdl.AddRow("physics", m_scene.PhysicsEnabled); 166 cdl.AddRow("physics", m_scene.PhysicsEnabled);
143 cdl.AddRow("scripting", m_scene.ScriptsEnabled); 167 cdl.AddRow("scripting", m_scene.ScriptsEnabled);
144 cdl.AddRow("teleport", m_scene.DebugTeleporting); 168 cdl.AddRow("teleport", m_scene.DebugTeleporting);
169 cdl.AddRow("update-on-timer", m_scene.UpdateOnTimer);
145 cdl.AddRow("updates", m_scene.DebugUpdates); 170 cdl.AddRow("updates", m_scene.DebugUpdates);
146 171
147 MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name); 172 MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name);
@@ -163,8 +188,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
163 } 188 }
164 else 189 else
165 { 190 {
166 MainConsole.Instance.Output( 191 MainConsole.Instance.Output("Usage: debug scene set <param> <value>");
167 "Usage: debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false");
168 } 192 }
169 } 193 }
170 194
@@ -186,6 +210,69 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
186 m_scene.DebugAnimations = active; 210 m_scene.DebugAnimations = active;
187 } 211 }
188 212
213 if (options.ContainsKey("appear-refresh"))
214 {
215 bool newValue;
216
217 // FIXME: This can only come from the console at the moment but might not always be true.
218 if (ConsoleUtil.TryParseConsoleBool(MainConsole.Instance, options["appear-refresh"], out newValue))
219 m_scene.SendPeriodicAppearanceUpdates = newValue;
220 }
221
222 if (options.ContainsKey("child-repri"))
223 {
224 double newValue;
225
226 // FIXME: This can only come from the console at the moment but might not always be true.
227 if (ConsoleUtil.TryParseConsoleDouble(MainConsole.Instance, options["child-repri"], out newValue))
228 m_scene.ChildReprioritizationDistance = newValue;
229 }
230
231 if (options.ContainsKey("client-pos-upd"))
232 {
233 float newValue;
234
235 // FIXME: This can only come from the console at the moment but might not always be true.
236 if (ConsoleUtil.TryParseConsoleFloat(MainConsole.Instance, options["client-pos-upd"], out newValue))
237 m_scene.RootPositionUpdateTolerance = newValue;
238 }
239
240 if (options.ContainsKey("client-rot-upd"))
241 {
242 float newValue;
243
244 // FIXME: This can only come from the console at the moment but might not always be true.
245 if (ConsoleUtil.TryParseConsoleFloat(MainConsole.Instance, options["client-rot-upd"], out newValue))
246 m_scene.RootRotationUpdateTolerance = newValue;
247 }
248
249 if (options.ContainsKey("client-vel-upd"))
250 {
251 float newValue;
252
253 // FIXME: This can only come from the console at the moment but might not always be true.
254 if (ConsoleUtil.TryParseConsoleFloat(MainConsole.Instance, options["client-vel-upd"], out newValue))
255 m_scene.RootVelocityUpdateTolerance = newValue;
256 }
257
258 if (options.ContainsKey("root-upd-per"))
259 {
260 int newValue;
261
262 // FIXME: This can only come from the console at the moment but might not always be true.
263 if (ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, options["root-upd-per"], out newValue))
264 m_scene.RootTerseUpdatePeriod = newValue;
265 }
266
267 if (options.ContainsKey("child-upd-per"))
268 {
269 int newValue;
270
271 // FIXME: This can only come from the console at the moment but might not always be true.
272 if (ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, options["child-upd-per"], out newValue))
273 m_scene.ChildTerseUpdatePeriod = newValue;
274 }
275
189 if (options.ContainsKey("pbackup")) 276 if (options.ContainsKey("pbackup"))
190 { 277 {
191 bool active; 278 bool active;
@@ -221,6 +308,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
221 m_scene.DebugTeleporting = enableTeleportDebugging; 308 m_scene.DebugTeleporting = enableTeleportDebugging;
222 } 309 }
223 310
311 if (options.ContainsKey("update-on-timer"))
312 {
313 bool enableUpdateOnTimer;
314 if (bool.TryParse(options["update-on-timer"], out enableUpdateOnTimer))
315 {
316 m_scene.UpdateOnTimer = enableUpdateOnTimer;
317 m_scene.Active = false;
318
319 while (m_scene.IsRunning)
320 Thread.Sleep(20);
321
322 m_scene.Active = true;
323 }
324 }
325
224 if (options.ContainsKey("updates")) 326 if (options.ContainsKey("updates"))
225 { 327 {
226 bool enableUpdateDebugging; 328 bool enableUpdateDebugging;