From 89a6d6bab7bfc138c60eef7de18fc40c7365a81d Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 4 May 2007 04:11:59 +0000 Subject: I dub thee working. Maybe. --- OpenGrid.Framework.Data.MySQL/MySQLGridData.cs | 4 +++- OpenGrid.Framework.Data.MySQL/MySQLManager.cs | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'OpenGrid.Framework.Data.MySQL') diff --git a/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs b/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs index 7a78800..2ea2db4 100644 --- a/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs +++ b/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs @@ -48,7 +48,9 @@ namespace OpenGrid.Framework.Data.MySQL if (throwHissyFit) throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); - return true; + SimProfileData data = GetProfileByLLUUID(uuid); + + return (handle == data.regionHandle && authkey == data.regionSecret); } /// diff --git a/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGrid.Framework.Data.MySQL/MySQLManager.cs index ec69549..0147b5b 100644 --- a/OpenGrid.Framework.Data.MySQL/MySQLManager.cs +++ b/OpenGrid.Framework.Data.MySQL/MySQLManager.cs @@ -85,10 +85,10 @@ namespace OpenGrid.Framework.Data.MySQL // Region Server retval.regionDataURI = (string)reader["regionDataURI"]; - retval.regionOnline = false; - retval.serverIP = ""; - retval.serverPort = 0; - retval.serverURI = ""; + retval.regionOnline = false; // Needs to be pinged before this can be set. + retval.serverIP = (string)reader["serverIP"]; + retval.serverPort = (uint)reader["serverPort"]; + retval.serverURI = (string)reader["serverURI"]; // Location retval.regionLocX = (uint)((int)reader["locX"]); @@ -103,7 +103,7 @@ namespace OpenGrid.Framework.Data.MySQL } else { - return null; + throw new Exception("No rows to return"); } return retval; } -- cgit v1.1