Committed patch from Lulurun to fix Mantis 817. Thanks Lulurun

0.6.0-stable
Johan Berntsson 2008-03-26 02:49:35 +00:00
parent 7f5e1546e2
commit 7fe243e3d4
3 changed files with 59 additions and 2 deletions

View File

@ -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;
}
}
}
}

View File

@ -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");
}
}

View File

@ -234,6 +234,32 @@
</Files>
</Project>
<Project name="OpenSim.Framework.Data.MapperFactory" path="OpenSim/Framework/Data.MapperFactory" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../../../bin/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../../../bin/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../../../bin/</ReferencePath>
<Reference name="System" localCopy="false"/>
<Reference name="System.Xml"/>
<Reference name="System.Data"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Data"/>
<Reference name="OpenSim.Framework.Data.Base"/>
<Reference name="OpenSim.Framework.Data.MySQLMapper"/>
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project name="OpenSim.Framework.Configuration.XML" path="OpenSim/Framework/Configuration/XML" type="Library">
<Configuration name="Debug">
<Options>
@ -845,6 +871,7 @@
<Reference name="OpenSim.Framework.Communications"/>
<Reference name="OpenSim.Framework.Data.Base" />
<Reference name="OpenSim.Region.Environment"/>
<Reference name="OpenSim.Framework.Data.MapperFactory"/>
<Reference name="Nini.dll" />
<Reference name="OpenSim.Framework.Data.MySQLMapper" />
<Files>