diff options
author | John Hurliman | 2009-10-06 12:15:24 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-06 12:15:24 -0700 |
commit | fa6027aa09190ce50cfabcd3092836f21c99228c (patch) | |
tree | e0ee78f308c1933f6d3aa9c6e80c2fcf4a75d6a2 /OpenSim/Data/MySQL/MySQLUserAccountData.cs | |
parent | * Added missing references to prebuild.xml and commented out the LindenUDP te... (diff) | |
parent | * Removed verbose debug message (diff) | |
download | opensim-SC_OLD-fa6027aa09190ce50cfabcd3092836f21c99228c.zip opensim-SC_OLD-fa6027aa09190ce50cfabcd3092836f21c99228c.tar.gz opensim-SC_OLD-fa6027aa09190ce50cfabcd3092836f21c99228c.tar.bz2 opensim-SC_OLD-fa6027aa09190ce50cfabcd3092836f21c99228c.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into htb-throttle
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLUserAccountData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserAccountData.cs | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs index 38a6f55..0bbc3f5 100644 --- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs +++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs | |||
@@ -64,48 +64,46 @@ namespace OpenSim.Data.MySQL | |||
64 | if (scopeID != UUID.Zero) | 64 | if (scopeID != UUID.Zero) |
65 | command += " and ScopeID = ?scopeID"; | 65 | command += " and ScopeID = ?scopeID"; |
66 | 66 | ||
67 | using (MySqlCommand cmd = new MySqlCommand(command)) | 67 | MySqlCommand cmd = new MySqlCommand(command); |
68 | |||
69 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); | ||
70 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | ||
71 | |||
72 | IDataReader result = ExecuteReader(cmd); | ||
73 | |||
74 | if (result.Read()) | ||
68 | { | 75 | { |
69 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); | 76 | ret.PrincipalID = principalID; |
70 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | 77 | UUID scope; |
78 | UUID.TryParse(result["ScopeID"].ToString(), out scope); | ||
79 | ret.ScopeID = scope; | ||
71 | 80 | ||
72 | using (IDataReader result = ExecuteReader(cmd)) | 81 | if (m_ColumnNames == null) |
73 | { | 82 | { |
74 | if (result.Read()) | 83 | m_ColumnNames = new List<string>(); |
75 | { | 84 | |
76 | ret.PrincipalID = principalID; | 85 | DataTable schemaTable = result.GetSchemaTable(); |
77 | UUID scope; | 86 | foreach (DataRow row in schemaTable.Rows) |
78 | UUID.TryParse(result["ScopeID"].ToString(), out scope); | 87 | m_ColumnNames.Add(row["ColumnName"].ToString()); |
79 | ret.ScopeID = scope; | ||
80 | |||
81 | if (m_ColumnNames == null) | ||
82 | { | ||
83 | m_ColumnNames = new List<string>(); | ||
84 | |||
85 | DataTable schemaTable = result.GetSchemaTable(); | ||
86 | foreach (DataRow row in schemaTable.Rows) | ||
87 | m_ColumnNames.Add(row["ColumnName"].ToString()); | ||
88 | } | ||
89 | |||
90 | foreach (string s in m_ColumnNames) | ||
91 | { | ||
92 | if (s == "UUID") | ||
93 | continue; | ||
94 | if (s == "ScopeID") | ||
95 | continue; | ||
96 | |||
97 | ret.Data[s] = result[s].ToString(); | ||
98 | } | ||
99 | |||
100 | CloseDBConnection(cmd); | ||
101 | return ret; | ||
102 | } | ||
103 | else | ||
104 | { | ||
105 | CloseDBConnection(cmd); | ||
106 | return null; | ||
107 | } | ||
108 | } | 88 | } |
89 | |||
90 | foreach (string s in m_ColumnNames) | ||
91 | { | ||
92 | if (s == "UUID") | ||
93 | continue; | ||
94 | if (s == "ScopeID") | ||
95 | continue; | ||
96 | |||
97 | ret.Data[s] = result[s].ToString(); | ||
98 | } | ||
99 | |||
100 | CloseDBConnection(result, cmd); | ||
101 | return ret; | ||
102 | } | ||
103 | else | ||
104 | { | ||
105 | CloseDBConnection(result, cmd); | ||
106 | return null; | ||
109 | } | 107 | } |
110 | } | 108 | } |
111 | 109 | ||