29 using System.Collections.Generic;
31 using System.Reflection;
37 using OpenSim.Framework;
38 using OpenSim.Framework.Console;
39 using OpenSim.Framework.Monitoring;
40 using OpenSim.Region.ClientStack.LindenUDP;
41 using OpenSim.Region.Framework.Interfaces;
42 using OpenSim.Region.Framework.Scenes;
49 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"AttachmentsCommandModule")]
54 private List<Scene> m_scenes =
new List<Scene>();
57 public string Name {
get {
return "Attachments Command Module"; } }
59 public Type ReplaceableInterface {
get {
return null; } }
86 m_scenes.Remove(scene);
97 "Users",
this,
"attachments show",
98 "attachments show [<first-name> <last-name>]",
99 "Show attachment information for avatars in this simulator.",
100 "If no name is supplied then information for all avatars is shown.",
101 HandleShowAttachmentsCommand);
106 if (cmd.Length != 2 && cmd.Length < 4)
108 MainConsole.Instance.OutputFormat(
"Usage: attachments show [<first-name> <last-name>]");
112 bool targetNameSupplied =
false;
113 string optionalTargetFirstName = null;
114 string optionalTargetLastName = null;
118 targetNameSupplied =
true;
119 optionalTargetFirstName = cmd[2];
120 optionalTargetLastName = cmd[3];
123 StringBuilder sb =
new StringBuilder();
127 foreach (
Scene scene
in m_scenes)
129 if (targetNameSupplied)
131 ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
133 GetAttachmentsReport(sp, sb);
137 scene.ForEachRootScenePresence(sp => GetAttachmentsReport(sp, sb));
142 MainConsole.Instance.Output(sb.ToString());
145 private void GetAttachmentsReport(
ScenePresence sp, StringBuilder sb)
147 sb.AppendFormat(
"Attachments for {0}\n", sp.Name);
160 List<SceneObjectGroup> attachmentObjects = sp.GetAttachments();
181 attachmentObject.Name,
182 attachmentObject.LocalId,
183 attachmentObject.FromItemID,
185 attachmentObject.RootPart.AttachedPos);
189 ct.AddToStringBuilder(sb);
A module that just holds commands for inspecting avatar appearance.
Used to generated a formatted table for the console.
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...
uint AttachmentPoint
Attachment point of this scene object to an avatar.
Interactive OpenSim region server
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
void HandleShowAttachmentsCommand(string module, string[] cmd)
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...