diff options
author | Justin Clark-Casey (justincc) | 2012-01-04 22:45:07 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-01-04 22:45:07 +0000 |
commit | 8fb70a2058e98dea63e7ee7c5b55532668fccd38 (patch) | |
tree | 2c2df3f4fc871c14e266f952b0fa45fc30d47c4e /OpenSim/Region/OptionalModules/Avatar | |
parent | Separate out rebake request code from cache validation code AvatarFactoryModule. (diff) | |
download | opensim-SC_OLD-8fb70a2058e98dea63e7ee7c5b55532668fccd38.zip opensim-SC_OLD-8fb70a2058e98dea63e7ee7c5b55532668fccd38.tar.gz opensim-SC_OLD-8fb70a2058e98dea63e7ee7c5b55532668fccd38.tar.bz2 opensim-SC_OLD-8fb70a2058e98dea63e7ee7c5b55532668fccd38.tar.xz |
Add "appearance rebake" command to ask a specific viewer to rebake textures from the server end.
This is not as useful as it sounds, since you can only request rebakes for texture IDs already received.
In other words, if the viewer has never sent the server this information (which happens quite often) then it will have no effect.
Nonetheless, this is useful for diagnostic/debugging purposes.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index 1ce24f1..7e15718 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | |||
@@ -114,6 +114,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
114 | "Send appearance data for each avatar in the simulator to other viewers.", | 114 | "Send appearance data for each avatar in the simulator to other viewers.", |
115 | "Optionally, you can specify that only a particular avatar's appearance data is sent.", | 115 | "Optionally, you can specify that only a particular avatar's appearance data is sent.", |
116 | HandleSendAppearanceCommand); | 116 | HandleSendAppearanceCommand); |
117 | |||
118 | scene.AddCommand( | ||
119 | this, "appearance rebake", | ||
120 | "appearance rebake <first-name> <last-name>", | ||
121 | "Send a request to the user's viewer for it to rebake and reupload its appearance textures.", | ||
122 | "This is currently done for all baked texture references previously received, whether the simulator can find the asset or not." | ||
123 | + "\nThis will only work for texture ids that the viewer has already uploaded." | ||
124 | + "\nIf the viewer has not yet sent the server any texture ids then nothing will happen" | ||
125 | + "\nsince requests can only be made for ids that the client has already sent us", | ||
126 | HandleRebakeAppearanceCommand); | ||
117 | } | 127 | } |
118 | 128 | ||
119 | private void HandleSendAppearanceCommand(string module, string[] cmd) | 129 | private void HandleSendAppearanceCommand(string module, string[] cmd) |
@@ -210,6 +220,34 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
210 | } | 220 | } |
211 | } | 221 | } |
212 | } | 222 | } |
213 | } | 223 | } |
224 | |||
225 | private void HandleRebakeAppearanceCommand(string module, string[] cmd) | ||
226 | { | ||
227 | if (cmd.Length != 4) | ||
228 | { | ||
229 | MainConsole.Instance.OutputFormat("Usage: appearance rebake <first-name> <last-name>"); | ||
230 | return; | ||
231 | } | ||
232 | |||
233 | string firstname = cmd[2]; | ||
234 | string lastname = cmd[3]; | ||
235 | |||
236 | lock (m_scenes) | ||
237 | { | ||
238 | foreach (Scene scene in m_scenes.Values) | ||
239 | { | ||
240 | ScenePresence sp = scene.GetScenePresence(firstname, lastname); | ||
241 | if (sp != null && !sp.IsChildAgent) | ||
242 | { | ||
243 | MainConsole.Instance.OutputFormat( | ||
244 | "Requesting rebake of uploaded textures for {0}", | ||
245 | sp.Name, scene.RegionInfo.RegionName); | ||
246 | |||
247 | scene.AvatarFactory.RequestRebake(sp, false); | ||
248 | } | ||
249 | } | ||
250 | } | ||
251 | } | ||
214 | } | 252 | } |
215 | } \ No newline at end of file | 253 | } \ No newline at end of file |