From 32ac9530a940f8a15fa3f9eab40114473c18d3e6 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 4 May 2007 03:52:53 +0000 Subject: Semi-functional (in theory!) --- OpenGrid.Framework.Data.MySQL/MySQLGridData.cs | 31 +++++++++++++++++++--- OpenGrid.Framework.Data.MySQL/MySQLManager.cs | 5 +++- .../OpenGrid.Framework.Data.csproj | 1 + 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs b/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs index 65a0fff..7a78800 100644 --- a/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs +++ b/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs @@ -15,15 +15,40 @@ namespace OpenGrid.Framework.Data.MySQL } public SimProfileData GetProfileByHandle(ulong handle) { - return new SimProfileData(); + Dictionary param = new Dictionary(); + param["handle"] = handle.ToString(); + + System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param); + System.Data.IDataReader reader = result.ExecuteReader(); + + SimProfileData row = database.getRow( reader ); + reader.Close(); + result.Dispose(); + + return row; } public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid) { - return new SimProfileData(); + Dictionary param = new Dictionary(); + param["uuid"] = uuid.ToStringHyphenated(); + + System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); + System.Data.IDataReader reader = result.ExecuteReader(); + + SimProfileData row = database.getRow(reader); + reader.Close(); + result.Dispose(); + + return row; } public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey) { - throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); + bool throwHissyFit = false; // Should be true by 1.0 + + if (throwHissyFit) + throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); + + return true; } /// diff --git a/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGrid.Framework.Data.MySQL/MySQLManager.cs index 30ad314..1d912e7 100644 --- a/OpenGrid.Framework.Data.MySQL/MySQLManager.cs +++ b/OpenGrid.Framework.Data.MySQL/MySQLManager.cs @@ -9,6 +9,8 @@ using MySql.Data; using MySql.Data.Types; using MySql.Data.MySqlClient; +using OpenGrid.Framework.Data; + namespace OpenGrid.Framework.Data.MySQL { class MySQLManager @@ -71,7 +73,8 @@ namespace OpenGrid.Framework.Data.MySQL if (reader.Read()) { - //retval.regionDataURI = reader["regionDataURI"]; + retval.regionLocX = (uint)reader["locX"]; + retval.regionDataURI = (string)reader["regionDataURI"]; } else diff --git a/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj b/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj index 2be7ea9..c4a3e28 100644 --- a/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj +++ b/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj @@ -40,6 +40,7 @@ +