Small fix (2/2)
parent
67b3f66648
commit
b8c4e744f9
|
@ -82,12 +82,35 @@ namespace OpenGrid.Framework.Data.MySQL
|
||||||
|
|
||||||
public UserAgentData getAgentByName(string user, string last)
|
public UserAgentData getAgentByName(string user, string last)
|
||||||
{
|
{
|
||||||
return new UserAgentData();
|
UserProfileData profile = getUserByName(user, last);
|
||||||
|
return getAgentByUUID(profile.UUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserAgentData getAgentByUUID(LLUUID 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)
|
public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace OpenGrid.Framework.Data
|
||||||
|
|
||||||
public class UserAgentData
|
public class UserAgentData
|
||||||
{
|
{
|
||||||
public LLUUID UUID; // Internal session ID
|
public LLUUID UUID; // Account ID
|
||||||
public string agentIP; // The IP of the agent
|
public string agentIP; // The IP of the agent
|
||||||
public uint agentPort; // The port of the agent
|
public uint agentPort; // The port of the agent
|
||||||
public bool agentOnline; // The online status of the agent
|
public bool agentOnline; // The online status of the agent
|
||||||
|
|
Loading…
Reference in New Issue