aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MSSQL
diff options
context:
space:
mode:
authorlbsa712007-07-03 14:37:29 +0000
committerlbsa712007-07-03 14:37:29 +0000
commit9b6b6d05d45cf0f754a0b26bf6240ef50be66563 (patch)
tree8d72120aac2184c5ed4c5ab5f6b673ef496a0803 /OpenSim/Framework/Data.MSSQL
parent* Completed conceptual LlsdMethod - everything resides in SimpleApp pending g... (diff)
downloadopensim-SC_OLD-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.zip
opensim-SC_OLD-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.tar.gz
opensim-SC_OLD-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.tar.bz2
opensim-SC_OLD-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.tar.xz
* Optimized usings (the 'LL ate my scripts' commit)
* added some licensing info
Diffstat (limited to 'OpenSim/Framework/Data.MSSQL')
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs22
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLManager.cs7
-rw-r--r--OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs2
3 files changed, 14 insertions, 17 deletions
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
index 5bdceaf..ca9196a5 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
@@ -27,8 +27,10 @@
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Data;
31using System.Security.Cryptography;
30using System.Text; 32using System.Text;
31using OpenSim.Framework.Data; 33using libsecondlife;
32 34
33namespace OpenSim.Framework.Data.MSSQL 35namespace OpenSim.Framework.Data.MSSQL
34{ 36{
@@ -99,8 +101,8 @@ namespace OpenSim.Framework.Data.MSSQL
99 Dictionary<string, string> param = new Dictionary<string, string>(); 101 Dictionary<string, string> param = new Dictionary<string, string>();
100 param["handle"] = handle.ToString(); 102 param["handle"] = handle.ToString();
101 103
102 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param); 104 IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
103 System.Data.IDataReader reader = result.ExecuteReader(); 105 IDataReader reader = result.ExecuteReader();
104 106
105 SimProfileData row = database.getRow(reader); 107 SimProfileData row = database.getRow(reader);
106 reader.Close(); 108 reader.Close();
@@ -114,13 +116,13 @@ namespace OpenSim.Framework.Data.MSSQL
114 /// </summary> 116 /// </summary>
115 /// <param name="uuid">The region UUID</param> 117 /// <param name="uuid">The region UUID</param>
116 /// <returns>The sim profile</returns> 118 /// <returns>The sim profile</returns>
117 public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid) 119 public SimProfileData GetProfileByLLUUID(LLUUID uuid)
118 { 120 {
119 Dictionary<string, string> param = new Dictionary<string, string>(); 121 Dictionary<string, string> param = new Dictionary<string, string>();
120 param["uuid"] = uuid.ToStringHyphenated(); 122 param["uuid"] = uuid.ToStringHyphenated();
121 123
122 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); 124 IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
123 System.Data.IDataReader reader = result.ExecuteReader(); 125 IDataReader reader = result.ExecuteReader();
124 126
125 SimProfileData row = database.getRow(reader); 127 SimProfileData row = database.getRow(reader);
126 reader.Close(); 128 reader.Close();
@@ -153,7 +155,7 @@ namespace OpenSim.Framework.Data.MSSQL
153 /// <param name="handle">The attempted regionHandle of the challenger</param> 155 /// <param name="handle">The attempted regionHandle of the challenger</param>
154 /// <param name="authkey">The secret</param> 156 /// <param name="authkey">The secret</param>
155 /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns> 157 /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
156 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey) 158 public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey)
157 { 159 {
158 bool throwHissyFit = false; // Should be true by 1.0 160 bool throwHissyFit = false; // Should be true by 1.0
159 161
@@ -174,10 +176,10 @@ namespace OpenSim.Framework.Data.MSSQL
174 /// <param name="authhash"></param> 176 /// <param name="authhash"></param>
175 /// <param name="challenge"></param> 177 /// <param name="challenge"></param>
176 /// <returns></returns> 178 /// <returns></returns>
177 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge) 179 public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
178 { 180 {
179 System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed(); 181 SHA512Managed HashProvider = new SHA512Managed();
180 System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding(); 182 ASCIIEncoding TextProvider = new ASCIIEncoding();
181 183
182 byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); 184 byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
183 byte[] hash = HashProvider.ComputeHash(stream); 185 byte[] hash = HashProvider.ComputeHash(stream);
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
index 3c83c1f..49bf31c 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
@@ -27,12 +27,9 @@
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text;
31using System.Data; 30using System.Data;
32
33using System.Data.SqlClient; 31using System.Data.SqlClient;
34 32using libsecondlife;
35using OpenSim.Framework.Data;
36 33
37namespace OpenSim.Framework.Data.MSSQL 34namespace OpenSim.Framework.Data.MSSQL
38{ 35{
@@ -110,7 +107,7 @@ namespace OpenSim.Framework.Data.MSSQL
110 // Region Main 107 // Region Main
111 regionprofile.regionHandle = (ulong)reader["regionHandle"]; 108 regionprofile.regionHandle = (ulong)reader["regionHandle"];
112 regionprofile.regionName = (string)reader["regionName"]; 109 regionprofile.regionName = (string)reader["regionName"];
113 regionprofile.UUID = new libsecondlife.LLUUID((string)reader["uuid"]); 110 regionprofile.UUID = new LLUUID((string)reader["uuid"]);
114 111
115 // Secrets 112 // Secrets
116 regionprofile.regionRecvKey = (string)reader["regionRecvKey"]; 113 regionprofile.regionRecvKey = (string)reader["regionRecvKey"];
diff --git a/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs b/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs
index af310e8..066c739 100644
--- a/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs
+++ b/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs
@@ -1,7 +1,5 @@
1using System.Reflection; 1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices; 2using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following 3// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information 4// set of attributes. Change these attribute values to modify the information
7// associated with an assembly. 5// associated with an assembly.