From d4fcba08af080bcc60da490155cc88d3f20e7dda Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 7 May 2011 01:06:55 +0100
Subject: Add module with "appearance show" command.
At the moment, this command just asks the AvatarFactory to perform the existing baked texture check for each avatar in the simulator and returns "OK" or "corrupt".
This is for debugging purposes
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 122 +++++++++++++++++++++
1 file changed, 122 insertions(+)
create mode 100644 OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
new file mode 100644
index 0000000..8589901
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the OpenSimulator Project nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using log4net;
+using Mono.Addins;
+using Nini.Config;
+using OpenMetaverse;
+using OpenSim.Framework;
+using OpenSim.Framework.Console;
+using OpenSim.Framework.Statistics;
+using OpenSim.Region.ClientStack.LindenUDP;
+using OpenSim.Region.Framework.Interfaces;
+using OpenSim.Region.Framework.Scenes;
+
+namespace OpenSim.Region.OptionalModules.Avatar.Appearance
+{
+ ///
+ /// A module that just holds commands for inspecting avatar appearance.
+ ///
+ [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AppearanceInfoModule")]
+ public class AppearanceInfoModule : ISharedRegionModule
+ {
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
+ protected Dictionary m_scenes = new Dictionary();
+ protected IAvatarFactory m_avatarFactory;
+
+ public string Name { get { return "Appearance Information Module"; } }
+
+ public Type ReplaceableInterface { get { return null; } }
+
+ public void Initialise(IConfigSource source)
+ {
+// m_log.DebugFormat("[APPEARANCE INFO MODULE]: INITIALIZED MODULE");
+ }
+
+ public void PostInitialise()
+ {
+// m_log.DebugFormat("[APPEARANCE INFO MODULE]: POST INITIALIZED MODULE");
+ }
+
+ public void Close()
+ {
+// m_log.DebugFormat("[APPEARANCE INFO MODULE]: CLOSED MODULE");
+ }
+
+ public void AddRegion(Scene scene)
+ {
+// m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName);
+ }
+
+ public void RemoveRegion(Scene scene)
+ {
+// m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
+
+ lock (m_scenes)
+ m_scenes.Remove(scene.RegionInfo.RegionID);
+ }
+
+ public void RegionLoaded(Scene scene)
+ {
+// m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
+
+ lock (m_scenes)
+ m_scenes[scene.RegionInfo.RegionID] = scene;
+
+ scene.AddCommand(
+ this, "appearance show",
+ "appearance show",
+ "Show appearance information for each avatar in the simulator. At the moment, ",
+ ShowAppearanceInfo);
+ }
+
+ protected void ShowAppearanceInfo(string module, string[] cmd)
+ {
+ lock (m_scenes)
+ {
+ foreach (Scene scene in m_scenes.Values)
+ {
+ scene.ForEachClient(
+ delegate(IClientAPI client)
+ {
+ if (client is LLClientView && !((LLClientView)client).ChildAgentStatus())
+ {
+ bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(client);
+ MainConsole.Instance.OutputFormat(
+ "{0} baked apperance texture is {1}", client.Name, bakedTextureValid ? "OK" : "corrupt");
+ }
+ });
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
--
cgit v1.1
From 91ec1a572ab82b67a3e3090bb9d90009c294ef99 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 26 May 2011 02:48:47 +0100
Subject: improve help information for "appearance show"
at the moment, this just performs a baked avatar check for everybody in the region. If the check returns 'corrupt' then a baked texture is missing and other avatars will continue to see the gas ball.
---
.../Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 8589901..7304145 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -95,8 +95,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
scene.AddCommand(
this, "appearance show",
"appearance show",
- "Show appearance information for each avatar in the simulator. At the moment, ",
- ShowAppearanceInfo);
+ "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);
}
protected void ShowAppearanceInfo(string module, string[] cmd)
--
cgit v1.1
From 22f25fae387a801e8545f6ab6e2c9700926ae6e4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 29 Jun 2011 00:28:22 +0100
Subject: Hack around with the NPC module to get osNpcCreate() partially
working again.
This now creates an avatar but appearance is always cloudy.
Move doesn't work.
Really, creating an NPC should only involve a ScenePresence rather than doing anything with IClientAPI, since an NPC has no viewer to communicate with!
---
.../Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 7304145..77e7acf 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(client);
MainConsole.Instance.OutputFormat(
- "{0} baked apperance texture is {1}", client.Name, bakedTextureValid ? "OK" : "corrupt");
+ "{0} baked appearance texture is {1}", client.Name, bakedTextureValid ? "OK" : "corrupt");
}
});
}
--
cgit v1.1
From da794f34a56f7c88904315ae538de8f3790e6891 Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Wed, 19 Oct 2011 14:41:44 -0700
Subject: Renamed and rearranged AvatarFactoryModule to eliminate redundant
lookups of scene presence by client ID.
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 77e7acf..2cef8a9 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary m_scenes = new Dictionary();
- protected IAvatarFactory m_avatarFactory;
+ protected IAvatarFactoryModule m_avatarFactory;
public string Name { get { return "Appearance Information Module"; } }
@@ -106,14 +106,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
foreach (Scene scene in m_scenes.Values)
{
- scene.ForEachClient(
- delegate(IClientAPI client)
+ scene.ForEachScenePresence(
+ delegate(ScenePresence sp)
{
- if (client is LLClientView && !((LLClientView)client).ChildAgentStatus())
+ if (sp.ControllingClient is LLClientView && !((LLClientView)sp.ControllingClient).ChildAgentStatus())
{
- bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(client);
+ bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
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");
}
});
}
--
cgit v1.1
From 9456a540c50b90d2c2cdb1b556e9d6190f817426 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 1 Nov 2011 23:23:45 +0000
Subject: Add "appearance send" command to allow manual sending of appearance.
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 2cef8a9..f8120aa 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -98,7 +98,24 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
"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);
- }
+
+ scene.AddCommand(
+ this, "appearance send",
+ "appearance send",
+ "Send appearance data for each avatar in the simulator to viewers.",
+ SendAppearance);
+ }
+
+ private void SendAppearance(string module, string[] cmd)
+ {
+ lock (m_scenes)
+ {
+ foreach (Scene scene in m_scenes.Values)
+ {
+ scene.ForEachRootScenePresence(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
+ }
+ }
+ }
protected void ShowAppearanceInfo(string module, string[] cmd)
{
--
cgit v1.1
From 94dc7d07ebc22ce0e0d9b77e91538ddc90799bee Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Thu, 3 Nov 2011 17:06:08 -0700
Subject: Renamed ForEachRootScenePresence to ForEachAvatar. Cleaned up calls
to the 3 iteration functions so more of them are using the correct iteration
for the action they are performing. The 3 iterators that seem to fit all
actions within OpenSim at this time are:
ForEachAvatar: Perform an action on all avatars (root presences)
ForEachClient: Perform an action on all clients (root or child clients)
ForEachRootClient: Perform an action on all clients that have an avatar
There are still a dozen places or so calling the old
ForEachScenePresence that will take a little more refactoring to
eliminate.
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index f8120aa..5a3a62f 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
foreach (Scene scene in m_scenes.Values)
{
- scene.ForEachRootScenePresence(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
+ scene.ForEachAvatar(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
}
}
}
@@ -123,15 +123,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
foreach (Scene scene in m_scenes.Values)
{
- scene.ForEachScenePresence(
+ scene.ForEachAvatar(
delegate(ScenePresence sp)
{
- if (sp.ControllingClient is LLClientView && !((LLClientView)sp.ControllingClient).ChildAgentStatus())
- {
- bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
- MainConsole.Instance.OutputFormat(
- "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
- }
+ bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
+ MainConsole.Instance.OutputFormat(
+ "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
});
}
}
--
cgit v1.1
From b8d50b10fbb03ed8c8a9aac94564c354559c3bb0 Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Thu, 3 Nov 2011 17:53:51 -0700
Subject: Rename ForEachAvatar back to ForEachScenePresence. The other changes
from previous commit which sort out which iterator is used are left intact. A
discussion is needed as to what constitutes an avatar vs a ScenePresence.
---
.../Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 5a3a62f..28f04b3 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
foreach (Scene scene in m_scenes.Values)
{
- scene.ForEachAvatar(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
+ scene.ForEachRootScenePresence(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
}
}
}
@@ -123,7 +123,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
foreach (Scene scene in m_scenes.Values)
{
- scene.ForEachAvatar(
+ scene.ForEachRootScenePresence(
delegate(ScenePresence sp)
{
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
--
cgit v1.1
From d33d12ba83fae18d720ef24b56cba5c17688d386 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 6 Dec 2011 16:07:24 +0000
Subject: Provide feedback as to which avatars are resending appearance
informion on "appearance send" console command
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 28f04b3..59ad008 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AppearanceInfoModule")]
public class AppearanceInfoModule : ISharedRegionModule
{
-// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary m_scenes = new Dictionary();
protected IAvatarFactoryModule m_avatarFactory;
@@ -112,7 +112,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
foreach (Scene scene in m_scenes.Values)
{
- scene.ForEachRootScenePresence(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
+ 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);
+ }
+ );
}
}
}
--
cgit v1.1
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/Avatar/Appearance')
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
From 1b9eb5285033839bdc1b948ec085aa8736473ad6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 6 Dec 2011 18:03:16 +0000
Subject: Allow "appearance show" command to take an optional avatar name
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 48 ++++++++++++++++++----
1 file changed, 40 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index c6ee36b..7f3f365 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -96,14 +96,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
this, "appearance show",
"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.",
+ "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);
scene.AddCommand(
this, "appearance send",
"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.",
+ "Send appearance data for each avatar in the simulator to other viewers.",
+ "Optionally, you can specify that only a particular avatar's appearance data is sent.",
HandleSendAppearanceCommand);
}
@@ -148,7 +149,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
MainConsole.Instance.OutputFormat(
"Sending appearance information for {0} to all other avatars in {1}",
sp.Name, scene.RegionInfo.RegionName);
-
+
scene.AvatarFactory.SendAppearance(sp.UUID);
}
);
@@ -158,18 +159,49 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
}
protected void HandleShowAppearanceCommand(string module, string[] cmd)
- {
+ {
+ if (cmd.Length != 2 && cmd.Length < 4)
+ {
+ MainConsole.Instance.OutputFormat("Usage: appearance show [ ]");
+ 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(
- delegate(ScenePresence sp)
+ if (targetNameSupplied)
+ {
+ ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
+ if (sp != null && !sp.IsChildAgent)
{
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(sp);
+ MainConsole.Instance.OutputFormat(
+ "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
+ }
+ );
+ }
}
}
}
--
cgit v1.1
From ec4f217af8bb5ff90978ba068860ed38e75d40f8 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 6 Dec 2011 18:06:29 +0000
Subject: Actually send the avatar data if an individual avatar is specified,
rather than accidentally doing nothing
---
.../Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 7f3f365..b6dfc5c 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -139,6 +139,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
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
--
cgit v1.1
From b9a461c5ad10753e98a17b17858cc3b2eae568ea Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 6 Dec 2011 18:32:27 +0000
Subject: In "appearance show", if a particular avatar is specified, print out
texture UUID for each bake type and whether the simulator can find it.
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 40 +++++++++++++++++++---
1 file changed, 35 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index b6dfc5c..b949059 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -49,9 +49,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
public class AppearanceInfoModule : ISharedRegionModule
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- protected Dictionary m_scenes = new Dictionary();
- protected IAvatarFactoryModule m_avatarFactory;
+
+ public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}";
+
+ private Dictionary m_scenes = new Dictionary();
+ private IAvatarFactoryModule m_avatarFactory;
public string Name { get { return "Appearance Information Module"; } }
@@ -96,8 +98,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
this, "appearance show",
"appearance show",
"Show appearance information for each avatar in the simulator.",
- "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.",
+ "This command checks whether the simulator has all the baked textures required to display an avatar to other viewers. "
+ + "\nIf not, then appearance is 'corrupt' and other avatars will continue to see it as a cloud."
+ + "\nOptionally, you can view just a particular avatar's appearance information."
+ + "\nIn this case, the texture UUID for each bake type is also shown and whether the simulator can find the referenced texture.",
HandleShowAppearanceCommand);
scene.AddCommand(
@@ -188,6 +192,32 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
if (sp != null && !sp.IsChildAgent)
{
+ MainConsole.Instance.OutputFormat("For {0} in {1}", sp.Name, scene.RegionInfo.RegionName);
+ MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, "Bake Type", "UUID");
+
+ Dictionary bakedTextures
+ = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID);
+ foreach (BakeType bt in bakedTextures.Keys)
+ {
+ string rawTextureID;
+
+ if (bakedTextures[bt] == null)
+ {
+ rawTextureID = "not set";
+ }
+ else
+ {
+ rawTextureID = bakedTextures[bt].TextureID.ToString();
+
+ if (scene.AssetService.Get(rawTextureID) == null)
+ rawTextureID += " (not found)";
+ else
+ rawTextureID += " (uploaded)";
+ }
+
+ MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, bt, rawTextureID);
+ }
+
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
MainConsole.Instance.OutputFormat(
"{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
--
cgit v1.1
From 136a6a6e0fe7bcb5d24675dae2c3c538df404d62 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 6 Dec 2011 18:36:11 +0000
Subject: Make "show appearance" a synonym for "appearance show"
---
.../OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index b949059..89704d5 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -92,11 +92,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
// m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
lock (m_scenes)
- m_scenes[scene.RegionInfo.RegionID] = scene;
+ m_scenes[scene.RegionInfo.RegionID] = scene;
+
+ scene.AddCommand(
+ this, "show appearance",
+ "show appearance [ ]",
+ "Synonym for 'appearance show'",
+ HandleShowAppearanceCommand);
scene.AddCommand(
this, "appearance show",
- "appearance show",
+ "appearance show [ ]",
"Show appearance information for each avatar in the simulator.",
"This command checks whether the simulator has all the baked textures required to display an avatar to other viewers. "
+ "\nIf not, then appearance is 'corrupt' and other avatars will continue to see it as a cloud."
--
cgit v1.1
From e88ad5aab99886eb70caf37627e8a6e3fc840e6e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 9 Dec 2011 23:55:54 +0000
Subject: minor: remove a mono compiler warning
---
.../Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 89704d5..40cbc60 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}";
private Dictionary m_scenes = new Dictionary();
- private IAvatarFactoryModule m_avatarFactory;
+// private IAvatarFactoryModule m_avatarFactory;
public string Name { get { return "Appearance Information Module"; } }
--
cgit v1.1
From 0b91ec8dd2b78461cb0fcdec567a83e88a76ac87 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 19 Dec 2011 18:58:05 +0000
Subject: Migrate detailed "appearance show" report generation up to
AvatarFactoryModule from AppearanceInfoModule so that it can be used in debug
(inactive).
Further filters "debug packet " to exclused [Request]ObjectPropertiesFamily if level is below 25.
Adjust some method doc
Minor changes to some logging messages.
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 34 +---------------------
1 file changed, 1 insertion(+), 33 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 40cbc60..1ce24f1 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -50,8 +50,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}";
-
private Dictionary m_scenes = new Dictionary();
// private IAvatarFactoryModule m_avatarFactory;
@@ -197,37 +195,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
if (sp != null && !sp.IsChildAgent)
- {
- MainConsole.Instance.OutputFormat("For {0} in {1}", sp.Name, scene.RegionInfo.RegionName);
- MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, "Bake Type", "UUID");
-
- Dictionary bakedTextures
- = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID);
- foreach (BakeType bt in bakedTextures.Keys)
- {
- string rawTextureID;
-
- if (bakedTextures[bt] == null)
- {
- rawTextureID = "not set";
- }
- else
- {
- rawTextureID = bakedTextures[bt].TextureID.ToString();
-
- if (scene.AssetService.Get(rawTextureID) == null)
- rawTextureID += " (not found)";
- else
- rawTextureID += " (uploaded)";
- }
-
- MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, bt, rawTextureID);
- }
-
- bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
- MainConsole.Instance.OutputFormat(
- "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
- }
+ scene.AvatarFactory.WriteBakedTexturesReport(sp, MainConsole.Instance.OutputFormat);
}
else
{
--
cgit v1.1
From 8fb70a2058e98dea63e7ee7c5b55532668fccd38 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 4 Jan 2012 22:45:07 +0000
Subject: 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.
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 40 +++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
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
"Send appearance data for each avatar in the simulator to other viewers.",
"Optionally, you can specify that only a particular avatar's appearance data is sent.",
HandleSendAppearanceCommand);
+
+ scene.AddCommand(
+ this, "appearance rebake",
+ "appearance rebake ",
+ "Send a request to the user's viewer for it to rebake and reupload its appearance textures.",
+ "This is currently done for all baked texture references previously received, whether the simulator can find the asset or not."
+ + "\nThis will only work for texture ids that the viewer has already uploaded."
+ + "\nIf the viewer has not yet sent the server any texture ids then nothing will happen"
+ + "\nsince requests can only be made for ids that the client has already sent us",
+ HandleRebakeAppearanceCommand);
}
private void HandleSendAppearanceCommand(string module, string[] cmd)
@@ -210,6 +220,34 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
}
}
}
- }
+ }
+
+ private void HandleRebakeAppearanceCommand(string module, string[] cmd)
+ {
+ if (cmd.Length != 4)
+ {
+ MainConsole.Instance.OutputFormat("Usage: appearance rebake ");
+ return;
+ }
+
+ string firstname = cmd[2];
+ string lastname = cmd[3];
+
+ lock (m_scenes)
+ {
+ foreach (Scene scene in m_scenes.Values)
+ {
+ 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);
+
+ scene.AvatarFactory.RequestRebake(sp, false);
+ }
+ }
+ }
+ }
}
}
\ No newline at end of file
--
cgit v1.1
From c201b54b8524033310c59fe353616e84616a542e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 5 Jan 2012 19:40:54 +0000
Subject: Improve "app rebake" command to return a better message if no
uploaded texture ids were available for the rebake request
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 7e15718..39cd4c9 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -240,11 +240,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);
}
}
}
--
cgit v1.1
From d67e8291c86beb5c3c8e8b11a7f95b49c834c779 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 10 Jan 2012 18:41:07 +0000
Subject: Add "app find " command to find the appearance
using a particular baked texture, if any.
This is for debugging to relate texture console entries back to particular users on the simulator end.
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 50 ++++++++++++++++++++++
1 file changed, 50 insertions(+)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 39cd4c9..2369d94 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -27,6 +27,7 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Reflection;
using System.Text;
using log4net;
@@ -124,6 +125,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
+ "\nIf the viewer has not yet sent the server any texture ids then nothing will happen"
+ "\nsince requests can only be made for ids that the client has already sent us",
HandleRebakeAppearanceCommand);
+
+ scene.AddCommand(
+ this, "appearance find",
+ "appearance find ",
+ "Find out which avatar uses the given asset as a baked texture, if any.",
+ "You can specify just the beginning of the uuid, e.g. 2008a8d. A longer UUID must be in dashed format.",
+ HandleFindAppearanceCommand);
}
private void HandleSendAppearanceCommand(string module, string[] cmd)
@@ -254,5 +262,47 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
}
}
}
+
+ protected void HandleFindAppearanceCommand(string module, string[] cmd)
+ {
+ if (cmd.Length != 3)
+ {
+ MainConsole.Instance.OutputFormat("Usage: appearance find ");
+ return;
+ }
+
+ string rawUuid = cmd[2];
+
+ HashSet matchedAvatars = new HashSet();
+
+ lock (m_scenes)
+ {
+ foreach (Scene scene in m_scenes.Values)
+ {
+ scene.ForEachRootScenePresence(
+ sp =>
+ {
+ Dictionary bakedFaces = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID);
+ foreach (Primitive.TextureEntryFace face in bakedFaces.Values)
+ {
+ if (face != null && face.TextureID.ToString().StartsWith(rawUuid))
+ matchedAvatars.Add(sp);
+ }
+ });
+ }
+ }
+
+ if (matchedAvatars.Count == 0)
+ {
+ MainConsole.Instance.OutputFormat("{0} did not match any baked avatar textures in use", rawUuid);
+ }
+ else
+ {
+ MainConsole.Instance.OutputFormat(
+ "{0} matched {1}",
+ rawUuid,
+ string.Join(", ", matchedAvatars.ToList().ConvertAll(sp => sp.Name).ToArray()));
+ }
+ }
}
}
\ No newline at end of file
--
cgit v1.1
From 749c3fef8ad2d3af97fcd9ab9c72740675e46715 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 8 Mar 2012 01:51:37 +0000
Subject: Change "help" to display categories/module list then "help
" to display commands in a category.
This is to deal with the hundred lines of command splurge when one previously typed "help"
Modelled somewhat on the mysql console
One can still type help to get per command help at any point.
Categories capitalized to avoid conflict with the all-lowercase commands (except for commander system, as of yet).
Does not affect command parsing or any other aspects of the console apart from the help system.
Backwards compatible with existing modules.
---
.../OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 2369d94..6bb6729 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -94,13 +94,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
m_scenes[scene.RegionInfo.RegionID] = scene;
scene.AddCommand(
- this, "show appearance",
+ "Users", this, "show appearance",
"show appearance [ ]",
"Synonym for 'appearance show'",
HandleShowAppearanceCommand);
scene.AddCommand(
- this, "appearance show",
+ "Users", this, "appearance show",
"appearance show [ ]",
"Show appearance information for each avatar in the simulator.",
"This command checks whether the simulator has all the baked textures required to display an avatar to other viewers. "
@@ -110,14 +110,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
HandleShowAppearanceCommand);
scene.AddCommand(
- this, "appearance send",
+ "Users", this, "appearance send",
"appearance send [ ]",
"Send appearance data for each avatar in the simulator to other viewers.",
"Optionally, you can specify that only a particular avatar's appearance data is sent.",
HandleSendAppearanceCommand);
scene.AddCommand(
- this, "appearance rebake",
+ "Users", this, "appearance rebake",
"appearance rebake ",
"Send a request to the user's viewer for it to rebake and reupload its appearance textures.",
"This is currently done for all baked texture references previously received, whether the simulator can find the asset or not."
@@ -127,7 +127,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
HandleRebakeAppearanceCommand);
scene.AddCommand(
- this, "appearance find",
+ "Users", this, "appearance find",
"appearance find ",
"Find out which avatar uses the given asset as a baked texture, if any.",
"You can specify just the beginning of the uuid, e.g. 2008a8d. A longer UUID must be in dashed format.",
--
cgit v1.1
From 35efa88c26d249d315837fdca0faf643511e1a4e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 25 Jul 2012 23:11:50 +0100
Subject: Rename OpenSim.Framework.Statistics to OpenSim.Framework.Monitoring.
This better reflects the long-term purpose of that project and matches Monitoring modules.
---
.../Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 6bb6729..d718a2f 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -36,7 +36,7 @@ using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Console;
-using OpenSim.Framework.Statistics;
+using OpenSim.Framework.Monitoring;
using OpenSim.Region.ClientStack.LindenUDP;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
--
cgit v1.1
From 9de670c550fd6847c2c14413d2c956f446b958f0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 21 Feb 2013 23:08:50 +0000
Subject: minor: Change summary in "show appearance" console command to
"incomplete" rather than "corrupt"
Corrupt is misleading - it implies textures were uploaded but are not j2k valid.
The actual situation is that at least one required baked texture is not present.
---
.../Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index d718a2f..fa35f0f 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -222,7 +222,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
MainConsole.Instance.OutputFormat(
- "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
+ "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "incomplete");
}
);
}
--
cgit v1.1
From 9b09dd357556b0a038c2f7f83e4cd7318555bd11 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 28 Oct 2014 17:29:04 +0000
Subject: Add "wearables show" console command.
This shows summary wearables information (shape, hair, etc.) for all avatars in the scene or specific information about a given avatar's wearables.
Similar to the existing "attachments show" command.
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 100 ++++++++++++++++++++-
1 file changed, 97 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index fa35f0f..51dfd47 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -102,7 +102,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
scene.AddCommand(
"Users", this, "appearance show",
"appearance show [ ]",
- "Show appearance information for each avatar in the simulator.",
+ "Show appearance information for avatars.",
"This command checks whether the simulator has all the baked textures required to display an avatar to other viewers. "
+ "\nIf not, then appearance is 'corrupt' and other avatars will continue to see it as a cloud."
+ "\nOptionally, you can view just a particular avatar's appearance information."
@@ -132,6 +132,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
"Find out which avatar uses the given asset as a baked texture, if any.",
"You can specify just the beginning of the uuid, e.g. 2008a8d. A longer UUID must be in dashed format.",
HandleFindAppearanceCommand);
+
+ scene.AddCommand(
+ "Users", this, "wearables show",
+ "wearables show [ ]",
+ "Show information about wearables for avatars.",
+ "If no avatar name is given then a general summary for all avatars in the scene is shown.\n"
+ + "If an avatar name is given then specific information about current wearables is shown.",
+ HandleShowWearablesCommand);
}
private void HandleSendAppearanceCommand(string module, string[] cmd)
@@ -186,7 +194,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
}
}
- protected void HandleShowAppearanceCommand(string module, string[] cmd)
+ private void HandleShowAppearanceCommand(string module, string[] cmd)
{
if (cmd.Length != 2 && cmd.Length < 4)
{
@@ -263,7 +271,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
}
}
- protected void HandleFindAppearanceCommand(string module, string[] cmd)
+ private void HandleFindAppearanceCommand(string module, string[] cmd)
{
if (cmd.Length != 3)
{
@@ -304,5 +312,91 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
string.Join(", ", matchedAvatars.ToList().ConvertAll(sp => sp.Name).ToArray()));
}
}
+
+ protected void HandleShowWearablesCommand(string module, string[] cmd)
+ {
+ if (cmd.Length != 2 && cmd.Length < 4)
+ {
+ MainConsole.Instance.OutputFormat("Usage: wearables show [ ]");
+ return;
+ }
+
+ bool targetNameSupplied = false;
+ string optionalTargetFirstName = null;
+ string optionalTargetLastName = null;
+
+ if (cmd.Length >= 4)
+ {
+ targetNameSupplied = true;
+ optionalTargetFirstName = cmd[2];
+ optionalTargetLastName = cmd[3];
+ }
+
+ StringBuilder sb = new StringBuilder();
+
+ if (targetNameSupplied)
+ {
+ lock (m_scenes)
+ {
+ foreach (Scene scene in m_scenes.Values)
+ {
+ ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
+ if (sp != null && !sp.IsChildAgent)
+ AppendWearablesDetailReport(sp, sb);
+ }
+ }
+ }
+ else
+ {
+ ConsoleDisplayTable cdt = new ConsoleDisplayTable();
+ cdt.AddColumn("Name", ConsoleDisplayUtil.UserNameSize);
+ cdt.AddColumn("Wearables", 2);
+
+ lock (m_scenes)
+ {
+ foreach (Scene scene in m_scenes.Values)
+ {
+ scene.ForEachRootScenePresence(
+ sp =>
+ {
+ int count = 0;
+
+ for (int i = (int)WearableType.Shape; i < (int)WearableType.Physics; i++)
+ count += sp.Appearance.Wearables[i].Count;
+
+ cdt.AddRow(sp.Name, count);
+ }
+ );
+ }
+ }
+
+ sb.Append(cdt.ToString());
+ }
+
+ MainConsole.Instance.Output(sb.ToString());
+ }
+
+ private void AppendWearablesDetailReport(ScenePresence sp, StringBuilder sb)
+ {
+ sb.AppendFormat("\nWearables for {0}\n", sp.Name);
+
+ ConsoleDisplayTable cdt = new ConsoleDisplayTable();
+ cdt.AddColumn("Type", 10);
+ cdt.AddColumn("Item UUID", ConsoleDisplayUtil.UuidSize);
+ cdt.AddColumn("Asset UUID", ConsoleDisplayUtil.UuidSize);
+
+ for (int i = (int)WearableType.Shape; i < (int)WearableType.Physics; i++)
+ {
+ AvatarWearable aw = sp.Appearance.Wearables[i];
+
+ for (int j = 0; j < aw.Count; j++)
+ {
+ WearableItem wi = aw[j];
+ cdt.AddRow(Enum.GetName(typeof(WearableType), i), wi.ItemID, wi.AssetID);
+ }
+ }
+
+ sb.Append(cdt.ToString());
+ }
}
}
\ No newline at end of file
--
cgit v1.1
From 3a1ce2715a522dcb1971944af17ad10d2263c7ab Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 28 Oct 2014 23:00:49 +0000
Subject: Add "wearables check" console command
This checks that all the wearable assets and any assets for a given logged in avatar exist in the asset service
---
.../Avatar/Appearance/AppearanceInfoModule.cs | 96 ++++++++++++++++++++--
1 file changed, 87 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 51dfd47..f67f613 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -51,7 +51,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private Dictionary m_scenes = new Dictionary();
+ private List m_scenes = new List();
+
// private IAvatarFactoryModule m_avatarFactory;
public string Name { get { return "Appearance Information Module"; } }
@@ -83,7 +84,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
// m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
lock (m_scenes)
- m_scenes.Remove(scene.RegionInfo.RegionID);
+ m_scenes.Remove(scene);
}
public void RegionLoaded(Scene scene)
@@ -91,7 +92,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
// m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
lock (m_scenes)
- m_scenes[scene.RegionInfo.RegionID] = scene;
+ m_scenes.Add(scene);
scene.AddCommand(
"Users", this, "show appearance",
@@ -140,6 +141,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
"If no avatar name is given then a general summary for all avatars in the scene is shown.\n"
+ "If an avatar name is given then specific information about current wearables is shown.",
HandleShowWearablesCommand);
+
+ scene.AddCommand(
+ "Users", this, "wearables check",
+ "wearables check ",
+ "Check that the wearables of a given avatar in the scene are valid.",
+ "This currently checks that the wearable assets themselves and any assets referenced by them exist.",
+ HandleCheckWearablesCommand);
}
private void HandleSendAppearanceCommand(string module, string[] cmd)
@@ -163,7 +171,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
lock (m_scenes)
{
- foreach (Scene scene in m_scenes.Values)
+ foreach (Scene scene in m_scenes)
{
if (targetNameSupplied)
{
@@ -215,7 +223,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
lock (m_scenes)
{
- foreach (Scene scene in m_scenes.Values)
+ foreach (Scene scene in m_scenes)
{
if (targetNameSupplied)
{
@@ -251,7 +259,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
lock (m_scenes)
{
- foreach (Scene scene in m_scenes.Values)
+ foreach (Scene scene in m_scenes)
{
ScenePresence sp = scene.GetScenePresence(firstname, lastname);
if (sp != null && !sp.IsChildAgent)
@@ -285,7 +293,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
lock (m_scenes)
{
- foreach (Scene scene in m_scenes.Values)
+ foreach (Scene scene in m_scenes)
{
scene.ForEachRootScenePresence(
sp =>
@@ -338,7 +346,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
lock (m_scenes)
{
- foreach (Scene scene in m_scenes.Values)
+ foreach (Scene scene in m_scenes)
{
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
if (sp != null && !sp.IsChildAgent)
@@ -354,7 +362,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
lock (m_scenes)
{
- foreach (Scene scene in m_scenes.Values)
+ foreach (Scene scene in m_scenes)
{
scene.ForEachRootScenePresence(
sp =>
@@ -376,6 +384,76 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
MainConsole.Instance.Output(sb.ToString());
}
+ private void HandleCheckWearablesCommand(string module, string[] cmd)
+ {
+ if (cmd.Length != 4)
+ {
+ MainConsole.Instance.OutputFormat("Usage: wearables check ");
+ return;
+ }
+
+ string firstname = cmd[2];
+ string lastname = cmd[3];
+
+ StringBuilder sb = new StringBuilder();
+ UuidGatherer uuidGatherer = new UuidGatherer(m_scenes[0].AssetService);
+
+ lock (m_scenes)
+ {
+ foreach (Scene scene in m_scenes)
+ {
+ ScenePresence sp = scene.GetScenePresence(firstname, lastname);
+ if (sp != null && !sp.IsChildAgent)
+ {
+ sb.AppendFormat("Wearables checks for {0}\n\n", sp.Name);
+
+ for (int i = (int)WearableType.Shape; i < (int)WearableType.Physics; i++)
+ {
+ AvatarWearable aw = sp.Appearance.Wearables[i];
+
+ if (aw.Count > 0)
+ {
+ sb.Append(Enum.GetName(typeof(WearableType), i));
+ sb.Append("\n");
+
+ for (int j = 0; j < aw.Count; j++)
+ {
+ WearableItem wi = aw[j];
+
+ ConsoleDisplayList cdl = new ConsoleDisplayList();
+ cdl.Indent = 2;
+ cdl.AddRow("Item UUID", wi.ItemID);
+ cdl.AddRow("Assets", "");
+ sb.Append(cdl.ToString());
+
+ Dictionary assetUuids = new Dictionary();
+ uuidGatherer.GatherAssetUuids(wi.AssetID, assetUuids);
+ string[] assetStrings
+ = Array.ConvertAll(assetUuids.Keys.ToArray(), u => u.ToString());
+
+ bool[] existChecks = scene.AssetService.AssetsExist(assetStrings);
+
+ ConsoleDisplayTable cdt = new ConsoleDisplayTable();
+ cdt.Indent = 4;
+ cdt.AddColumn("Type", 10);
+ cdt.AddColumn("UUID", ConsoleDisplayUtil.UuidSize);
+ cdt.AddColumn("Found", 5);
+
+ for (int k = 0; k < existChecks.Length; k++)
+ cdt.AddRow((AssetType)assetUuids[new UUID(assetStrings[k])], assetStrings[k], existChecks[k] ? "yes" : "no");
+
+ sb.Append(cdt.ToString());
+ sb.Append("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+
+ MainConsole.Instance.Output(sb.ToString());
+ }
+
private void AppendWearablesDetailReport(ScenePresence sp, StringBuilder sb)
{
sb.AppendFormat("\nWearables for {0}\n", sp.Name);
--
cgit v1.1
From 08606ae409b400b6f9b83006ed04826eede8a9c7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 8 Jan 2015 20:21:40 +0000
Subject: Make the IteratingUuidGatherer the only UuidGatherer.
This UUID gatherer provides a superset of the previous gatherer's functionality
as it also allows the caller to control gathering iterations for load purposes.
---
.../OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Avatar/Appearance')
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index f67f613..2f9bb1e 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -426,10 +426,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
cdl.AddRow("Assets", "");
sb.Append(cdl.ToString());
- Dictionary assetUuids = new Dictionary();
- uuidGatherer.GatherAssetUuids(wi.AssetID, assetUuids);
+ uuidGatherer.AddForInspection(wi.AssetID);
+ uuidGatherer.GatherAll();
string[] assetStrings
- = Array.ConvertAll(assetUuids.Keys.ToArray(), u => u.ToString());
+ = Array.ConvertAll(uuidGatherer.GatheredUuids.Keys.ToArray(), u => u.ToString());
bool[] existChecks = scene.AssetService.AssetsExist(assetStrings);
@@ -440,7 +440,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
cdt.AddColumn("Found", 5);
for (int k = 0; k < existChecks.Length; k++)
- cdt.AddRow((AssetType)assetUuids[new UUID(assetStrings[k])], assetStrings[k], existChecks[k] ? "yes" : "no");
+ cdt.AddRow(
+ (AssetType)uuidGatherer.GatheredUuids[new UUID(assetStrings[k])],
+ assetStrings[k], existChecks[k] ? "yes" : "no");
sb.Append(cdt.ToString());
sb.Append("\n");
--
cgit v1.1