diff options
author | lbsa71 | 2007-07-03 14:37:29 +0000 |
---|---|---|
committer | lbsa71 | 2007-07-03 14:37:29 +0000 |
commit | 9b6b6d05d45cf0f754a0b26bf6240ef50be66563 (patch) | |
tree | 8d72120aac2184c5ed4c5ab5f6b673ef496a0803 /OpenSim/Framework/Data.MSSQL | |
parent | * Completed conceptual LlsdMethod - everything resides in SimpleApp pending g... (diff) | |
download | opensim-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.cs | 22 | ||||
-rw-r--r-- | OpenSim/Framework/Data.MSSQL/MSSQLManager.cs | 7 | ||||
-rw-r--r-- | OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs | 2 |
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 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | ||
31 | using System.Security.Cryptography; | ||
30 | using System.Text; | 32 | using System.Text; |
31 | using OpenSim.Framework.Data; | 33 | using libsecondlife; |
32 | 34 | ||
33 | namespace OpenSim.Framework.Data.MSSQL | 35 | namespace 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 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Text; | ||
31 | using System.Data; | 30 | using System.Data; |
32 | |||
33 | using System.Data.SqlClient; | 31 | using System.Data.SqlClient; |
34 | 32 | using libsecondlife; | |
35 | using OpenSim.Framework.Data; | ||
36 | 33 | ||
37 | namespace OpenSim.Framework.Data.MSSQL | 34 | namespace 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 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | 2 | using 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. |