diff options
author | Johan Berntsson | 2008-03-26 02:49:35 +0000 |
---|---|---|
committer | Johan Berntsson | 2008-03-26 02:49:35 +0000 |
commit | 7fe243e3d4a35c1250343db048539c63c5d96680 (patch) | |
tree | e18a10e1ea8b7ef3ee630c9654eb2233d19c9b29 /OpenSim | |
parent | Removing redundant code (diff) | |
download | opensim-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
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Data.MapperFactory/DataMapperFactory.cs | 30 | ||||
-rw-r--r-- | OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs | 4 |
2 files changed, 32 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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using OpenSim.Framework; | ||
4 | using OpenSim.Framework.Data; | ||
5 | using OpenSim.Framework.Data.Base; | ||
6 | using OpenSim.Framework.Data.MySQLMapper; | ||
7 | |||
8 | namespace 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; | |||
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications.Cache; | 34 | using OpenSim.Framework.Communications.Cache; |
35 | using OpenSim.Framework.Data.MySQLMapper; | ||
36 | using OpenSim.Region.Environment.Interfaces; | 35 | using OpenSim.Region.Environment.Interfaces; |
37 | using OpenSim.Region.Environment.Scenes; | 36 | using OpenSim.Region.Environment.Scenes; |
38 | using OpenSim.Framework.Data.Base; | 37 | using OpenSim.Framework.Data.Base; |
38 | using OpenSim.Framework.Data.MapperFactory; | ||
39 | 39 | ||
40 | namespace OpenSim.Region.Modules.AvatarFactory | 40 | namespace 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 | } |