Semi-functional (in theory!)

0.1-prestable
Adam Frisby 2007-05-04 03:52:53 +00:00
parent 10f75f936e
commit 32ac9530a9
3 changed files with 33 additions and 4 deletions

View File

@ -15,15 +15,40 @@ namespace OpenGrid.Framework.Data.MySQL
} }
public SimProfileData GetProfileByHandle(ulong handle) public SimProfileData GetProfileByHandle(ulong handle)
{ {
return new SimProfileData(); 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();
SimProfileData row = database.getRow( reader );
reader.Close();
result.Dispose();
return row;
} }
public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid) public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid)
{ {
return new SimProfileData(); 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();
SimProfileData row = database.getRow(reader);
reader.Close();
result.Dispose();
return row;
} }
public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey) public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey)
{ {
bool throwHissyFit = false; // Should be true by 1.0
if (throwHissyFit)
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
return true;
} }
/// <summary> /// <summary>

View File

@ -9,6 +9,8 @@ using MySql.Data;
using MySql.Data.Types; using MySql.Data.Types;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using OpenGrid.Framework.Data;
namespace OpenGrid.Framework.Data.MySQL namespace OpenGrid.Framework.Data.MySQL
{ {
class MySQLManager class MySQLManager
@ -71,7 +73,8 @@ namespace OpenGrid.Framework.Data.MySQL
if (reader.Read()) if (reader.Read())
{ {
//retval.regionDataURI = reader["regionDataURI"]; retval.regionLocX = (uint)reader["locX"];
retval.regionDataURI = (string)reader["regionDataURI"];
} }
else else

View File

@ -40,6 +40,7 @@
<Compile Include="GridData.cs" /> <Compile Include="GridData.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SimProfileData.cs" /> <Compile Include="SimProfileData.cs" />
<Compile Include="UserProfileData.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.