aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJohan Berntsson2008-03-26 02:49:35 +0000
committerJohan Berntsson2008-03-26 02:49:35 +0000
commit7fe243e3d4a35c1250343db048539c63c5d96680 (patch)
treee18a10e1ea8b7ef3ee630c9654eb2233d19c9b29
parentRemoving redundant code (diff)
downloadopensim-SC_OLD-7fe243e3d4a35c1250343db048539c63c5d96680.zip
opensim-SC_OLD-7fe243e3d4a35c1250343db048539c63c5d96680.tar.gz
opensim-SC_OLD-7fe243e3d4a35c1250343db048539c63c5d96680.tar.bz2
opensim-SC_OLD-7fe243e3d4a35c1250343db048539c63c5d96680.tar.xz
Committed patch from Lulurun to fix Mantis 817. Thanks Lulurun
-rw-r--r--OpenSim/Framework/Data.MapperFactory/DataMapperFactory.cs30
-rw-r--r--OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs4
-rw-r--r--prebuild.xml27
3 files changed, 59 insertions, 2 deletions
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 @@
1using System;
2using System.Collections.Generic;
3using OpenSim.Framework;
4using OpenSim.Framework.Data;
5using OpenSim.Framework.Data.Base;
6using OpenSim.Framework.Data.MySQLMapper;
7
8namespace OpenSim.Framework.Data.MapperFactory
9{
10 public class DataMapperFactory
11 {
12 public enum MAPPER_TYPE {
13 MYSQL,
14 };
15
16 public DataMapperFactory() {
17
18 }
19
20 static public BaseDatabaseConnector GetDataBaseMapper(MAPPER_TYPE type, string connectionString)
21 {
22 switch (type) {
23 case MAPPER_TYPE.MYSQL:
24 return new MySQLDatabaseMapper(connectionString);
25 default:
26 return null;
27 }
28 }
29 }
30}
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;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Communications.Cache; 34using OpenSim.Framework.Communications.Cache;
35using OpenSim.Framework.Data.MySQLMapper;
36using OpenSim.Region.Environment.Interfaces; 35using OpenSim.Region.Environment.Interfaces;
37using OpenSim.Region.Environment.Scenes; 36using OpenSim.Region.Environment.Scenes;
38using OpenSim.Framework.Data.Base; 37using OpenSim.Framework.Data.Base;
38using OpenSim.Framework.Data.MapperFactory;
39 39
40namespace OpenSim.Region.Modules.AvatarFactory 40namespace OpenSim.Region.Modules.AvatarFactory
41{ 41{
@@ -227,7 +227,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
227 } 227 }
228 if (m_enablePersist) 228 if (m_enablePersist)
229 { 229 {
230 m_databaseMapper = new MySQLDatabaseMapper(m_connectionString); 230 m_databaseMapper = DataMapperFactory.GetDataBaseMapper(DataMapperFactory.MAPPER_TYPE.MYSQL, m_connectionString);
231 m_appearanceMapper = new AppearanceTableMapper(m_databaseMapper, "AvatarAppearance"); 231 m_appearanceMapper = new AppearanceTableMapper(m_databaseMapper, "AvatarAppearance");
232 } 232 }
233 } 233 }
diff --git a/prebuild.xml b/prebuild.xml
index 96b286b..89bbf09 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -234,6 +234,32 @@
234 </Files> 234 </Files>
235 </Project> 235 </Project>
236 236
237 <Project name="OpenSim.Framework.Data.MapperFactory" path="OpenSim/Framework/Data.MapperFactory" type="Library">
238 <Configuration name="Debug">
239 <Options>
240 <OutputPath>../../../bin/</OutputPath>
241 </Options>
242 </Configuration>
243 <Configuration name="Release">
244 <Options>
245 <OutputPath>../../../bin/</OutputPath>
246 </Options>
247 </Configuration>
248
249 <ReferencePath>../../../bin/</ReferencePath>
250 <Reference name="System" localCopy="false"/>
251 <Reference name="System.Xml"/>
252 <Reference name="System.Data"/>
253 <Reference name="OpenSim.Framework"/>
254 <Reference name="OpenSim.Framework.Data"/>
255 <Reference name="OpenSim.Framework.Data.Base"/>
256 <Reference name="OpenSim.Framework.Data.MySQLMapper"/>
257
258 <Files>
259 <Match pattern="*.cs" recurse="true"/>
260 </Files>
261 </Project>
262
237 <Project name="OpenSim.Framework.Configuration.XML" path="OpenSim/Framework/Configuration/XML" type="Library"> 263 <Project name="OpenSim.Framework.Configuration.XML" path="OpenSim/Framework/Configuration/XML" type="Library">
238 <Configuration name="Debug"> 264 <Configuration name="Debug">
239 <Options> 265 <Options>
@@ -845,6 +871,7 @@
845 <Reference name="OpenSim.Framework.Communications"/> 871 <Reference name="OpenSim.Framework.Communications"/>
846 <Reference name="OpenSim.Framework.Data.Base" /> 872 <Reference name="OpenSim.Framework.Data.Base" />
847 <Reference name="OpenSim.Region.Environment"/> 873 <Reference name="OpenSim.Region.Environment"/>
874 <Reference name="OpenSim.Framework.Data.MapperFactory"/>
848 <Reference name="Nini.dll" /> 875 <Reference name="Nini.dll" />
849 <Reference name="OpenSim.Framework.Data.MySQLMapper" /> 876 <Reference name="OpenSim.Framework.Data.MySQLMapper" />
850 <Files> 877 <Files>