Make it possible to manually send appearance information via the "appearance send" command for a chosen avatar as well as all
parent
0dd45f6ca4
commit
7dce33ce69
|
@ -97,36 +97,67 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
|
||||||
"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.",
|
"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.",
|
||||||
ShowAppearanceInfo);
|
HandleShowAppearanceCommand);
|
||||||
|
|
||||||
scene.AddCommand(
|
scene.AddCommand(
|
||||||
this, "appearance send",
|
this, "appearance send",
|
||||||
"appearance send",
|
"appearance send [<first-name> <last-name>]",
|
||||||
"Send appearance data for each avatar in the simulator to viewers.",
|
"Send appearance data for each avatar in the simulator to other viewers."
|
||||||
SendAppearance);
|
+ "\nOptionally, you can specify that only a particular avatar's information is sent.",
|
||||||
|
HandleSendAppearanceCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SendAppearance(string module, string[] cmd)
|
private void HandleSendAppearanceCommand(string module, string[] cmd)
|
||||||
{
|
{
|
||||||
|
if (cmd.Length != 2 && cmd.Length < 4)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.OutputFormat("Usage: appearance send [<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.ForEachRootScenePresence(
|
if (targetNameSupplied)
|
||||||
sp =>
|
{
|
||||||
|
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
|
||||||
|
if (sp != null && !sp.IsChildAgent)
|
||||||
{
|
{
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scene.ForEachRootScenePresence(
|
||||||
|
sp =>
|
||||||
|
{
|
||||||
|
MainConsole.Instance.OutputFormat(
|
||||||
|
"Sending appearance information for {0} to all other avatars in {1}",
|
||||||
|
sp.Name, scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
|
scene.AvatarFactory.SendAppearance(sp.UUID);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ShowAppearanceInfo(string module, string[] cmd)
|
protected void HandleShowAppearanceCommand(string module, string[] cmd)
|
||||||
{
|
{
|
||||||
lock (m_scenes)
|
lock (m_scenes)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue