* Optimized usings (the 'LL ate my scripts' commit)

* added some licensing info
This commit is contained in:
lbsa71
2007-07-03 14:37:29 +00:00
parent 73a5ec391a
commit 9b6b6d05d4
184 changed files with 705 additions and 1207 deletions

View File

@@ -27,8 +27,10 @@
*/
using System;
using System.Collections.Generic;
using System.Data;
using System.Security.Cryptography;
using System.Text;
using OpenSim.Framework.Data;
using libsecondlife;
namespace OpenSim.Framework.Data.SQLite
{
@@ -99,8 +101,8 @@ namespace OpenSim.Framework.Data.SQLite
Dictionary<string, string> param = new Dictionary<string, string>();
param["handle"] = handle.ToString();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
System.Data.IDataReader reader = result.ExecuteReader();
IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getRow(reader);
reader.Close();
@@ -114,13 +116,13 @@ namespace OpenSim.Framework.Data.SQLite
/// </summary>
/// <param name="uuid">The region UUID</param>
/// <returns>The sim profile</returns>
public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid)
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["uuid"] = uuid.ToStringHyphenated();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getRow(reader);
reader.Close();
@@ -153,7 +155,7 @@ namespace OpenSim.Framework.Data.SQLite
/// <param name="handle">The attempted regionHandle of the challenger</param>
/// <param name="authkey">The secret</param>
/// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey)
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey)
{
bool throwHissyFit = false; // Should be true by 1.0
@@ -174,10 +176,10 @@ namespace OpenSim.Framework.Data.SQLite
/// <param name="authhash"></param>
/// <param name="challenge"></param>
/// <returns></returns>
public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge)
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
{
System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed();
System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding();
SHA512Managed HashProvider = new SHA512Managed();
ASCIIEncoding TextProvider = new ASCIIEncoding();
byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
byte[] hash = HashProvider.ComputeHash(stream);