Improve "app rebake" command to return a better message if no uploaded texture ids were available for the rebake request

0.7.2-post-fixes
Justin Clark-Casey (justincc) 2012-01-05 19:40:54 +00:00
parent eebcea22ba
commit 023023a5fc
4 changed files with 25 additions and 12 deletions

View File

@ -107,9 +107,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
// m_log.DebugFormat(
// "[LL IMAGE MANAGER]: Received duplicate of existing request for {0}, start packet {1} from {2}",
// newRequest.RequestedAssetID, newRequest.PacketNumber, m_client.Name);
m_log.DebugFormat(
"[LL IMAGE MANAGER]: Received duplicate of existing request for {0}, start packet {1} from {2}",
newRequest.RequestedAssetID, newRequest.PacketNumber, m_client.Name);
//m_log.DebugFormat("[TEX]: (UPD) ID={0}: D={1}, S={2}, P={3}",
// newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority);
@ -168,9 +168,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
// m_log.DebugFormat(
// "[LL IMAGE MANAGER]: Received request for {0}, start packet {1} from {2}",
// newRequest.RequestedAssetID, newRequest.PacketNumber, m_client.Name);
m_log.DebugFormat(
"[LL IMAGE MANAGER]: Received request for {0}, start packet {1} from {2}",
newRequest.RequestedAssetID, newRequest.PacketNumber, m_client.Name);
//m_log.DebugFormat("[TEX]: (NEW) ID={0}: D={1}, S={2}, P={3}",
// newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority);

View File

@ -159,8 +159,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
return (defonly ? false : true);
}
public void RequestRebake(IScenePresence sp, bool missingTexturesOnly)
public int RequestRebake(IScenePresence sp, bool missingTexturesOnly)
{
int texturesRebaked = 0;
for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
{
int idx = AvatarAppearance.BAKE_INDICES[i];
@ -197,8 +199,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
face.TextureID, idx, sp.Name);
}
texturesRebaked++;
sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID);
}
return texturesRebaked;
}
/// <summary>

View File

@ -68,7 +68,10 @@ namespace OpenSim.Region.Framework.Interfaces
/// If true, only request a rebake for the textures that are missing.
/// If false then we request a rebake of all textures for which we already have references.
/// </param>
void RequestRebake(IScenePresence sp, bool missingTexturesOnly);
/// <returns>
/// Number of rebake requests made. This will depend upon whether we've previously received texture IDs.
/// </returns>
int RequestRebake(IScenePresence sp, bool missingTexturesOnly);
/// <summary>
/// Validate that OpenSim can find the baked textures need to display a given avatar

View File

@ -273,11 +273,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
ScenePresence sp = scene.GetScenePresence(firstname, lastname);
if (sp != null && !sp.IsChildAgent)
{
MainConsole.Instance.OutputFormat(
"Requesting rebake of uploaded textures for {0}",
sp.Name, scene.RegionInfo.RegionName);
int rebakesRequested = scene.AvatarFactory.RequestRebake(sp, false);
scene.AvatarFactory.RequestRebake(sp, false);
if (rebakesRequested > 0)
MainConsole.Instance.OutputFormat(
"Requesting rebake of {0} uploaded textures for {1} in {2}",
rebakesRequested, sp.Name, scene.RegionInfo.RegionName);
else
MainConsole.Instance.OutputFormat(
"No texture IDs available for rebake request for {0} in {1}",
sp.Name, scene.RegionInfo.RegionName);
}
}
}