Allow "appearance show" command to take an optional avatar name
parent
7dce33ce69
commit
cc80377325
|
@ -96,14 +96,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
|
||||||
this, "appearance show",
|
this, "appearance show",
|
||||||
"appearance show",
|
"appearance show",
|
||||||
"Show appearance information for each avatar in the simulator.",
|
"Show appearance information for each avatar in the simulator.",
|
||||||
"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.",
|
"Optionally, you can view just a particular avatar's appearance information"
|
||||||
|
+ "\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.",
|
||||||
HandleShowAppearanceCommand);
|
HandleShowAppearanceCommand);
|
||||||
|
|
||||||
scene.AddCommand(
|
scene.AddCommand(
|
||||||
this, "appearance send",
|
this, "appearance send",
|
||||||
"appearance send [<first-name> <last-name>]",
|
"appearance send [<first-name> <last-name>]",
|
||||||
"Send appearance data for each avatar in the simulator to other viewers."
|
"Send appearance data for each avatar in the simulator to other viewers.",
|
||||||
+ "\nOptionally, you can specify that only a particular avatar's information is sent.",
|
"Optionally, you can specify that only a particular avatar's appearance data is sent.",
|
||||||
HandleSendAppearanceCommand);
|
HandleSendAppearanceCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +149,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
|
||||||
MainConsole.Instance.OutputFormat(
|
MainConsole.Instance.OutputFormat(
|
||||||
"Sending appearance information for {0} to all other avatars in {1}",
|
"Sending appearance information for {0} to all other avatars in {1}",
|
||||||
sp.Name, scene.RegionInfo.RegionName);
|
sp.Name, scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
scene.AvatarFactory.SendAppearance(sp.UUID);
|
scene.AvatarFactory.SendAppearance(sp.UUID);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -158,21 +159,49 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void HandleShowAppearanceCommand(string module, string[] cmd)
|
protected void HandleShowAppearanceCommand(string module, string[] cmd)
|
||||||
{
|
{
|
||||||
|
if (cmd.Length != 2 && cmd.Length < 4)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.OutputFormat("Usage: appearance show [<first-name> <last-name>]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool targetNameSupplied = false;
|
||||||
|
string optionalTargetFirstName = null;
|
||||||
|
string optionalTargetLastName = null;
|
||||||
|
|
||||||
|
if (cmd.Length >= 4)
|
||||||
|
{
|
||||||
|
targetNameSupplied = true;
|
||||||
|
optionalTargetFirstName = cmd[2];
|
||||||
|
optionalTargetLastName = cmd[3];
|
||||||
|
}
|
||||||
|
|
||||||
lock (m_scenes)
|
lock (m_scenes)
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_scenes.Values)
|
foreach (Scene scene in m_scenes.Values)
|
||||||
{
|
{
|
||||||
scene.ForEachClient(
|
if (targetNameSupplied)
|
||||||
delegate(IClientAPI client)
|
{
|
||||||
|
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
|
||||||
|
if (sp != null && !sp.IsChildAgent)
|
||||||
{
|
{
|
||||||
if (client is LLClientView && !((LLClientView)client).ChildAgentStatus())
|
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
|
||||||
|
MainConsole.Instance.OutputFormat(
|
||||||
|
"{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scene.ForEachRootScenePresence(
|
||||||
|
sp =>
|
||||||
{
|
{
|
||||||
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(client);
|
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
|
||||||
MainConsole.Instance.OutputFormat(
|
MainConsole.Instance.OutputFormat(
|
||||||
"{0} baked appearance texture is {1}", client.Name, bakedTextureValid ? "OK" : "corrupt");
|
"{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue