aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.Base
diff options
context:
space:
mode:
authorlbsa712008-04-02 13:06:18 +0000
committerlbsa712008-04-02 13:06:18 +0000
commit667ebc8ea29ba93060eee2506f2875ab78ab6216 (patch)
treed630c9c98fdbbe901b4d941dff25e6bdc77d4772 /OpenSim/Framework/Data.Base
parentSet default terrain to complete flat terrain (at 26 height). Even flat terrai... (diff)
downloadopensim-SC_OLD-667ebc8ea29ba93060eee2506f2875ab78ab6216.zip
opensim-SC_OLD-667ebc8ea29ba93060eee2506f2875ab78ab6216.tar.gz
opensim-SC_OLD-667ebc8ea29ba93060eee2506f2875ab78ab6216.tar.bz2
opensim-SC_OLD-667ebc8ea29ba93060eee2506f2875ab78ab6216.tar.xz
* Reworked Data Framework so that MSSQL works
* Introduced uint as field type * Removed what should be superfluous Guid handling * Introduced stub MySQLDataReader if we need to fix the Guid handling anyway
Diffstat (limited to 'OpenSim/Framework/Data.Base')
-rw-r--r--OpenSim/Framework/Data.Base/BaseDataReader.cs33
-rw-r--r--OpenSim/Framework/Data.Base/BaseFieldMapper.cs4
2 files changed, 26 insertions, 11 deletions
diff --git a/OpenSim/Framework/Data.Base/BaseDataReader.cs b/OpenSim/Framework/Data.Base/BaseDataReader.cs
index cbaac55..3baefcd 100644
--- a/OpenSim/Framework/Data.Base/BaseDataReader.cs
+++ b/OpenSim/Framework/Data.Base/BaseDataReader.cs
@@ -31,7 +31,7 @@ using System.IO;
31 31
32namespace OpenSim.Framework.Data.Base 32namespace OpenSim.Framework.Data.Base
33{ 33{
34 public class BaseDataReader 34 public abstract class BaseDataReader
35 { 35 {
36 private readonly IDataReader m_source; 36 private readonly IDataReader m_source;
37 37
@@ -112,17 +112,28 @@ namespace OpenSim.Framework.Data.Base
112 return m_source.Read(); 112 return m_source.Read();
113 } 113 }
114 114
115 public Guid GetGuid(string name) 115 public virtual Guid GetGuid(string name)
116 { 116 {
117 string guidString = GetString(name); 117 return m_source.GetGuid(m_source.GetOrdinal(name));
118 if (String.IsNullOrEmpty(guidString)) 118 }
119 { 119
120 return Guid.Empty; 120 public UInt32 GetUInt32(string name )
121 } 121 {
122 else 122 return (UInt32)GetInt32(name);
123 { 123 }
124 return new Guid(guidString); 124
125 } 125 private Int32 GetInt32(string name)
126 {
127 int ordinal = m_source.GetOrdinal(name);
128 int int32 = m_source.GetInt32(ordinal);
129 return int32;
130 }
131
132 public Int64 GetInt64(string name)
133 {
134 int ordinal = m_source.GetOrdinal( name );
135 long int64 = m_source.GetInt64(ordinal);
136 return int64;
126 } 137 }
127 } 138 }
128} 139}
diff --git a/OpenSim/Framework/Data.Base/BaseFieldMapper.cs b/OpenSim/Framework/Data.Base/BaseFieldMapper.cs
index ade9266..03c7bfb 100644
--- a/OpenSim/Framework/Data.Base/BaseFieldMapper.cs
+++ b/OpenSim/Framework/Data.Base/BaseFieldMapper.cs
@@ -108,6 +108,10 @@ namespace OpenSim.Framework.Data.Base
108 { 108 {
109 value = reader.GetUShort(m_fieldName); 109 value = reader.GetUShort(m_fieldName);
110 } 110 }
111 else if (ValueType == typeof(uint))
112 {
113 value = reader.GetUInt32(m_fieldName);
114 }
111 else if (ValueType == typeof(byte[])) 115 else if (ValueType == typeof(byte[]))
112 { 116 {
113 value = reader.GetBytes(m_fieldName); 117 value = reader.GetBytes(m_fieldName);