Small fix (2/2)

zircon^2
Adam Frisby 2007-05-20 14:33:53 +00:00
parent 67b3f66648
commit b8c4e744f9
2 changed files with 26 additions and 3 deletions

View File

@ -82,12 +82,35 @@ namespace OpenGrid.Framework.Data.MySQL
public UserAgentData getAgentByName(string user, string last)
{
return new UserAgentData();
UserProfileData profile = getUserByName(user, last);
return getAgentByUUID(profile.UUID);
}
public UserAgentData getAgentByUUID(LLUUID uuid)
{
return new UserAgentData();
try
{
lock (database)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["?uuid"] = uuid.ToStringHyphenated();
System.Data.IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
UserAgentData row = database.getAgentRow(reader);
reader.Close();
result.Dispose();
return row;
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return null;
}
}
public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)

View File

@ -38,7 +38,7 @@ namespace OpenGrid.Framework.Data
public class UserAgentData
{
public LLUUID UUID; // Internal session ID
public LLUUID UUID; // Account ID
public string agentIP; // The IP of the agent
public uint agentPort; // The port of the agent
public bool agentOnline; // The online status of the agent