From 4567555c49cb560dd6f109bbfec42086af3de56f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 5 Dec 2011 20:44:20 +0000 Subject: Implement IOSHttpRequest and IOSHttpResponse http interfaces and use instead of OSHttpRequest/OSHttpResponse. This is required for the substitution of different HTTP servers or the newer HttpServer.dll without having to commit to a particular implementation. This is also required to write regression tests that involve the HTTP layer. If you need to recompile, all you need to do is replace OSHttpRequest/OSHttpResponse references with IOSHttpRequest/IOSHttpResponse. --- .../Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 6 +++--- .../OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 6 +++--- .../OptionalModules/World/WorldView/WorldViewRequestHandler.cs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index a5bba4f..5323a95 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs @@ -309,7 +309,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice caps.RegisterHandler("ProvisionVoiceAccountRequest", new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, delegate(string request, string path, string param, - OSHttpRequest httpRequest, OSHttpResponse httpResponse) + IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return ProvisionVoiceAccountRequest(scene, request, path, param, agentID, caps); @@ -317,7 +317,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice caps.RegisterHandler("ParcelVoiceInfoRequest", new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, delegate(string request, string path, string param, - OSHttpRequest httpRequest, OSHttpResponse httpResponse) + IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return ParcelVoiceInfoRequest(scene, request, path, param, agentID, caps); @@ -325,7 +325,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice caps.RegisterHandler("ChatSessionRequest", new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, delegate(string request, string path, string param, - OSHttpRequest httpRequest, OSHttpResponse httpResponse) + IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return ChatSessionRequest(scene, request, path, param, agentID, caps); diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index 534bf92..70e2f7e 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs @@ -421,7 +421,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice caps.RegisterHandler("ProvisionVoiceAccountRequest", new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, delegate(string request, string path, string param, - OSHttpRequest httpRequest, OSHttpResponse httpResponse) + IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return ProvisionVoiceAccountRequest(scene, request, path, param, agentID, caps); @@ -429,7 +429,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice caps.RegisterHandler("ParcelVoiceInfoRequest", new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, delegate(string request, string path, string param, - OSHttpRequest httpRequest, OSHttpResponse httpResponse) + IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return ParcelVoiceInfoRequest(scene, request, path, param, agentID, caps); @@ -437,7 +437,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice caps.RegisterHandler("ChatSessionRequest", new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, delegate(string request, string path, string param, - OSHttpRequest httpRequest, OSHttpResponse httpResponse) + IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { return ChatSessionRequest(scene, request, path, param, agentID, caps); diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs index f47d9c7..550b5d4 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView } public override byte[] Handle(string path, Stream requestData, - OSHttpRequest httpRequest, OSHttpResponse httpResponse) + IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { httpResponse.ContentType = "image/jpeg"; -- 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') 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') 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') 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') 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') 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') 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