diff options
author | Justin Clark-Casey (justincc) | 2011-12-06 18:03:16 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-12-06 18:03:16 +0000 |
commit | 1b9eb5285033839bdc1b948ec085aa8736473ad6 (patch) | |
tree | d196dd6e7de6c5dff0c7bdf31b667d65fada4f88 /OpenSim/Region/OptionalModules/Avatar/Appearance | |
parent | Make it possible to manually send appearance information via the "appearance ... (diff) | |
download | opensim-SC_OLD-1b9eb5285033839bdc1b948ec085aa8736473ad6.zip opensim-SC_OLD-1b9eb5285033839bdc1b948ec085aa8736473ad6.tar.gz opensim-SC_OLD-1b9eb5285033839bdc1b948ec085aa8736473ad6.tar.bz2 opensim-SC_OLD-1b9eb5285033839bdc1b948ec085aa8736473ad6.tar.xz |
Allow "appearance show" command to take an optional avatar name
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index c6ee36b..7f3f365 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | |||
@@ -96,14 +96,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
96 | this, "appearance show", | 96 | this, "appearance show", |
97 | "appearance show", | 97 | "appearance show", |
98 | "Show appearance information for each avatar in the simulator.", | 98 | "Show appearance information for each avatar in the simulator.", |
99 | "At the moment this actually just checks that we have all the required baked textures. If not, then appearance is 'corrupt' and other avatars will continue to see a cloud.", | 99 | "Optionally, you can view just a particular avatar's appearance information" |
100 | + "\nAt the moment this actually just checks that we have all the required baked textures. If not, then appearance is 'corrupt' and other avatars will continue to see a cloud.", | ||
100 | HandleShowAppearanceCommand); | 101 | HandleShowAppearanceCommand); |
101 | 102 | ||
102 | scene.AddCommand( | 103 | scene.AddCommand( |
103 | this, "appearance send", | 104 | this, "appearance send", |
104 | "appearance send [<first-name> <last-name>]", | 105 | "appearance send [<first-name> <last-name>]", |
105 | "Send appearance data for each avatar in the simulator to other viewers." | 106 | "Send appearance data for each avatar in the simulator to other viewers.", |
106 | + "\nOptionally, you can specify that only a particular avatar's information is sent.", | 107 | "Optionally, you can specify that only a particular avatar's appearance data is sent.", |
107 | HandleSendAppearanceCommand); | 108 | HandleSendAppearanceCommand); |
108 | } | 109 | } |
109 | 110 | ||
@@ -148,7 +149,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
148 | MainConsole.Instance.OutputFormat( | 149 | MainConsole.Instance.OutputFormat( |
149 | "Sending appearance information for {0} to all other avatars in {1}", | 150 | "Sending appearance information for {0} to all other avatars in {1}", |
150 | sp.Name, scene.RegionInfo.RegionName); | 151 | sp.Name, scene.RegionInfo.RegionName); |
151 | 152 | ||
152 | scene.AvatarFactory.SendAppearance(sp.UUID); | 153 | scene.AvatarFactory.SendAppearance(sp.UUID); |
153 | } | 154 | } |
154 | ); | 155 | ); |
@@ -158,18 +159,49 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
158 | } | 159 | } |
159 | 160 | ||
160 | protected void HandleShowAppearanceCommand(string module, string[] cmd) | 161 | protected void HandleShowAppearanceCommand(string module, string[] cmd) |
161 | { | 162 | { |
163 | if (cmd.Length != 2 && cmd.Length < 4) | ||
164 | { | ||
165 | MainConsole.Instance.OutputFormat("Usage: appearance show [<first-name> <last-name>]"); | ||
166 | return; | ||
167 | } | ||
168 | |||
169 | bool targetNameSupplied = false; | ||
170 | string optionalTargetFirstName = null; | ||
171 | string optionalTargetLastName = null; | ||
172 | |||
173 | if (cmd.Length >= 4) | ||
174 | { | ||
175 | targetNameSupplied = true; | ||
176 | optionalTargetFirstName = cmd[2]; | ||
177 | optionalTargetLastName = cmd[3]; | ||
178 | } | ||
179 | |||
162 | lock (m_scenes) | 180 | lock (m_scenes) |
163 | { | 181 | { |
164 | foreach (Scene scene in m_scenes.Values) | 182 | foreach (Scene scene in m_scenes.Values) |
165 | { | 183 | { |
166 | scene.ForEachRootScenePresence( | 184 | if (targetNameSupplied) |
167 | delegate(ScenePresence sp) | 185 | { |
186 | ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); | ||
187 | if (sp != null && !sp.IsChildAgent) | ||
168 | { | 188 | { |
169 | bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); | 189 | bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); |
170 | MainConsole.Instance.OutputFormat( | 190 | MainConsole.Instance.OutputFormat( |
171 | "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); | 191 | "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); |
172 | }); | 192 | } |
193 | } | ||
194 | else | ||
195 | { | ||
196 | scene.ForEachRootScenePresence( | ||
197 | sp => | ||
198 | { | ||
199 | bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); | ||
200 | MainConsole.Instance.OutputFormat( | ||
201 | "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); | ||
202 | } | ||
203 | ); | ||
204 | } | ||
173 | } | 205 | } |
174 | } | 206 | } |
175 | } | 207 | } |