Committed patch from Lulurun to fix Mantis 817. Thanks Lulurun
parent
7f5e1546e2
commit
7fe243e3d4
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,10 +32,10 @@ using libsecondlife;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Framework.Data.MySQLMapper;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
using OpenSim.Framework.Data.Base;
|
using OpenSim.Framework.Data.Base;
|
||||||
|
using OpenSim.Framework.Data.MapperFactory;
|
||||||
|
|
||||||
namespace OpenSim.Region.Modules.AvatarFactory
|
namespace OpenSim.Region.Modules.AvatarFactory
|
||||||
{
|
{
|
||||||
|
@ -227,7 +227,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
|
||||||
}
|
}
|
||||||
if (m_enablePersist)
|
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");
|
m_appearanceMapper = new AppearanceTableMapper(m_databaseMapper, "AvatarAppearance");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
27
prebuild.xml
27
prebuild.xml
|
@ -234,6 +234,32 @@
|
||||||
</Files>
|
</Files>
|
||||||
</Project>
|
</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">
|
<Project name="OpenSim.Framework.Configuration.XML" path="OpenSim/Framework/Configuration/XML" type="Library">
|
||||||
<Configuration name="Debug">
|
<Configuration name="Debug">
|
||||||
<Options>
|
<Options>
|
||||||
|
@ -845,6 +871,7 @@
|
||||||
<Reference name="OpenSim.Framework.Communications"/>
|
<Reference name="OpenSim.Framework.Communications"/>
|
||||||
<Reference name="OpenSim.Framework.Data.Base" />
|
<Reference name="OpenSim.Framework.Data.Base" />
|
||||||
<Reference name="OpenSim.Region.Environment"/>
|
<Reference name="OpenSim.Region.Environment"/>
|
||||||
|
<Reference name="OpenSim.Framework.Data.MapperFactory"/>
|
||||||
<Reference name="Nini.dll" />
|
<Reference name="Nini.dll" />
|
||||||
<Reference name="OpenSim.Framework.Data.MySQLMapper" />
|
<Reference name="OpenSim.Framework.Data.MySQLMapper" />
|
||||||
<Files>
|
<Files>
|
||||||
|
|
Loading…
Reference in New Issue