aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-04 22:45:07 +0000
committerJustin Clark-Casey (justincc)2012-01-04 22:45:07 +0000
commit8fb70a2058e98dea63e7ee7c5b55532668fccd38 (patch)
tree2c2df3f4fc871c14e266f952b0fa45fc30d47c4e
parentSeparate out rebake request code from cache validation code AvatarFactoryModule. (diff)
downloadopensim-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.
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs15
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs40
2 files changed, 51 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index d64a0c1..9df0592 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -343,12 +343,21 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
343 if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE) 343 if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
344 continue; 344 continue;
345 345
346 if (missingTexturesOnly && m_scene.AssetService.Get(face.TextureID.ToString()) != null) 346 if (missingTexturesOnly)
347 continue; 347 {
348 if (m_scene.AssetService.Get(face.TextureID.ToString()) != null)
349 continue;
350 else
351 m_log.DebugFormat(
352 "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.",
353 face.TextureID, idx, sp.Name);
354 }
348 else 355 else
356 {
349 m_log.DebugFormat( 357 m_log.DebugFormat(
350 "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.", 358 "[AVFACTORY]: Requesting rebake of {0} ({1}) for {2}.",
351 face.TextureID, idx, sp.Name); 359 face.TextureID, idx, sp.Name);
360 }
352 361
353 sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID); 362 sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID);
354 } 363 }
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