aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs236
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs60
4 files changed, 279 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 8d41728..38a7805 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -348,7 +348,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
348 348
349 region.ExternalHostName = uri.Host; 349 region.ExternalHostName = uri.Host;
350 region.HttpPort = (uint)uri.Port; 350 region.HttpPort = (uint)uri.Port;
351 region.ServerURI = uri.ToString(); 351 region.ServerURI = aCircuit.ServiceURLs["HomeURI"].ToString();
352 region.RegionName = string.Empty; 352 region.RegionName = string.Empty;
353 region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0); 353 region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
354 return region; 354 return region;
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
index 57c109e..e3d04cd 100644
--- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
50// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51 51
52 private Scene m_scene; 52 private Scene m_scene;
53 private ICommandConsole m_console;
53 54
54 public string Name { get { return "Object Commands Module"; } } 55 public string Name { get { return "Object Commands Module"; } }
55 56
@@ -75,6 +76,51 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
75// m_log.DebugFormat("[OBJECT COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); 76// m_log.DebugFormat("[OBJECT COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName);
76 77
77 m_scene = scene; 78 m_scene = scene;
79 m_console = MainConsole.Instance;
80
81 m_console.Commands.AddCommand("region", false, "delete object owner",
82 "delete object owner <UUID>",
83 "Delete a scene object by owner", HandleDeleteObject);
84 m_console.Commands.AddCommand("region", false, "delete object creator",
85 "delete object creator <UUID>",
86 "Delete a scene object by creator", HandleDeleteObject);
87 m_console.Commands.AddCommand("region", false, "delete object uuid",
88 "delete object uuid <UUID>",
89 "Delete a scene object by uuid", HandleDeleteObject);
90 m_console.Commands.AddCommand("region", false, "delete object name",
91 "delete object name <name>",
92 "Delete a scene object by name", HandleDeleteObject);
93 m_console.Commands.AddCommand("region", false, "delete object outside",
94 "delete object outside",
95 "Delete all scene objects outside region boundaries", HandleDeleteObject);
96
97 m_console.Commands.AddCommand(
98 "region",
99 false,
100 "show object uuid",
101 "show object uuid <UUID>",
102 "Show details of a scene object with the given UUID", HandleShowObjectByUuid);
103
104 m_console.Commands.AddCommand(
105 "region",
106 false,
107 "show object name",
108 "show object name <name>",
109 "Show details of scene objects with the given name", HandleShowObjectByName);
110
111 m_console.Commands.AddCommand(
112 "region",
113 false,
114 "show part uuid",
115 "show part uuid <UUID>",
116 "Show details of a scene object parts with the given UUID", HandleShowPartByUuid);
117
118 m_console.Commands.AddCommand(
119 "region",
120 false,
121 "show part name",
122 "show part name <name>",
123 "Show details of scene object parts with the given name", HandleShowPartByName);
78 } 124 }
79 125
80 public void RemoveRegion(Scene scene) 126 public void RemoveRegion(Scene scene)
@@ -85,26 +131,167 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
85 public void RegionLoaded(Scene scene) 131 public void RegionLoaded(Scene scene)
86 { 132 {
87// m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); 133// m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
134 }
88 135
89 MainConsole.Instance.Commands.AddCommand("region", false, "delete object owner", 136 private void HandleShowObjectByUuid(string module, string[] cmd)
90 "delete object owner <UUID>", 137 {
91 "Delete object by owner", HandleDeleteObject); 138 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
92 MainConsole.Instance.Commands.AddCommand("region", false, "delete object creator", 139 return;
93 "delete object creator <UUID>", 140
94 "Delete object by creator", HandleDeleteObject); 141 if (cmd.Length < 4)
95 MainConsole.Instance.Commands.AddCommand("region", false, "delete object uuid", 142 {
96 "delete object uuid <UUID>", 143 m_console.OutputFormat("Usage: show object uuid <uuid>");
97 "Delete object by uuid", HandleDeleteObject); 144 return;
98 MainConsole.Instance.Commands.AddCommand("region", false, "delete object name", 145 }
99 "delete object name <name>", 146
100 "Delete object by name", HandleDeleteObject); 147 UUID objectUuid;
101 MainConsole.Instance.Commands.AddCommand("region", false, "delete object outside", 148 if (!UUID.TryParse(cmd[3], out objectUuid))
102 "delete object outside", 149 {
103 "Delete all objects outside boundaries", HandleDeleteObject); 150 m_console.OutputFormat("{0} is not a valid uuid", cmd[3]);
151 return;
152 }
153
154 SceneObjectGroup so = m_scene.GetSceneObjectGroup(objectUuid);
155
156 if (so == null)
157 {
158// m_console.OutputFormat("No part found with uuid {0}", objectUuid);
159 return;
160 }
161
162 StringBuilder sb = new StringBuilder();
163 AddSceneObjectReport(sb, so);
164
165 m_console.OutputFormat(sb.ToString());
166 }
167
168 private void HandleShowObjectByName(string module, string[] cmd)
169 {
170 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
171 return;
172
173 if (cmd.Length < 4)
174 {
175 m_console.OutputFormat("Usage: show object name <name>");
176 return;
177 }
178
179 string name = cmd[3];
180
181 List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
182
183 m_scene.ForEachSOG(so => { if (so.Name == name) { sceneObjects.Add(so); }});
184
185 if (sceneObjects.Count == 0)
186 {
187 m_console.OutputFormat("No objects with name {0} found in {1}", name, m_scene.RegionInfo.RegionName);
188 return;
189 }
190
191 StringBuilder sb = new StringBuilder();
192
193 foreach (SceneObjectGroup so in sceneObjects)
194 {
195 AddSceneObjectReport(sb, so);
196 sb.Append("\n");
197 }
198
199 m_console.OutputFormat(sb.ToString());
200 }
201
202 private void HandleShowPartByUuid(string module, string[] cmd)
203 {
204 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
205 return;
206
207 if (cmd.Length < 4)
208 {
209 m_console.OutputFormat("Usage: show part uuid <uuid>");
210 return;
211 }
212
213 UUID objectUuid;
214 if (!UUID.TryParse(cmd[3], out objectUuid))
215 {
216 m_console.OutputFormat("{0} is not a valid uuid", cmd[3]);
217 return;
218 }
219
220 SceneObjectPart sop = m_scene.GetSceneObjectPart(objectUuid);
221
222 if (sop == null)
223 {
224// m_console.OutputFormat("No part found with uuid {0}", objectUuid);
225 return;
226 }
227
228 StringBuilder sb = new StringBuilder();
229 AddScenePartReport(sb, sop);
230
231 m_console.OutputFormat(sb.ToString());
232 }
233
234 private void HandleShowPartByName(string module, string[] cmd)
235 {
236 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
237 return;
238
239 if (cmd.Length < 4)
240 {
241 m_console.OutputFormat("Usage: show part name <name>");
242 return;
243 }
244
245 string name = cmd[3];
246
247 List<SceneObjectPart> parts = new List<SceneObjectPart>();
248
249 m_scene.ForEachSOG(so => so.ForEachPart(sop => { if (sop.Name == name) { parts.Add(sop); } }));
250
251 if (parts.Count == 0)
252 {
253 m_console.OutputFormat("No parts with name {0} found in {1}", name, m_scene.RegionInfo.RegionName);
254 return;
255 }
256
257 StringBuilder sb = new StringBuilder();
258
259 foreach (SceneObjectPart part in parts)
260 {
261 AddScenePartReport(sb, part);
262 sb.Append("\n");
263 }
264
265 m_console.OutputFormat(sb.ToString());
266 }
267
268 private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so)
269 {
270 sb.AppendFormat("Name: {0}\n", so.Name);
271 sb.AppendFormat("Description: {0}\n", so.Description);
272 sb.AppendFormat("Location: {0} @ {1}\n", so.AbsolutePosition, so.Scene.RegionInfo.RegionName);
273 sb.AppendFormat("Parts: {0}\n", so.PrimCount);
274
275 return sb;
276 }
277
278 private StringBuilder AddScenePartReport(StringBuilder sb, SceneObjectPart sop)
279 {
280 sb.AppendFormat("Name: {0}\n", sop.Name);
281 sb.AppendFormat("Description: {0}\n", sop.Description);
282 sb.AppendFormat("Location: {0} @ {1}\n", sop.AbsolutePosition, sop.ParentGroup.Scene.RegionInfo.RegionName);
283 sb.AppendFormat("Parent: {0}",
284 sop.IsRoot ? "Is Root\n" : string.Format("{0} {1}\n", sop.ParentGroup.Name, sop.ParentGroup.UUID));
285 sb.AppendFormat("Parts: {0}\n", !sop.IsRoot ? "1" : sop.ParentGroup.PrimCount.ToString());;
286
287 return sb;
104 } 288 }
105 289
106 private void HandleDeleteObject(string module, string[] cmd) 290 private void HandleDeleteObject(string module, string[] cmd)
107 { 291 {
292 if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
293 return;
294
108 if (cmd.Length < 3) 295 if (cmd.Length < 3)
109 return; 296 return;
110 297
@@ -135,6 +322,9 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
135 deletes.Add(g); 322 deletes.Add(g);
136 }); 323 });
137 324
325// if (deletes.Count == 0)
326// m_console.OutputFormat("No objects were found with owner {0}", match);
327
138 break; 328 break;
139 329
140 case "creator": 330 case "creator":
@@ -147,6 +337,9 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
147 deletes.Add(g); 337 deletes.Add(g);
148 }); 338 });
149 339
340// if (deletes.Count == 0)
341// m_console.OutputFormat("No objects were found with creator {0}", match);
342
150 break; 343 break;
151 344
152 case "uuid": 345 case "uuid":
@@ -159,6 +352,9 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
159 deletes.Add(g); 352 deletes.Add(g);
160 }); 353 });
161 354
355// if (deletes.Count == 0)
356// m_console.OutputFormat("No objects were found with uuid {0}", match);
357
162 break; 358 break;
163 359
164 case "name": 360 case "name":
@@ -168,6 +364,9 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
168 deletes.Add(g); 364 deletes.Add(g);
169 }); 365 });
170 366
367// if (deletes.Count == 0)
368// m_console.OutputFormat("No objects were found with name {0}", o);
369
171 break; 370 break;
172 371
173 case "outside": 372 case "outside":
@@ -193,12 +392,17 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
193 deletes.Add(g); 392 deletes.Add(g);
194 }); 393 });
195 394
395// if (deletes.Count == 0)
396// m_console.OutputFormat("No objects were found outside region bounds");
397
196 break; 398 break;
197 } 399 }
198 400
401 m_console.OutputFormat("Deleting {0} objects in {1}", deletes.Count, m_scene.RegionInfo.RegionName);
402
199 foreach (SceneObjectGroup g in deletes) 403 foreach (SceneObjectGroup g in deletes)
200 { 404 {
201 MainConsole.Instance.OutputFormat("Deleting object {0}", g.UUID); 405 m_console.OutputFormat("Deleting object {0} {1}", g.UUID, g.Name);
202 m_scene.DeleteSceneObject(g, false); 406 m_scene.DeleteSceneObject(g, false);
203 } 407 }
204 } 408 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 739c5fa..e7f2fdb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -264,6 +264,12 @@ namespace OpenSim.Region.Framework.Scenes
264 set { RootPart.Name = value; } 264 set { RootPart.Name = value; }
265 } 265 }
266 266
267 public string Description
268 {
269 get { return RootPart.Description; }
270 set { RootPart.Description = value; }
271 }
272
267 /// <summary> 273 /// <summary>
268 /// Added because the Parcel code seems to use it 274 /// Added because the Parcel code seems to use it
269 /// but not sure a object should have this 275 /// but not sure a object should have this
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index c9bbf0e..f11987e 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -26,14 +26,15 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.IO;
30using System.Threading;
31using System.Collections; 29using System.Collections;
32using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Globalization;
32using System.IO;
33using System.Reflection;
33using System.Security; 34using System.Security;
34using System.Security.Policy; 35using System.Security.Policy;
35using System.Reflection; 36using System.Text;
36using System.Globalization; 37using System.Threading;
37using System.Xml; 38using System.Xml;
38using OpenMetaverse; 39using OpenMetaverse;
39using OpenMetaverse.StructuredData; 40using OpenMetaverse.StructuredData;
@@ -273,6 +274,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
273 } 274 }
274 275
275 MainConsole.Instance.Commands.AddCommand( 276 MainConsole.Instance.Commands.AddCommand(
277 "scripts", false, "xengine status", "xengine status", "Show status information",
278 "Show status information on the script engine.",
279 HandleShowStatus);
280
281 MainConsole.Instance.Commands.AddCommand(
276 "scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information", 282 "scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information",
277 "Show information on all scripts known to the script engine." 283 "Show information on all scripts known to the script engine."
278 + "If a <script-item-uuid> is given then only information on that script will be shown.", 284 + "If a <script-item-uuid> is given then only information on that script will be shown.",
@@ -318,6 +324,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
318 /// <returns>true if we're okay to proceed, false if not.</returns> 324 /// <returns>true if we're okay to proceed, false if not.</returns>
319 private void HandleScriptsAction(string[] cmdparams, Action<IScriptInstance> action) 325 private void HandleScriptsAction(string[] cmdparams, Action<IScriptInstance> action)
320 { 326 {
327 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene))
328 return;
329
321 lock (m_Scripts) 330 lock (m_Scripts)
322 { 331 {
323 string rawItemId; 332 string rawItemId;
@@ -359,8 +368,32 @@ namespace OpenSim.Region.ScriptEngine.XEngine
359 } 368 }
360 } 369 }
361 370
371 private void HandleShowStatus(string module, string[] cmdparams)
372 {
373 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene))
374 return;
375
376 StringBuilder sb = new StringBuilder();
377 sb.AppendFormat("Status of XEngine instance for {0}\n", m_Scene.RegionInfo.RegionName);
378
379 lock (m_Scripts)
380 sb.AppendFormat("Scripts loaded : {0}\n", m_Scripts.Count);
381
382 sb.AppendFormat("Unique scripts : {0}\n", m_uniqueScripts.Count);
383 sb.AppendFormat("Scripts waiting for load : {0}\n", m_CompileQueue.Count);
384 sb.AppendFormat("Allocated threads : {0}\n", m_ThreadPool.ActiveThreads);
385 sb.AppendFormat("In use threads : {0}\n", m_ThreadPool.InUseThreads);
386 sb.AppendFormat("Work items waiting : {0}\n", m_ThreadPool.WaitingCallbacks);
387// sb.AppendFormat("Assemblies loaded : {0}\n", m_Assemblies.Count);
388
389 MainConsole.Instance.OutputFormat(sb.ToString());
390 }
391
362 public void HandleShowScripts(string module, string[] cmdparams) 392 public void HandleShowScripts(string module, string[] cmdparams)
363 { 393 {
394 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene))
395 return;
396
364 if (cmdparams.Length == 2) 397 if (cmdparams.Length == 2)
365 { 398 {
366 lock (m_Scripts) 399 lock (m_Scripts)
@@ -395,10 +428,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine
395 status = "running"; 428 status = "running";
396 } 429 }
397 430
398 MainConsole.Instance.OutputFormat( 431 StringBuilder sb = new StringBuilder();
399 "{0}.{1}, item UUID {2}, prim UUID {3} @ {4} ({5})", 432 Queue eq = instance.EventQueue;
400 instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, 433
401 sop.AbsolutePosition, status); 434 sb.AppendFormat("Script name : {0}\n", instance.ScriptName);
435 sb.AppendFormat("Status : {0}\n", status);
436
437 lock (eq)
438 sb.AppendFormat("Queued events : {0}\n", eq.Count);
439
440 sb.AppendFormat("Item UUID : {0}\n", instance.ItemID);
441 sb.AppendFormat("Containing part name: {0}\n", instance.PrimName);
442 sb.AppendFormat("Containing part UUID: {0}\n", instance.ObjectID);
443 sb.AppendFormat("Position : {0}\n", sop.AbsolutePosition);
444
445 MainConsole.Instance.OutputFormat(sb.ToString());
402 } 446 }
403 447
404 private void HandleSuspendScript(IScriptInstance instance) 448 private void HandleSuspendScript(IScriptInstance instance)