From c2ea7b99e1cdbc06035e12306a71712f763b0818 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 25 Mar 2008 18:48:07 +0000 Subject: Moved Avatar appearance Factory to its own project so that the reference to MySQLDatabaseMapper could be removed from Region.Environment. Added a using OpenSim.Framework.Data statement to MySQLDatabaseMapper , to try to fix the build problem that has been reported on the mailing list. --- OpenSim/Region/Environment/ModuleLoader.cs | 18 +++++++++--------- .../Environment/Modules/AppearanceTableMapper.cs | 7 ++++--- .../Environment/Modules/AvatarFactoryModule.cs | 4 +++- OpenSim/Region/Environment/Scenes/Scene.cs | 22 +++++++++++++++++++++- 4 files changed, 37 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index 4a8bf7b..7fb8d8a 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs @@ -114,15 +114,15 @@ namespace OpenSim.Region.Environment m_loadedSharedModules.Add(loadMod.Name, loadMod); } - AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); - if (m_loadedSharedModules.ContainsKey(avatarFactory.Name)) - { - m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"); - } - else - { - m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory); - } + // AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); + // if (m_loadedSharedModules.ContainsKey(avatarFactory.Name)) + // { + // m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"); + // } + // else + // { + // m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory); + // } XMLRPCModule xmlRpcMod = new XMLRPCModule(); if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name)) diff --git a/OpenSim/Region/Environment/Modules/AppearanceTableMapper.cs b/OpenSim/Region/Environment/Modules/AppearanceTableMapper.cs index 0dc43a6..eab6528 100644 --- a/OpenSim/Region/Environment/Modules/AppearanceTableMapper.cs +++ b/OpenSim/Region/Environment/Modules/AppearanceTableMapper.cs @@ -24,8 +24,7 @@ * (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; using System.Collections.Generic; using System.Text; using OpenSim.Region.Environment.Scenes; @@ -34,6 +33,7 @@ using OpenSim.Framework.Data.Base; namespace OpenSim.Region.Environment.Modules { + /* public class AppearanceRowMapper : BaseRowMapper { public AppearanceRowMapper(BaseSchema schema, AvatarAppearance obj) @@ -239,4 +239,5 @@ namespace OpenSim.Region.Environment.Modules } } } -} + +}*/ diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs index da33726..6758d41 100644 --- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs +++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* using System; using System.Collections.Generic; using System.Threading; @@ -39,6 +40,7 @@ using OpenSim.Framework.Data.Base; namespace OpenSim.Region.Environment.Modules { + /* public class AvatarFactoryModule : IAvatarFactory { private Scene m_scene = null; @@ -334,4 +336,4 @@ namespace OpenSim.Region.Environment.Modules return visualParams; } } -} +}*/ diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index f02f038..6644299 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1461,7 +1461,7 @@ namespace OpenSim.Region.Environment.Scenes m_log.Warn("[AVATAR DEBUGGING]: Couldn't fetch avatar appearance from factory, please report this to the opensim mantis"); byte[] visualParams; AvatarWearable[] wearables; - AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams); + GetDefaultAvatarAppearance(out wearables, out visualParams); appearance = new AvatarAppearance(client.AgentId, wearables, visualParams); } } @@ -2723,5 +2723,25 @@ namespace OpenSim.Region.Environment.Scenes } #endregion + + #region Avatar Appearance Default + + public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) + { + visualParams = GetDefaultVisualParams(); + wearables = AvatarWearable.DefaultWearables; + } + + private static byte[] GetDefaultVisualParams() + { + byte[] visualParams; + visualParams = new byte[218]; + for (int i = 0; i < 218; i++) + { + visualParams[i] = 100; + } + return visualParams; + } + #endregion } } -- cgit v1.1