diff options
Diffstat (limited to '')
-rw-r--r-- | OpenGrid.Framework.Data.MySQL/MySQLUserData.cs | 27 | ||||
-rw-r--r-- | OpenGrid.Framework.Data/UserProfileData.cs | 2 |
2 files changed, 26 insertions, 3 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) |
diff --git a/OpenGrid.Framework.Data/UserProfileData.cs b/OpenGrid.Framework.Data/UserProfileData.cs index ec89107..3f42762 100644 --- a/OpenGrid.Framework.Data/UserProfileData.cs +++ b/OpenGrid.Framework.Data/UserProfileData.cs | |||
@@ -38,7 +38,7 @@ namespace OpenGrid.Framework.Data | |||
38 | 38 | ||
39 | public class UserAgentData | 39 | public class UserAgentData |
40 | { | 40 | { |
41 | public LLUUID UUID; // Internal session ID | 41 | public LLUUID UUID; // Account ID |
42 | public string agentIP; // The IP of the agent | 42 | public string agentIP; // The IP of the agent |
43 | public uint agentPort; // The port of the agent | 43 | public uint agentPort; // The port of the agent |
44 | public bool agentOnline; // The online status of the agent | 44 | public bool agentOnline; // The online status of the agent |