From 4be85eeaa53029381c9f6e0fec7ab18ab59eef06 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 6 Dec 2011 16:42:28 +0000 Subject: Make it possible to manually send appearance information via the "appearance send" command for a chosen avatar as well as all --- .../Avatar/Appearance/AppearanceInfoModule.cs | 53 +++++++++++++++++----- 1 file changed, 42 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index 59ad008..c6ee36b 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs @@ -97,36 +97,67 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance "appearance show", "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.", - ShowAppearanceInfo); + HandleShowAppearanceCommand); scene.AddCommand( this, "appearance send", - "appearance send", - "Send appearance data for each avatar in the simulator to viewers.", - SendAppearance); + "appearance send [ ]", + "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.", + 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 [ ]"); + 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) { foreach (Scene scene in m_scenes.Values) { - scene.ForEachRootScenePresence( - sp => + if (targetNameSupplied) + { + ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); + if (sp != null && !sp.IsChildAgent) { MainConsole.Instance.OutputFormat( "Sending appearance information for {0} to all other avatars in {1}", 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) { -- cgit v1.1