aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-05-20 14:33:53 +0000
committerAdam Frisby2007-05-20 14:33:53 +0000
commitb8c4e744f916354b5dfbfbb108013de40eb3f4b7 (patch)
treeab314338e644e5570788145e40963b90fefad2ad /OpenGrid.Framework.Data.MySQL/MySQLUserData.cs
parentSmall fix (1/2) (diff)
downloadopensim-SC-b8c4e744f916354b5dfbfbb108013de40eb3f4b7.zip
opensim-SC-b8c4e744f916354b5dfbfbb108013de40eb3f4b7.tar.gz
opensim-SC-b8c4e744f916354b5dfbfbb108013de40eb3f4b7.tar.bz2
opensim-SC-b8c4e744f916354b5dfbfbb108013de40eb3f4b7.tar.xz
Small fix (2/2)
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)