From 7fe243e3d4a35c1250343db048539c63c5d96680 Mon Sep 17 00:00:00 2001 From: Johan Berntsson Date: Wed, 26 Mar 2008 02:49:35 +0000 Subject: Committed patch from Lulurun to fix Mantis 817. Thanks Lulurun --- .../Data.MapperFactory/DataMapperFactory.cs | 30 ++++++++++++++++++++++ .../Modules/AvatarFactory/AvatarFactoryModule.cs | 4 +-- prebuild.xml | 27 +++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 OpenSim/Framework/Data.MapperFactory/DataMapperFactory.cs diff --git a/OpenSim/Framework/Data.MapperFactory/DataMapperFactory.cs b/OpenSim/Framework/Data.MapperFactory/DataMapperFactory.cs new file mode 100644 index 0000000..f7fd4c8 --- /dev/null +++ b/OpenSim/Framework/Data.MapperFactory/DataMapperFactory.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using OpenSim.Framework; +using OpenSim.Framework.Data; +using OpenSim.Framework.Data.Base; +using OpenSim.Framework.Data.MySQLMapper; + +namespace OpenSim.Framework.Data.MapperFactory +{ + public class DataMapperFactory + { + public enum MAPPER_TYPE { + MYSQL, + }; + + public DataMapperFactory() { + + } + + static public BaseDatabaseConnector GetDataBaseMapper(MAPPER_TYPE type, string connectionString) + { + switch (type) { + case MAPPER_TYPE.MYSQL: + return new MySQLDatabaseMapper(connectionString); + default: + return null; + } + } + } +} diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs index 1f99a72..b1a138b 100644 --- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs @@ -32,10 +32,10 @@ using libsecondlife; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; -using OpenSim.Framework.Data.MySQLMapper; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using OpenSim.Framework.Data.Base; +using OpenSim.Framework.Data.MapperFactory; namespace OpenSim.Region.Modules.AvatarFactory { @@ -227,7 +227,7 @@ namespace OpenSim.Region.Modules.AvatarFactory } if (m_enablePersist) { - m_databaseMapper = new MySQLDatabaseMapper(m_connectionString); + m_databaseMapper = DataMapperFactory.GetDataBaseMapper(DataMapperFactory.MAPPER_TYPE.MYSQL, m_connectionString); m_appearanceMapper = new AppearanceTableMapper(m_databaseMapper, "AvatarAppearance"); } } diff --git a/prebuild.xml b/prebuild.xml index 96b286b..89bbf09 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -234,6 +234,32 @@ + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + @@ -845,6 +871,7 @@ + -- cgit v1.1