aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenGrid.Framework.Data.MySQL/MySQLUserData.cs27
1 files changed, 25 insertions, 2 deletions
diff --git a/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs b/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs
index 05d65cf..0741272 100644
--- a/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs
+++ b/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs
@@ -82,12 +82,35 @@ namespace OpenGrid.Framework.Data.MySQL
82 82
83 public UserAgentData getAgentByName(string user, string last) 83 public UserAgentData getAgentByName(string user, string last)
84 { 84 {
85 return new UserAgentData(); 85 UserProfileData profile = getUserByName(user, last);
86 return getAgentByUUID(profile.UUID);
86 } 87 }
87 88
88 public UserAgentData getAgentByUUID(LLUUID uuid) 89 public UserAgentData getAgentByUUID(LLUUID uuid)
89 { 90 {
90 return new UserAgentData(); 91 try
92 {
93 lock (database)
94 {
95 Dictionary<string, string> param = new Dictionary<string, string>();
96 param["?uuid"] = uuid.ToStringHyphenated();
97
98 System.Data.IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param);
99 System.Data.IDataReader reader = result.ExecuteReader();
100
101 UserAgentData row = database.getAgentRow(reader);
102
103 reader.Close();
104 result.Dispose();
105
106 return row;
107 }
108 }
109 catch (Exception e)
110 {
111 Console.WriteLine(e.ToString());
112 return null;
113 }
91 } 114 }
92 115
93 public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount) 116 public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)