diff options
Diffstat (limited to 'OpenSim/Data')
29 files changed, 301 insertions, 302 deletions
diff --git a/OpenSim/Data/GridDataBase.cs b/OpenSim/Data/GridDataBase.cs index 6480f84..0b56d07 100644 --- a/OpenSim/Data/GridDataBase.cs +++ b/OpenSim/Data/GridDataBase.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Data | |||
39 | public abstract DataResponse AddProfile(RegionProfileData profile); | 39 | public abstract DataResponse AddProfile(RegionProfileData profile); |
40 | public abstract ReservationData GetReservationAtPoint(uint x, uint y); | 40 | public abstract ReservationData GetReservationAtPoint(uint x, uint y); |
41 | public abstract DataResponse UpdateProfile(RegionProfileData profile); | 41 | public abstract DataResponse UpdateProfile(RegionProfileData profile); |
42 | 42 | ||
43 | public abstract void Initialise(); | 43 | public abstract void Initialise(); |
44 | public abstract void Initialise(string connect); | 44 | public abstract void Initialise(string connect); |
45 | public abstract void Dispose(); | 45 | public abstract void Dispose(); |
diff --git a/OpenSim/Data/IGridData.cs b/OpenSim/Data/IGridData.cs index 146288f..c77bbb7 100644 --- a/OpenSim/Data/IGridData.cs +++ b/OpenSim/Data/IGridData.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Data | |||
47 | /// Initialises the interface | 47 | /// Initialises the interface |
48 | /// </summary> | 48 | /// </summary> |
49 | void Initialise(string connect); | 49 | void Initialise(string connect); |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Returns a sim profile from a regionHandle | 52 | /// Returns a sim profile from a regionHandle |
53 | /// </summary> | 53 | /// </summary> |
@@ -100,7 +100,7 @@ namespace OpenSim.Data | |||
100 | 100 | ||
101 | ReservationData GetReservationAtPoint(uint x, uint y); | 101 | ReservationData GetReservationAtPoint(uint x, uint y); |
102 | } | 102 | } |
103 | 103 | ||
104 | public class GridDataInitialiser : PluginInitialiserBase | 104 | public class GridDataInitialiser : PluginInitialiserBase |
105 | { | 105 | { |
106 | private string connect; | 106 | private string connect; |
diff --git a/OpenSim/Data/ILogData.cs b/OpenSim/Data/ILogData.cs index cfbee88..e22fe06 100644 --- a/OpenSim/Data/ILogData.cs +++ b/OpenSim/Data/ILogData.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Data | |||
73 | /// </summary> | 73 | /// </summary> |
74 | void Initialise(string connect); | 74 | void Initialise(string connect); |
75 | } | 75 | } |
76 | 76 | ||
77 | public class LogDataInitialiser : PluginInitialiserBase | 77 | public class LogDataInitialiser : PluginInitialiserBase |
78 | { | 78 | { |
79 | private string connect; | 79 | private string connect; |
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 443907f..e10e3aa 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Data.MSSQL | |||
63 | database.ExecuteResourceSql("CreateAssetsTable.sql"); | 63 | database.ExecuteResourceSql("CreateAssetsTable.sql"); |
64 | return; | 64 | return; |
65 | } | 65 | } |
66 | 66 | ||
67 | } | 67 | } |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
@@ -230,7 +230,7 @@ namespace OpenSim.Data.MSSQL | |||
230 | } | 230 | } |
231 | 231 | ||
232 | /// <summary> | 232 | /// <summary> |
233 | /// Database provider version. | 233 | /// Database provider version. |
234 | /// </summary> | 234 | /// </summary> |
235 | override public string Version | 235 | override public string Version |
236 | { | 236 | { |
@@ -238,7 +238,7 @@ namespace OpenSim.Data.MSSQL | |||
238 | } | 238 | } |
239 | 239 | ||
240 | /// <summary> | 240 | /// <summary> |
241 | /// The name of this DB provider. | 241 | /// The name of this DB provider. |
242 | /// </summary> | 242 | /// </summary> |
243 | override public string Name | 243 | override public string Name |
244 | { | 244 | { |
diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs index e1de297..423d4aa 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs | |||
@@ -51,8 +51,8 @@ namespace OpenSim.Data.MSSQL | |||
51 | 51 | ||
52 | private string m_regionsTableName; | 52 | private string m_regionsTableName; |
53 | 53 | ||
54 | override public void Initialise() | 54 | override public void Initialise() |
55 | { | 55 | { |
56 | m_log.Info("[MSSQLGridData]: " + Name + " cannot be default-initialized!"); | 56 | m_log.Info("[MSSQLGridData]: " + Name + " cannot be default-initialized!"); |
57 | throw new PluginNotInitialisedException (Name); | 57 | throw new PluginNotInitialisedException (Name); |
58 | } | 58 | } |
@@ -87,7 +87,7 @@ namespace OpenSim.Data.MSSQL | |||
87 | } | 87 | } |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// | 90 | /// |
91 | /// </summary> | 91 | /// </summary> |
92 | private void TestTables() | 92 | private void TestTables() |
93 | { | 93 | { |
@@ -114,7 +114,7 @@ namespace OpenSim.Data.MSSQL | |||
114 | } | 114 | } |
115 | 115 | ||
116 | /// <summary> | 116 | /// <summary> |
117 | /// The name of this DB provider. | 117 | /// The name of this DB provider. |
118 | /// </summary> | 118 | /// </summary> |
119 | /// <returns>A string containing the storage system name</returns> | 119 | /// <returns>A string containing the storage system name</returns> |
120 | override public string Name | 120 | override public string Name |
@@ -123,7 +123,7 @@ namespace OpenSim.Data.MSSQL | |||
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// Database provider version. | 126 | /// Database provider version. |
127 | /// </summary> | 127 | /// </summary> |
128 | /// <returns>A string containing the storage system version</returns> | 128 | /// <returns>A string containing the storage system version</returns> |
129 | override public string Version | 129 | override public string Version |
@@ -209,7 +209,7 @@ namespace OpenSim.Data.MSSQL | |||
209 | { | 209 | { |
210 | return database.getRegionRow(reader); | 210 | return database.getRegionRow(reader); |
211 | } | 211 | } |
212 | 212 | ||
213 | } | 213 | } |
214 | catch (Exception e) | 214 | catch (Exception e) |
215 | { | 215 | { |
diff --git a/OpenSim/Data/MSSQL/MSSQLLogData.cs b/OpenSim/Data/MSSQL/MSSQLLogData.cs index d260e8c..b284c02 100644 --- a/OpenSim/Data/MSSQL/MSSQLLogData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLogData.cs | |||
@@ -40,14 +40,14 @@ namespace OpenSim.Data.MSSQL | |||
40 | internal class MSSQLLogData : ILogDataPlugin | 40 | internal class MSSQLLogData : ILogDataPlugin |
41 | { | 41 | { |
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// The database manager | 45 | /// The database manager |
46 | /// </summary> | 46 | /// </summary> |
47 | public MSSQLManager database; | 47 | public MSSQLManager database; |
48 | 48 | ||
49 | public void Initialise() | 49 | public void Initialise() |
50 | { | 50 | { |
51 | m_log.Info("[MSSQLLogData]: " + Name + " cannot be default-initialized!"); | 51 | m_log.Info("[MSSQLLogData]: " + Name + " cannot be default-initialized!"); |
52 | throw new PluginNotInitialisedException (Name); | 52 | throw new PluginNotInitialisedException (Name); |
53 | } | 53 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index 9cd9eca..1a053d5 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Data.MSSQL | |||
60 | builder.UserID = userId; | 60 | builder.UserID = userId; |
61 | builder.Password = password; | 61 | builder.Password = password; |
62 | builder.ApplicationName = Assembly.GetEntryAssembly().Location; | 62 | builder.ApplicationName = Assembly.GetEntryAssembly().Location; |
63 | 63 | ||
64 | connectionString = builder.ToString(); | 64 | connectionString = builder.ToString(); |
65 | } | 65 | } |
66 | 66 | ||
@@ -117,7 +117,7 @@ namespace OpenSim.Data.MSSQL | |||
117 | //} | 117 | //} |
118 | 118 | ||
119 | /// <summary> | 119 | /// <summary> |
120 | /// | 120 | /// |
121 | /// </summary> | 121 | /// </summary> |
122 | /// <param name="dt"></param> | 122 | /// <param name="dt"></param> |
123 | /// <param name="name"></param> | 123 | /// <param name="name"></param> |
@@ -376,7 +376,7 @@ namespace OpenSim.Data.MSSQL | |||
376 | } | 376 | } |
377 | 377 | ||
378 | /// <summary> | 378 | /// <summary> |
379 | /// | 379 | /// |
380 | /// </summary> | 380 | /// </summary> |
381 | /// <param name="reader"></param> | 381 | /// <param name="reader"></param> |
382 | /// <returns></returns> | 382 | /// <returns></returns> |
@@ -492,7 +492,7 @@ namespace OpenSim.Data.MSSQL | |||
492 | } | 492 | } |
493 | 493 | ||
494 | /// <summary> | 494 | /// <summary> |
495 | /// | 495 | /// |
496 | /// </summary> | 496 | /// </summary> |
497 | /// <param name="name"></param> | 497 | /// <param name="name"></param> |
498 | /// <returns></returns> | 498 | /// <returns></returns> |
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index e832414..e63a9fe 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs | |||
@@ -52,8 +52,8 @@ namespace OpenSim.Data.MSSQL | |||
52 | private string m_usersTableName; | 52 | private string m_usersTableName; |
53 | private string m_userFriendsTableName; | 53 | private string m_userFriendsTableName; |
54 | 54 | ||
55 | public override void Initialise() | 55 | public override void Initialise() |
56 | { | 56 | { |
57 | m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); | 57 | m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!"); |
58 | throw new PluginNotInitialisedException (Name); | 58 | throw new PluginNotInitialisedException (Name); |
59 | } | 59 | } |
@@ -99,11 +99,11 @@ namespace OpenSim.Data.MSSQL | |||
99 | 99 | ||
100 | TestTables(); | 100 | TestTables(); |
101 | } | 101 | } |
102 | 102 | ||
103 | public override void Dispose () {} | 103 | public override void Dispose () {} |
104 | 104 | ||
105 | /// <summary> | 105 | /// <summary> |
106 | /// | 106 | /// |
107 | /// </summary> | 107 | /// </summary> |
108 | /// <returns></returns> | 108 | /// <returns></returns> |
109 | private bool TestTables() | 109 | private bool TestTables() |
@@ -205,7 +205,7 @@ namespace OpenSim.Data.MSSQL | |||
205 | { | 205 | { |
206 | adder.ExecuteNonQuery(); | 206 | adder.ExecuteNonQuery(); |
207 | } | 207 | } |
208 | 208 | ||
209 | using (IDbCommand adder = | 209 | using (IDbCommand adder = |
210 | database.Query( | 210 | database.Query( |
211 | "INSERT INTO " + m_userFriendsTableName + " " + | 211 | "INSERT INTO " + m_userFriendsTableName + " " + |
@@ -351,7 +351,7 @@ namespace OpenSim.Data.MSSQL | |||
351 | } | 351 | } |
352 | 352 | ||
353 | /// <summary> | 353 | /// <summary> |
354 | /// | 354 | /// |
355 | /// </summary> | 355 | /// </summary> |
356 | /// <param name="queryID"></param> | 356 | /// <param name="queryID"></param> |
357 | /// <param name="query"></param> | 357 | /// <param name="query"></param> |
@@ -379,7 +379,7 @@ namespace OpenSim.Data.MSSQL | |||
379 | user.firstName = (string)reader["username"]; | 379 | user.firstName = (string)reader["username"]; |
380 | user.lastName = (string)reader["lastname"]; | 380 | user.lastName = (string)reader["lastname"]; |
381 | returnlist.Add(user); | 381 | returnlist.Add(user); |
382 | } | 382 | } |
383 | } | 383 | } |
384 | } | 384 | } |
385 | catch (Exception e) | 385 | catch (Exception e) |
@@ -406,7 +406,7 @@ namespace OpenSim.Data.MSSQL | |||
406 | returnlist.Add(user); | 406 | returnlist.Add(user); |
407 | } | 407 | } |
408 | } | 408 | } |
409 | } | 409 | } |
410 | catch (Exception e) | 410 | catch (Exception e) |
411 | { | 411 | { |
412 | m_log.Error(e.ToString()); | 412 | m_log.Error(e.ToString()); |
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 6857c2c..ecd18ae 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs | |||
@@ -36,7 +36,7 @@ using log4net; | |||
36 | 36 | ||
37 | namespace OpenSim.Data | 37 | namespace OpenSim.Data |
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// | 40 | /// |
41 | /// The Migration theory is based on the ruby on rails concept. | 41 | /// The Migration theory is based on the ruby on rails concept. |
42 | /// Each database driver is going to be allowed to have files in | 42 | /// Each database driver is going to be allowed to have files in |
@@ -77,11 +77,11 @@ namespace OpenSim.Data | |||
77 | // private string _subtype; | 77 | // private string _subtype; |
78 | private Assembly _assem; | 78 | private Assembly _assem; |
79 | private Regex _match; | 79 | private Regex _match; |
80 | 80 | ||
81 | private static readonly string _migrations_create = "create table migrations(name varchar(100), version int)"; | 81 | private static readonly string _migrations_create = "create table migrations(name varchar(100), version int)"; |
82 | // private static readonly string _migrations_init = "insert into migrations values('migrations', 1)"; | 82 | // private static readonly string _migrations_init = "insert into migrations values('migrations', 1)"; |
83 | // private static readonly string _migrations_find = "select version from migrations where name='migrations'"; | 83 | // private static readonly string _migrations_find = "select version from migrations where name='migrations'"; |
84 | 84 | ||
85 | public Migration(DbConnection conn, Assembly assem, string type) | 85 | public Migration(DbConnection conn, Assembly assem, string type) |
86 | { | 86 | { |
87 | _type = type; | 87 | _type = type; |
@@ -105,7 +105,7 @@ namespace OpenSim.Data | |||
105 | // clever, eh, we figure out which migrations version we are | 105 | // clever, eh, we figure out which migrations version we are |
106 | int migration_version = FindVersion("migrations"); | 106 | int migration_version = FindVersion("migrations"); |
107 | 107 | ||
108 | if (migration_version > 0) | 108 | if (migration_version > 0) |
109 | return; | 109 | return; |
110 | 110 | ||
111 | // If not, create the migration tables | 111 | // If not, create the migration tables |
@@ -130,14 +130,14 @@ namespace OpenSim.Data | |||
130 | m_log.Info("[MIGRATIONS] NOTE: this may take a while, don't interupt this process!"); | 130 | m_log.Info("[MIGRATIONS] NOTE: this may take a while, don't interupt this process!"); |
131 | 131 | ||
132 | DbCommand cmd = _conn.CreateCommand(); | 132 | DbCommand cmd = _conn.CreateCommand(); |
133 | foreach (KeyValuePair<int, string> kvp in migrations) | 133 | foreach (KeyValuePair<int, string> kvp in migrations) |
134 | { | 134 | { |
135 | int newversion = kvp.Key; | 135 | int newversion = kvp.Key; |
136 | cmd.CommandText = kvp.Value; | 136 | cmd.CommandText = kvp.Value; |
137 | // we need to up the command timeout to infinite as we might be doing long migrations. | 137 | // we need to up the command timeout to infinite as we might be doing long migrations. |
138 | cmd.CommandTimeout = 0; | 138 | cmd.CommandTimeout = 0; |
139 | cmd.ExecuteNonQuery(); | 139 | cmd.ExecuteNonQuery(); |
140 | 140 | ||
141 | if (version == 0) | 141 | if (version == 0) |
142 | { | 142 | { |
143 | InsertVersion(_type, newversion); | 143 | InsertVersion(_type, newversion); |
@@ -158,7 +158,7 @@ namespace OpenSim.Data | |||
158 | // foreach (string s in names) | 158 | // foreach (string s in names) |
159 | // { | 159 | // { |
160 | // Match m = _match.Match(s); | 160 | // Match m = _match.Match(s); |
161 | // if (m.Success) | 161 | // if (m.Success) |
162 | // { | 162 | // { |
163 | // int MigrationVersion = int.Parse(m.Groups[1].ToString()); | 163 | // int MigrationVersion = int.Parse(m.Groups[1].ToString()); |
164 | // if (MigrationVersion > max) | 164 | // if (MigrationVersion > max) |
@@ -168,10 +168,10 @@ namespace OpenSim.Data | |||
168 | // return max; | 168 | // return max; |
169 | // } | 169 | // } |
170 | 170 | ||
171 | public int Version | 171 | public int Version |
172 | { | 172 | { |
173 | get { return FindVersion(_type); } | 173 | get { return FindVersion(_type); } |
174 | set { | 174 | set { |
175 | if (Version < 1) | 175 | if (Version < 1) |
176 | { | 176 | { |
177 | InsertVersion(_type, value); | 177 | InsertVersion(_type, value); |
@@ -179,11 +179,11 @@ namespace OpenSim.Data | |||
179 | else | 179 | else |
180 | { | 180 | { |
181 | UpdateVersion(_type, value); | 181 | UpdateVersion(_type, value); |
182 | } | 182 | } |
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | private int FindVersion(string type) | 186 | private int FindVersion(string type) |
187 | { | 187 | { |
188 | int version = 0; | 188 | int version = 0; |
189 | DbCommand cmd = _conn.CreateCommand(); | 189 | DbCommand cmd = _conn.CreateCommand(); |
@@ -206,22 +206,22 @@ namespace OpenSim.Data | |||
206 | return version; | 206 | return version; |
207 | } | 207 | } |
208 | 208 | ||
209 | private void InsertVersion(string type, int version) | 209 | private void InsertVersion(string type, int version) |
210 | { | 210 | { |
211 | DbCommand cmd = _conn.CreateCommand(); | 211 | DbCommand cmd = _conn.CreateCommand(); |
212 | cmd.CommandText = "insert into migrations(name, version) values('" + type + "', " + version + ")"; | 212 | cmd.CommandText = "insert into migrations(name, version) values('" + type + "', " + version + ")"; |
213 | m_log.InfoFormat("[MIGRATIONS] Creating {0} at version {1}", type, version); | 213 | m_log.InfoFormat("[MIGRATIONS] Creating {0} at version {1}", type, version); |
214 | cmd.ExecuteNonQuery(); | 214 | cmd.ExecuteNonQuery(); |
215 | } | 215 | } |
216 | 216 | ||
217 | private void UpdateVersion(string type, int version) | 217 | private void UpdateVersion(string type, int version) |
218 | { | 218 | { |
219 | DbCommand cmd = _conn.CreateCommand(); | 219 | DbCommand cmd = _conn.CreateCommand(); |
220 | cmd.CommandText = "update migrations set version=" + version + " where name='" + type + "'"; | 220 | cmd.CommandText = "update migrations set version=" + version + " where name='" + type + "'"; |
221 | m_log.InfoFormat("[MIGRATIONS] Updating {0} to version {1}", type, version); | 221 | m_log.InfoFormat("[MIGRATIONS] Updating {0} to version {1}", type, version); |
222 | cmd.ExecuteNonQuery(); | 222 | cmd.ExecuteNonQuery(); |
223 | } | 223 | } |
224 | 224 | ||
225 | // private SortedList<int, string> GetAllMigrations() | 225 | // private SortedList<int, string> GetAllMigrations() |
226 | // { | 226 | // { |
227 | // return GetMigrationsAfter(0); | 227 | // return GetMigrationsAfter(0); |
@@ -261,4 +261,4 @@ namespace OpenSim.Data | |||
261 | return migrations; | 261 | return migrations; |
262 | } | 262 | } |
263 | } | 263 | } |
264 | } \ No newline at end of file | 264 | } |
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index cec736a..bdb1571 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -144,11 +144,11 @@ namespace OpenSim.Data.MySQL | |||
144 | _dbConnection.GetTableVersion(tableList); | 144 | _dbConnection.GetTableVersion(tableList); |
145 | 145 | ||
146 | // if there is no table, return, migrations will handle it. | 146 | // if there is no table, return, migrations will handle it. |
147 | if (tableList["assets"] == null) | 147 | if (tableList["assets"] == null) |
148 | return; | 148 | return; |
149 | 149 | ||
150 | // if there is a table, and we don't have a migration, set it to 1 | 150 | // if there is a table, and we don't have a migration, set it to 1 |
151 | if (m.Version == 0) | 151 | if (m.Version == 0) |
152 | m.Version = 1; | 152 | m.Version = 1; |
153 | } | 153 | } |
154 | 154 | ||
@@ -272,12 +272,12 @@ namespace OpenSim.Data.MySQL | |||
272 | lock (_dbConnection) | 272 | lock (_dbConnection) |
273 | { | 273 | { |
274 | _dbConnection.CheckConnection(); | 274 | _dbConnection.CheckConnection(); |
275 | 275 | ||
276 | MySqlCommand cmd = | 276 | MySqlCommand cmd = |
277 | new MySqlCommand( | 277 | new MySqlCommand( |
278 | "SELECT id FROM assets WHERE id=?id", | 278 | "SELECT id FROM assets WHERE id=?id", |
279 | _dbConnection.Connection); | 279 | _dbConnection.Connection); |
280 | 280 | ||
281 | cmd.Parameters.AddWithValue("?id", uuid.ToString()); | 281 | cmd.Parameters.AddWithValue("?id", uuid.ToString()); |
282 | 282 | ||
283 | try | 283 | try |
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 8991e02..2ab7d40 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Data.MySQL | |||
51 | private string m_connectionString; | 51 | private string m_connectionString; |
52 | private long m_waitTimeout; | 52 | private long m_waitTimeout; |
53 | private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; | 53 | private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; |
54 | private long m_lastConnectionUse; | 54 | private long m_lastConnectionUse; |
55 | 55 | ||
56 | private FieldInfo[] m_Fields; | 56 | private FieldInfo[] m_Fields; |
57 | private Dictionary<string, FieldInfo> m_FieldMap = | 57 | private Dictionary<string, FieldInfo> m_FieldMap = |
@@ -83,13 +83,13 @@ namespace OpenSim.Data.MySQL | |||
83 | } | 83 | } |
84 | 84 | ||
85 | m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); | 85 | m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); |
86 | 86 | ||
87 | //m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString); | 87 | //m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString); |
88 | 88 | ||
89 | m_connection = new MySqlConnection(m_connectionString); | 89 | m_connection = new MySqlConnection(m_connectionString); |
90 | m_connection.Open(); | 90 | m_connection.Open(); |
91 | 91 | ||
92 | GetWaitTimeout(); | 92 | GetWaitTimeout(); |
93 | 93 | ||
94 | Assembly assem = GetType().Assembly; | 94 | Assembly assem = GetType().Assembly; |
95 | Migration m = new Migration(m_connection, assem, "EstateStore"); | 95 | Migration m = new Migration(m_connection, assem, "EstateStore"); |
@@ -106,7 +106,7 @@ namespace OpenSim.Data.MySQL | |||
106 | m_FieldMap[f.Name.Substring(2)] = f; | 106 | m_FieldMap[f.Name.Substring(2)] = f; |
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | private string[] FieldList | 110 | private string[] FieldList |
111 | { | 111 | { |
112 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } | 112 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } |
@@ -116,28 +116,28 @@ namespace OpenSim.Data.MySQL | |||
116 | { | 116 | { |
117 | MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, | 117 | MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, |
118 | m_connection); | 118 | m_connection); |
119 | 119 | ||
120 | using (MySqlDataReader dbReader = | 120 | using (MySqlDataReader dbReader = |
121 | cmd.ExecuteReader(CommandBehavior.SingleRow)) | 121 | cmd.ExecuteReader(CommandBehavior.SingleRow)) |
122 | { | 122 | { |
123 | if (dbReader.Read()) | 123 | if (dbReader.Read()) |
124 | { | 124 | { |
125 | m_waitTimeout | 125 | m_waitTimeout |
126 | = Convert.ToInt32(dbReader["@@wait_timeout"]) * | 126 | = Convert.ToInt32(dbReader["@@wait_timeout"]) * |
127 | TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; | 127 | TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; |
128 | } | 128 | } |
129 | 129 | ||
130 | dbReader.Close(); | 130 | dbReader.Close(); |
131 | cmd.Dispose(); | 131 | cmd.Dispose(); |
132 | } | 132 | } |
133 | 133 | ||
134 | m_lastConnectionUse = System.DateTime.Now.Ticks; | 134 | m_lastConnectionUse = System.DateTime.Now.Ticks; |
135 | 135 | ||
136 | m_log.DebugFormat( | 136 | m_log.DebugFormat( |
137 | "[REGION DB]: Connection wait timeout {0} seconds", | 137 | "[REGION DB]: Connection wait timeout {0} seconds", |
138 | m_waitTimeout / TimeSpan.TicksPerSecond); | 138 | m_waitTimeout / TimeSpan.TicksPerSecond); |
139 | } | 139 | } |
140 | 140 | ||
141 | protected void CheckConnection() | 141 | protected void CheckConnection() |
142 | { | 142 | { |
143 | long timeNow = System.DateTime.Now.Ticks; | 143 | long timeNow = System.DateTime.Now.Ticks; |
@@ -145,17 +145,17 @@ namespace OpenSim.Data.MySQL | |||
145 | m_connection.State != ConnectionState.Open) | 145 | m_connection.State != ConnectionState.Open) |
146 | { | 146 | { |
147 | m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); | 147 | m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); |
148 | 148 | ||
149 | lock (m_connection) | 149 | lock (m_connection) |
150 | { | 150 | { |
151 | m_connection.Close(); | 151 | m_connection.Close(); |
152 | m_connection = new MySqlConnection(m_connectionString); | 152 | m_connection = new MySqlConnection(m_connectionString); |
153 | m_connection.Open(); | 153 | m_connection.Open(); |
154 | } | 154 | } |
155 | } | 155 | } |
156 | 156 | ||
157 | m_lastConnectionUse = timeNow; | 157 | m_lastConnectionUse = timeNow; |
158 | } | 158 | } |
159 | 159 | ||
160 | public EstateSettings LoadEstateSettings(LLUUID regionID) | 160 | public EstateSettings LoadEstateSettings(LLUUID regionID) |
161 | { | 161 | { |
@@ -210,7 +210,7 @@ namespace OpenSim.Data.MySQL | |||
210 | names.Remove("EstateID"); | 210 | names.Remove("EstateID"); |
211 | 211 | ||
212 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( ?"+String.Join(", ?", names.ToArray())+")"; | 212 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( ?"+String.Join(", ?", names.ToArray())+")"; |
213 | 213 | ||
214 | cmd.CommandText = sql; | 214 | cmd.CommandText = sql; |
215 | cmd.Parameters.Clear(); | 215 | cmd.Parameters.Clear(); |
216 | 216 | ||
@@ -318,7 +318,7 @@ namespace OpenSim.Data.MySQL | |||
318 | es.ClearBans(); | 318 | es.ClearBans(); |
319 | 319 | ||
320 | CheckConnection(); | 320 | CheckConnection(); |
321 | 321 | ||
322 | MySqlCommand cmd = m_connection.CreateCommand(); | 322 | MySqlCommand cmd = m_connection.CreateCommand(); |
323 | 323 | ||
324 | cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID"; | 324 | cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID"; |
@@ -344,18 +344,18 @@ namespace OpenSim.Data.MySQL | |||
344 | private void SaveBanList(EstateSettings es) | 344 | private void SaveBanList(EstateSettings es) |
345 | { | 345 | { |
346 | CheckConnection(); | 346 | CheckConnection(); |
347 | 347 | ||
348 | MySqlCommand cmd = m_connection.CreateCommand(); | 348 | MySqlCommand cmd = m_connection.CreateCommand(); |
349 | 349 | ||
350 | cmd.CommandText = "delete from estateban where EstateID = ?EstateID"; | 350 | cmd.CommandText = "delete from estateban where EstateID = ?EstateID"; |
351 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); | 351 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); |
352 | 352 | ||
353 | cmd.ExecuteNonQuery(); | 353 | cmd.ExecuteNonQuery(); |
354 | 354 | ||
355 | cmd.Parameters.Clear(); | 355 | cmd.Parameters.Clear(); |
356 | 356 | ||
357 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )"; | 357 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )"; |
358 | 358 | ||
359 | foreach (EstateBan b in es.EstateBans) | 359 | foreach (EstateBan b in es.EstateBans) |
360 | { | 360 | { |
361 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); | 361 | cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); |
@@ -369,18 +369,18 @@ namespace OpenSim.Data.MySQL | |||
369 | void SaveUUIDList(uint EstateID, string table, LLUUID[] data) | 369 | void SaveUUIDList(uint EstateID, string table, LLUUID[] data) |
370 | { | 370 | { |
371 | CheckConnection(); | 371 | CheckConnection(); |
372 | 372 | ||
373 | MySqlCommand cmd = m_connection.CreateCommand(); | 373 | MySqlCommand cmd = m_connection.CreateCommand(); |
374 | 374 | ||
375 | cmd.CommandText = "delete from "+table+" where EstateID = ?EstateID"; | 375 | cmd.CommandText = "delete from "+table+" where EstateID = ?EstateID"; |
376 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); | 376 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); |
377 | 377 | ||
378 | cmd.ExecuteNonQuery(); | 378 | cmd.ExecuteNonQuery(); |
379 | 379 | ||
380 | cmd.Parameters.Clear(); | 380 | cmd.Parameters.Clear(); |
381 | 381 | ||
382 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )"; | 382 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )"; |
383 | 383 | ||
384 | foreach (LLUUID uuid in data) | 384 | foreach (LLUUID uuid in data) |
385 | { | 385 | { |
386 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); | 386 | cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); |
@@ -396,7 +396,7 @@ namespace OpenSim.Data.MySQL | |||
396 | List<LLUUID> uuids = new List<LLUUID>(); | 396 | List<LLUUID> uuids = new List<LLUUID>(); |
397 | 397 | ||
398 | CheckConnection(); | 398 | CheckConnection(); |
399 | 399 | ||
400 | MySqlCommand cmd = m_connection.CreateCommand(); | 400 | MySqlCommand cmd = m_connection.CreateCommand(); |
401 | 401 | ||
402 | cmd.CommandText = "select uuid from "+table+" where EstateID = ?EstateID"; | 402 | cmd.CommandText = "select uuid from "+table+" where EstateID = ?EstateID"; |
@@ -414,7 +414,7 @@ namespace OpenSim.Data.MySQL | |||
414 | uuids.Add(uuid); | 414 | uuids.Add(uuid); |
415 | } | 415 | } |
416 | r.Close(); | 416 | r.Close(); |
417 | 417 | ||
418 | return uuids.ToArray(); | 418 | return uuids.ToArray(); |
419 | } | 419 | } |
420 | } | 420 | } |
diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs index 4cddbe5..fcbceb8 100644 --- a/OpenSim/Data/MySQL/MySQLGridData.cs +++ b/OpenSim/Data/MySQL/MySQLGridData.cs | |||
@@ -49,8 +49,8 @@ namespace OpenSim.Data.MySQL | |||
49 | /// </summary> | 49 | /// </summary> |
50 | private MySQLManager database; | 50 | private MySQLManager database; |
51 | 51 | ||
52 | override public void Initialise() | 52 | override public void Initialise() |
53 | { | 53 | { |
54 | m_log.Info("[MySQLGridData]: " + Name + " cannot be default-initialized!"); | 54 | m_log.Info("[MySQLGridData]: " + Name + " cannot be default-initialized!"); |
55 | throw new PluginNotInitialisedException (Name); | 55 | throw new PluginNotInitialisedException (Name); |
56 | } | 56 | } |
@@ -253,7 +253,7 @@ namespace OpenSim.Data.MySQL | |||
253 | return null; | 253 | return null; |
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
257 | /// <summary> | 257 | /// <summary> |
258 | /// Returns a sim profile from it's UUID | 258 | /// Returns a sim profile from it's UUID |
259 | /// </summary> | 259 | /// </summary> |
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index dd4d804..4e8200b 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -48,8 +48,8 @@ namespace OpenSim.Data.MySQL | |||
48 | /// </summary> | 48 | /// </summary> |
49 | private MySQLManager database; | 49 | private MySQLManager database; |
50 | 50 | ||
51 | public void Initialise() | 51 | public void Initialise() |
52 | { | 52 | { |
53 | m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); | 53 | m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!"); |
54 | throw new PluginNotInitialisedException (Name); | 54 | throw new PluginNotInitialisedException (Name); |
55 | } | 55 | } |
@@ -81,7 +81,7 @@ namespace OpenSim.Data.MySQL | |||
81 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | 81 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); |
82 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | 82 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); |
83 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | 83 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); |
84 | 84 | ||
85 | database = | 85 | database = |
86 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, | 86 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, |
87 | settingPort); | 87 | settingPort); |
@@ -147,7 +147,7 @@ namespace OpenSim.Data.MySQL | |||
147 | } | 147 | } |
148 | 148 | ||
149 | /// <summary> | 149 | /// <summary> |
150 | /// | 150 | /// |
151 | /// </summary> | 151 | /// </summary> |
152 | /// <param name="conn">MySQL connection handler</param> | 152 | /// <param name="conn">MySQL connection handler</param> |
153 | /// <param name="m"></param> | 153 | /// <param name="m"></param> |
@@ -180,7 +180,7 @@ namespace OpenSim.Data.MySQL | |||
180 | // ... and set the version | 180 | // ... and set the version |
181 | if (m.Version == 0) | 181 | if (m.Version == 0) |
182 | m.Version = 1; | 182 | m.Version = 1; |
183 | 183 | ||
184 | } | 184 | } |
185 | 185 | ||
186 | #endregion | 186 | #endregion |
@@ -290,7 +290,7 @@ namespace OpenSim.Data.MySQL | |||
290 | } | 290 | } |
291 | } | 291 | } |
292 | 292 | ||
293 | 293 | ||
294 | /// <summary> | 294 | /// <summary> |
295 | /// see <see cref="InventoryItemBase.getUserRootFolder"/> | 295 | /// see <see cref="InventoryItemBase.getUserRootFolder"/> |
296 | /// </summary> | 296 | /// </summary> |
@@ -708,10 +708,10 @@ namespace OpenSim.Data.MySQL | |||
708 | * - We will only need to hit the database twice instead of n times. | 708 | * - We will only need to hit the database twice instead of n times. |
709 | * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned | 709 | * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned |
710 | * by the same person, each user only has 1 inventory heirarchy | 710 | * by the same person, each user only has 1 inventory heirarchy |
711 | * - The returned list is not ordered, instead of breadth-first ordered | 711 | * - The returned list is not ordered, instead of breadth-first ordered |
712 | There are basically 2 usage cases for getFolderHeirarchy: | 712 | There are basically 2 usage cases for getFolderHeirarchy: |
713 | 1) Getting the user's entire inventory heirarchy when they log in | 713 | 1) Getting the user's entire inventory heirarchy when they log in |
714 | 2) Finding a subfolder heirarchy to delete when emptying the trash. | 714 | 2) Finding a subfolder heirarchy to delete when emptying the trash. |
715 | This implementation will pull all inventory folders from the database, and then prune away any folder that | 715 | This implementation will pull all inventory folders from the database, and then prune away any folder that |
716 | is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the | 716 | is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the |
717 | database than to make n requests. This pays off only if requested heirarchy is large. | 717 | database than to make n requests. This pays off only if requested heirarchy is large. |
@@ -774,7 +774,7 @@ namespace OpenSim.Data.MySQL | |||
774 | while (reader.Read()) | 774 | while (reader.Read()) |
775 | { | 775 | { |
776 | InventoryFolderBase curFolder = readInventoryFolder(reader); | 776 | InventoryFolderBase curFolder = readInventoryFolder(reader); |
777 | if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling | 777 | if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling |
778 | hashtable[curFolder.ParentID].Add(curFolder); // append to sibling list | 778 | hashtable[curFolder.ParentID].Add(curFolder); // append to sibling list |
779 | else // else current folder has no known (yet) siblings | 779 | else // else current folder has no known (yet) siblings |
780 | { | 780 | { |
diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs index 456cfd2..c02016c 100644 --- a/OpenSim/Data/MySQL/MySQLLogData.cs +++ b/OpenSim/Data/MySQL/MySQLLogData.cs | |||
@@ -44,12 +44,12 @@ namespace OpenSim.Data.MySQL | |||
44 | /// </summary> | 44 | /// </summary> |
45 | public MySQLManager database; | 45 | public MySQLManager database; |
46 | 46 | ||
47 | public void Initialise() | 47 | public void Initialise() |
48 | { | 48 | { |
49 | m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!"); | 49 | m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!"); |
50 | throw new PluginNotInitialisedException (Name); | 50 | throw new PluginNotInitialisedException (Name); |
51 | } | 51 | } |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Artificial constructor called when the plugin is loaded | 54 | /// Artificial constructor called when the plugin is loaded |
55 | /// Uses the obsolete mysql_connection.ini if connect string is empty. | 55 | /// Uses the obsolete mysql_connection.ini if connect string is empty. |
@@ -100,7 +100,7 @@ namespace OpenSim.Data.MySQL | |||
100 | Dictionary<string, string> tableList = new Dictionary<string, string>(); | 100 | Dictionary<string, string> tableList = new Dictionary<string, string>(); |
101 | tableList["logs"] = null; | 101 | tableList["logs"] = null; |
102 | database.GetTableVersion(tableList); | 102 | database.GetTableVersion(tableList); |
103 | 103 | ||
104 | // migrations will handle it | 104 | // migrations will handle it |
105 | if (tableList["logs"] == null) | 105 | if (tableList["logs"] == null) |
106 | return; | 106 | return; |
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 58599a8..6ad6609 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Data.MySQL | |||
55 | private string connectionString; | 55 | private string connectionString; |
56 | 56 | ||
57 | private const string m_waitTimeoutSelect = "select @@wait_timeout"; | 57 | private const string m_waitTimeoutSelect = "select @@wait_timeout"; |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Wait timeout for our connection in ticks. | 60 | /// Wait timeout for our connection in ticks. |
61 | /// </summary> | 61 | /// </summary> |
@@ -70,7 +70,7 @@ namespace OpenSim.Data.MySQL | |||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Holds the last tick time that the connection was used. | 71 | /// Holds the last tick time that the connection was used. |
72 | /// </summary> | 72 | /// </summary> |
73 | private long m_lastConnectionUse; | 73 | private long m_lastConnectionUse; |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// Initialises and creates a new MySQL connection and maintains it. | 76 | /// Initialises and creates a new MySQL connection and maintains it. |
@@ -172,7 +172,7 @@ namespace OpenSim.Data.MySQL | |||
172 | // inaccuracy. | 172 | // inaccuracy. |
173 | m_lastConnectionUse = timeNow; | 173 | m_lastConnectionUse = timeNow; |
174 | } | 174 | } |
175 | 175 | ||
176 | /// <summary> | 176 | /// <summary> |
177 | /// Get the connection being used | 177 | /// Get the connection being used |
178 | /// </summary> | 178 | /// </summary> |
@@ -287,14 +287,14 @@ namespace OpenSim.Data.MySQL | |||
287 | { | 287 | { |
288 | lock (dbcon) | 288 | lock (dbcon) |
289 | { | 289 | { |
290 | CheckConnection(); | 290 | CheckConnection(); |
291 | 291 | ||
292 | MySqlCommand tablesCmd = | 292 | MySqlCommand tablesCmd = |
293 | new MySqlCommand( | 293 | new MySqlCommand( |
294 | "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", | 294 | "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", |
295 | dbcon); | 295 | dbcon); |
296 | tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); | 296 | tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); |
297 | 297 | ||
298 | using (MySqlDataReader tables = tablesCmd.ExecuteReader()) | 298 | using (MySqlDataReader tables = tablesCmd.ExecuteReader()) |
299 | { | 299 | { |
300 | while (tables.Read()) | 300 | while (tables.Read()) |
@@ -541,7 +541,7 @@ namespace OpenSim.Data.MySQL | |||
541 | LLUUID regionID = LLUUID.Zero; | 541 | LLUUID regionID = LLUUID.Zero; |
542 | LLUUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero | 542 | LLUUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero |
543 | retval.HomeRegionID = regionID; | 543 | retval.HomeRegionID = regionID; |
544 | 544 | ||
545 | retval.Created = Convert.ToInt32(reader["created"].ToString()); | 545 | retval.Created = Convert.ToInt32(reader["created"].ToString()); |
546 | retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); | 546 | retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); |
547 | 547 | ||
@@ -1124,7 +1124,7 @@ namespace OpenSim.Data.MySQL | |||
1124 | sql += "?skirt_item, ?skirt_asset)"; | 1124 | sql += "?skirt_item, ?skirt_asset)"; |
1125 | 1125 | ||
1126 | bool returnval = false; | 1126 | bool returnval = false; |
1127 | 1127 | ||
1128 | // we want to send in byte data, which means we can't just pass down strings | 1128 | // we want to send in byte data, which means we can't just pass down strings |
1129 | try { | 1129 | try { |
1130 | MySqlCommand cmd = (MySqlCommand) dbcon.CreateCommand(); | 1130 | MySqlCommand cmd = (MySqlCommand) dbcon.CreateCommand(); |
@@ -1160,7 +1160,7 @@ namespace OpenSim.Data.MySQL | |||
1160 | cmd.Parameters.AddWithValue("?underpants_asset", appearance.UnderPantsAsset.ToString()); | 1160 | cmd.Parameters.AddWithValue("?underpants_asset", appearance.UnderPantsAsset.ToString()); |
1161 | cmd.Parameters.AddWithValue("?skirt_item", appearance.SkirtItem.ToString()); | 1161 | cmd.Parameters.AddWithValue("?skirt_item", appearance.SkirtItem.ToString()); |
1162 | cmd.Parameters.AddWithValue("?skirt_asset", appearance.SkirtAsset.ToString()); | 1162 | cmd.Parameters.AddWithValue("?skirt_asset", appearance.SkirtAsset.ToString()); |
1163 | 1163 | ||
1164 | if (cmd.ExecuteNonQuery() > 0) | 1164 | if (cmd.ExecuteNonQuery() > 0) |
1165 | returnval = true; | 1165 | returnval = true; |
1166 | 1166 | ||
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 70b6d3c..85af5df 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -53,27 +53,27 @@ namespace OpenSim.Data.MySQL | |||
53 | private const string m_terrainSelect = "select * from terrain limit 1"; | 53 | private const string m_terrainSelect = "select * from terrain limit 1"; |
54 | private const string m_landSelect = "select * from land"; | 54 | private const string m_landSelect = "select * from land"; |
55 | private const string m_landAccessListSelect = "select * from landaccesslist"; | 55 | private const string m_landAccessListSelect = "select * from landaccesslist"; |
56 | private const string m_regionSettingsSelect = "select * from regionsettings"; | 56 | private const string m_regionSettingsSelect = "select * from regionsettings"; |
57 | private const string m_waitTimeoutSelect = "select @@wait_timeout"; | 57 | private const string m_waitTimeoutSelect = "select @@wait_timeout"; |
58 | 58 | ||
59 | private MySqlConnection m_connection; | 59 | private MySqlConnection m_connection; |
60 | private string m_connectionString; | 60 | private string m_connectionString; |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Wait timeout for our connection in ticks. | 63 | /// Wait timeout for our connection in ticks. |
64 | /// </summary> | 64 | /// </summary> |
65 | private long m_waitTimeout; | 65 | private long m_waitTimeout; |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// Make our storage of the timeout this amount smaller than it actually is, to give us a margin on long | 68 | /// Make our storage of the timeout this amount smaller than it actually is, to give us a margin on long |
69 | /// running database operations. | 69 | /// running database operations. |
70 | /// </summary> | 70 | /// </summary> |
71 | private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; | 71 | private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Holds the last tick time that the connection was used. | 74 | /// Holds the last tick time that the connection was used. |
75 | /// </summary> | 75 | /// </summary> |
76 | private long m_lastConnectionUse; | 76 | private long m_lastConnectionUse; |
77 | 77 | ||
78 | private DataSet m_dataSet; | 78 | private DataSet m_dataSet; |
79 | private MySqlDataAdapter m_primDataAdapter; | 79 | private MySqlDataAdapter m_primDataAdapter; |
@@ -105,7 +105,7 @@ namespace OpenSim.Data.MySQL | |||
105 | public void Initialise(string connectionString) | 105 | public void Initialise(string connectionString) |
106 | { | 106 | { |
107 | m_connectionString = connectionString; | 107 | m_connectionString = connectionString; |
108 | 108 | ||
109 | m_dataSet = new DataSet(); | 109 | m_dataSet = new DataSet(); |
110 | 110 | ||
111 | int passPosition = 0; | 111 | int passPosition = 0; |
@@ -132,8 +132,8 @@ namespace OpenSim.Data.MySQL | |||
132 | m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); | 132 | m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); |
133 | m_connection = new MySqlConnection(m_connectionString); | 133 | m_connection = new MySqlConnection(m_connectionString); |
134 | m_connection.Open(); | 134 | m_connection.Open(); |
135 | 135 | ||
136 | GetWaitTimeout(); | 136 | GetWaitTimeout(); |
137 | 137 | ||
138 | // This actually does the roll forward assembly stuff | 138 | // This actually does the roll forward assembly stuff |
139 | Assembly assem = GetType().Assembly; | 139 | Assembly assem = GetType().Assembly; |
@@ -177,12 +177,11 @@ namespace OpenSim.Data.MySQL | |||
177 | m_dataSet.Tables.Add(m_shapeTable); | 177 | m_dataSet.Tables.Add(m_shapeTable); |
178 | SetupShapeCommands(m_shapeDataAdapter, m_connection); | 178 | SetupShapeCommands(m_shapeDataAdapter, m_connection); |
179 | m_shapeDataAdapter.Fill(m_shapeTable); | 179 | m_shapeDataAdapter.Fill(m_shapeTable); |
180 | |||
181 | 180 | ||
182 | m_itemsTable = createItemsTable(); | 181 | m_itemsTable = createItemsTable(); |
183 | m_dataSet.Tables.Add(m_itemsTable); | 182 | m_dataSet.Tables.Add(m_itemsTable); |
184 | SetupItemsCommands(m_itemsDataAdapter, m_connection); | 183 | SetupItemsCommands(m_itemsDataAdapter, m_connection); |
185 | m_itemsDataAdapter.Fill(m_itemsTable); | 184 | m_itemsDataAdapter.Fill(m_itemsTable); |
186 | 185 | ||
187 | m_terrainTable = createTerrainTable(); | 186 | m_terrainTable = createTerrainTable(); |
188 | m_dataSet.Tables.Add(m_terrainTable); | 187 | m_dataSet.Tables.Add(m_terrainTable); |
@@ -205,58 +204,58 @@ namespace OpenSim.Data.MySQL | |||
205 | m_regionSettingsDataAdapter.Fill(m_regionSettingsTable); | 204 | m_regionSettingsDataAdapter.Fill(m_regionSettingsTable); |
206 | } | 205 | } |
207 | } | 206 | } |
208 | 207 | ||
209 | /// <summary> | 208 | /// <summary> |
210 | /// Get the wait_timeout value for our connection | 209 | /// Get the wait_timeout value for our connection |
211 | /// </summary> | 210 | /// </summary> |
212 | protected void GetWaitTimeout() | 211 | protected void GetWaitTimeout() |
213 | { | 212 | { |
214 | MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, m_connection); | 213 | MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, m_connection); |
215 | 214 | ||
216 | using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 215 | using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
217 | { | 216 | { |
218 | if (dbReader.Read()) | 217 | if (dbReader.Read()) |
219 | { | 218 | { |
220 | m_waitTimeout | 219 | m_waitTimeout |
221 | = Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; | 220 | = Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; |
222 | } | 221 | } |
223 | 222 | ||
224 | dbReader.Close(); | 223 | dbReader.Close(); |
225 | cmd.Dispose(); | 224 | cmd.Dispose(); |
226 | } | 225 | } |
227 | 226 | ||
228 | m_lastConnectionUse = System.DateTime.Now.Ticks; | 227 | m_lastConnectionUse = System.DateTime.Now.Ticks; |
229 | 228 | ||
230 | m_log.DebugFormat( | 229 | m_log.DebugFormat( |
231 | "[REGION DB]: Connection wait timeout {0} seconds", m_waitTimeout / TimeSpan.TicksPerSecond); | 230 | "[REGION DB]: Connection wait timeout {0} seconds", m_waitTimeout / TimeSpan.TicksPerSecond); |
232 | } | 231 | } |
233 | 232 | ||
234 | /// <summary> | 233 | /// <summary> |
235 | /// Should be called before any db operation. This checks to see if the connection has not timed out | 234 | /// Should be called before any db operation. This checks to see if the connection has not timed out |
236 | /// </summary> | 235 | /// </summary> |
237 | protected void CheckConnection() | 236 | protected void CheckConnection() |
238 | { | 237 | { |
239 | //m_log.Debug("[REGION DB]: Checking connection"); | 238 | //m_log.Debug("[REGION DB]: Checking connection"); |
240 | 239 | ||
241 | long timeNow = System.DateTime.Now.Ticks; | 240 | long timeNow = System.DateTime.Now.Ticks; |
242 | if (timeNow - m_lastConnectionUse > m_waitTimeout || m_connection.State != ConnectionState.Open) | 241 | if (timeNow - m_lastConnectionUse > m_waitTimeout || m_connection.State != ConnectionState.Open) |
243 | { | 242 | { |
244 | m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); | 243 | m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); |
245 | 244 | ||
246 | lock (m_connection) | 245 | lock (m_connection) |
247 | { | 246 | { |
248 | m_connection.Close(); | 247 | m_connection.Close(); |
249 | m_connection = new MySqlConnection(m_connectionString); | 248 | m_connection = new MySqlConnection(m_connectionString); |
250 | m_connection.Open(); | 249 | m_connection.Open(); |
251 | } | 250 | } |
252 | } | 251 | } |
253 | 252 | ||
254 | // Strictly, we should set this after the actual db operation. But it's more convenient to set here rather | 253 | // Strictly, we should set this after the actual db operation. But it's more convenient to set here rather |
255 | // than require the code to call another method - the timeout leeway should be large enough to cover the | 254 | // than require the code to call another method - the timeout leeway should be large enough to cover the |
256 | // inaccuracy. | 255 | // inaccuracy. |
257 | m_lastConnectionUse = timeNow; | 256 | m_lastConnectionUse = timeNow; |
258 | } | 257 | } |
259 | 258 | ||
260 | /// <summary> | 259 | /// <summary> |
261 | /// Given a list of tables, return the version of the tables, as seen in the database | 260 | /// Given a list of tables, return the version of the tables, as seen in the database |
262 | /// </summary> | 261 | /// </summary> |
@@ -271,7 +270,7 @@ namespace OpenSim.Data.MySQL | |||
271 | "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", | 270 | "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", |
272 | dbcon); | 271 | dbcon); |
273 | tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); | 272 | tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); |
274 | 273 | ||
275 | CheckConnection(); | 274 | CheckConnection(); |
276 | using (MySqlDataReader tables = tablesCmd.ExecuteReader()) | 275 | using (MySqlDataReader tables = tablesCmd.ExecuteReader()) |
277 | { | 276 | { |
@@ -465,7 +464,7 @@ namespace OpenSim.Data.MySQL | |||
465 | 464 | ||
466 | lock (m_dataSet) | 465 | lock (m_dataSet) |
467 | { | 466 | { |
468 | CheckConnection(); | 467 | CheckConnection(); |
469 | DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); | 468 | DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); |
470 | m_log.Info("[REGION DB]: " + | 469 | m_log.Info("[REGION DB]: " + |
471 | "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); | 470 | "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); |
@@ -587,10 +586,10 @@ namespace OpenSim.Data.MySQL | |||
587 | using (cmd) | 586 | using (cmd) |
588 | { | 587 | { |
589 | delete.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); | 588 | delete.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); |
590 | 589 | ||
591 | CheckConnection(); | 590 | CheckConnection(); |
592 | delete.ExecuteNonQuery(); | 591 | delete.ExecuteNonQuery(); |
593 | 592 | ||
594 | cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); | 593 | cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); |
595 | cmd.Parameters.Add(new MySqlParameter("?Revision", revision)); | 594 | cmd.Parameters.Add(new MySqlParameter("?Revision", revision)); |
596 | cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter))); | 595 | cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter))); |
@@ -774,7 +773,7 @@ namespace OpenSim.Data.MySQL | |||
774 | } | 773 | } |
775 | 774 | ||
776 | /// <summary> | 775 | /// <summary> |
777 | /// | 776 | /// |
778 | /// </summary> | 777 | /// </summary> |
779 | /// <param name="regionUUID"></param> | 778 | /// <param name="regionUUID"></param> |
780 | /// <returns></returns> | 779 | /// <returns></returns> |
@@ -805,7 +804,7 @@ namespace OpenSim.Data.MySQL | |||
805 | } | 804 | } |
806 | 805 | ||
807 | /// <summary> | 806 | /// <summary> |
808 | /// | 807 | /// |
809 | /// </summary> | 808 | /// </summary> |
810 | public void Commit() | 809 | public void Commit() |
811 | { | 810 | { |
@@ -845,7 +844,7 @@ namespace OpenSim.Data.MySQL | |||
845 | **********************************************************************/ | 844 | **********************************************************************/ |
846 | 845 | ||
847 | /// <summary> | 846 | /// <summary> |
848 | /// | 847 | /// |
849 | /// </summary> | 848 | /// </summary> |
850 | /// <param name="dt"></param> | 849 | /// <param name="dt"></param> |
851 | /// <param name="name"></param> | 850 | /// <param name="name"></param> |
@@ -1139,7 +1138,7 @@ namespace OpenSim.Data.MySQL | |||
1139 | **********************************************************************/ | 1138 | **********************************************************************/ |
1140 | 1139 | ||
1141 | /// <summary> | 1140 | /// <summary> |
1142 | /// | 1141 | /// |
1143 | /// </summary> | 1142 | /// </summary> |
1144 | /// <param name="row"></param> | 1143 | /// <param name="row"></param> |
1145 | /// <returns></returns> | 1144 | /// <returns></returns> |
@@ -1315,7 +1314,7 @@ namespace OpenSim.Data.MySQL | |||
1315 | } | 1314 | } |
1316 | 1315 | ||
1317 | /// <summary> | 1316 | /// <summary> |
1318 | /// | 1317 | /// |
1319 | /// </summary> | 1318 | /// </summary> |
1320 | /// <param name="row"></param> | 1319 | /// <param name="row"></param> |
1321 | /// <returns></returns> | 1320 | /// <returns></returns> |
@@ -1374,14 +1373,14 @@ namespace OpenSim.Data.MySQL | |||
1374 | newData.UserLookAt = LLVector3.Zero; | 1373 | newData.UserLookAt = LLVector3.Zero; |
1375 | m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); | 1374 | m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); |
1376 | } | 1375 | } |
1377 | 1376 | ||
1378 | newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); | 1377 | newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); |
1379 | 1378 | ||
1380 | return newData; | 1379 | return newData; |
1381 | } | 1380 | } |
1382 | 1381 | ||
1383 | /// <summary> | 1382 | /// <summary> |
1384 | /// | 1383 | /// |
1385 | /// </summary> | 1384 | /// </summary> |
1386 | /// <param name="row"></param> | 1385 | /// <param name="row"></param> |
1387 | /// <returns></returns> | 1386 | /// <returns></returns> |
@@ -1395,7 +1394,7 @@ namespace OpenSim.Data.MySQL | |||
1395 | } | 1394 | } |
1396 | 1395 | ||
1397 | /// <summary> | 1396 | /// <summary> |
1398 | /// | 1397 | /// |
1399 | /// </summary> | 1398 | /// </summary> |
1400 | /// <param name="val"></param> | 1399 | /// <param name="val"></param> |
1401 | /// <returns></returns> | 1400 | /// <returns></returns> |
@@ -1419,7 +1418,7 @@ namespace OpenSim.Data.MySQL | |||
1419 | } | 1418 | } |
1420 | 1419 | ||
1421 | /// <summary> | 1420 | /// <summary> |
1422 | /// | 1421 | /// |
1423 | /// </summary> | 1422 | /// </summary> |
1424 | /// <param name="row"></param> | 1423 | /// <param name="row"></param> |
1425 | /// <param name="prim"></param> | 1424 | /// <param name="prim"></param> |
@@ -1502,7 +1501,7 @@ namespace OpenSim.Data.MySQL | |||
1502 | } | 1501 | } |
1503 | 1502 | ||
1504 | /// <summary> | 1503 | /// <summary> |
1505 | /// | 1504 | /// |
1506 | /// </summary> | 1505 | /// </summary> |
1507 | /// <param name="row"></param> | 1506 | /// <param name="row"></param> |
1508 | /// <param name="taskItem"></param> | 1507 | /// <param name="taskItem"></param> |
@@ -1532,7 +1531,7 @@ namespace OpenSim.Data.MySQL | |||
1532 | } | 1531 | } |
1533 | 1532 | ||
1534 | /// <summary> | 1533 | /// <summary> |
1535 | /// | 1534 | /// |
1536 | /// </summary> | 1535 | /// </summary> |
1537 | private static void fillRegionSettingsRow(DataRow row, RegionSettings settings) | 1536 | private static void fillRegionSettingsRow(DataRow row, RegionSettings settings) |
1538 | { | 1537 | { |
@@ -1573,7 +1572,7 @@ namespace OpenSim.Data.MySQL | |||
1573 | } | 1572 | } |
1574 | 1573 | ||
1575 | /// <summary> | 1574 | /// <summary> |
1576 | /// | 1575 | /// |
1577 | /// </summary> | 1576 | /// </summary> |
1578 | /// <param name="row"></param> | 1577 | /// <param name="row"></param> |
1579 | /// <param name="land"></param> | 1578 | /// <param name="land"></param> |
@@ -1618,7 +1617,7 @@ namespace OpenSim.Data.MySQL | |||
1618 | } | 1617 | } |
1619 | 1618 | ||
1620 | /// <summary> | 1619 | /// <summary> |
1621 | /// | 1620 | /// |
1622 | /// </summary> | 1621 | /// </summary> |
1623 | /// <param name="row"></param> | 1622 | /// <param name="row"></param> |
1624 | /// <param name="entry"></param> | 1623 | /// <param name="entry"></param> |
@@ -1631,7 +1630,7 @@ namespace OpenSim.Data.MySQL | |||
1631 | } | 1630 | } |
1632 | 1631 | ||
1633 | /// <summary> | 1632 | /// <summary> |
1634 | /// | 1633 | /// |
1635 | /// </summary> | 1634 | /// </summary> |
1636 | /// <param name="row"></param> | 1635 | /// <param name="row"></param> |
1637 | /// <returns></returns> | 1636 | /// <returns></returns> |
@@ -1694,7 +1693,7 @@ namespace OpenSim.Data.MySQL | |||
1694 | } | 1693 | } |
1695 | 1694 | ||
1696 | /// <summary> | 1695 | /// <summary> |
1697 | /// | 1696 | /// |
1698 | /// </summary> | 1697 | /// </summary> |
1699 | /// <param name="row"></param> | 1698 | /// <param name="row"></param> |
1700 | /// <param name="prim"></param> | 1699 | /// <param name="prim"></param> |
@@ -1731,7 +1730,7 @@ namespace OpenSim.Data.MySQL | |||
1731 | row["ProfileHollow"] = s.ProfileHollow; | 1730 | row["ProfileHollow"] = s.ProfileHollow; |
1732 | row["Texture"] = s.TextureEntry; | 1731 | row["Texture"] = s.TextureEntry; |
1733 | row["ExtraParams"] = s.ExtraParams; | 1732 | row["ExtraParams"] = s.ExtraParams; |
1734 | 1733 | ||
1735 | try | 1734 | try |
1736 | { | 1735 | { |
1737 | row["State"] = s.State; | 1736 | row["State"] = s.State; |
@@ -1754,7 +1753,7 @@ namespace OpenSim.Data.MySQL | |||
1754 | } | 1753 | } |
1755 | 1754 | ||
1756 | /// <summary> | 1755 | /// <summary> |
1757 | /// | 1756 | /// |
1758 | /// </summary> | 1757 | /// </summary> |
1759 | /// <param name="prim"></param> | 1758 | /// <param name="prim"></param> |
1760 | /// <param name="sceneGroupID"></param> | 1759 | /// <param name="sceneGroupID"></param> |
@@ -1911,7 +1910,7 @@ namespace OpenSim.Data.MySQL | |||
1911 | } | 1910 | } |
1912 | 1911 | ||
1913 | /// <summary> | 1912 | /// <summary> |
1914 | /// | 1913 | /// |
1915 | /// </summary> | 1914 | /// </summary> |
1916 | /// <param name="dt"></param> | 1915 | /// <param name="dt"></param> |
1917 | /// <returns></returns> | 1916 | /// <returns></returns> |
@@ -1973,7 +1972,7 @@ namespace OpenSim.Data.MySQL | |||
1973 | } | 1972 | } |
1974 | 1973 | ||
1975 | /// <summary> | 1974 | /// <summary> |
1976 | /// | 1975 | /// |
1977 | /// </summary> | 1976 | /// </summary> |
1978 | /// <param name="da"></param> | 1977 | /// <param name="da"></param> |
1979 | /// <param name="conn"></param> | 1978 | /// <param name="conn"></param> |
@@ -1994,7 +1993,7 @@ namespace OpenSim.Data.MySQL | |||
1994 | } | 1993 | } |
1995 | 1994 | ||
1996 | /// <summary> | 1995 | /// <summary> |
1997 | /// | 1996 | /// |
1998 | /// </summary> | 1997 | /// </summary> |
1999 | /// <param name="da"></param> | 1998 | /// <param name="da"></param> |
2000 | /// <param name="conn"></param> | 1999 | /// <param name="conn"></param> |
@@ -2027,7 +2026,7 @@ namespace OpenSim.Data.MySQL | |||
2027 | } | 2026 | } |
2028 | 2027 | ||
2029 | /// <summary> | 2028 | /// <summary> |
2030 | /// | 2029 | /// |
2031 | /// </summary> | 2030 | /// </summary> |
2032 | /// <param name="da"></param> | 2031 | /// <param name="da"></param> |
2033 | /// <param name="conn"></param> | 2032 | /// <param name="conn"></param> |
@@ -2038,7 +2037,7 @@ namespace OpenSim.Data.MySQL | |||
2038 | } | 2037 | } |
2039 | 2038 | ||
2040 | /// <summary> | 2039 | /// <summary> |
2041 | /// | 2040 | /// |
2042 | /// </summary> | 2041 | /// </summary> |
2043 | /// <param name="da"></param> | 2042 | /// <param name="da"></param> |
2044 | /// <param name="conn"></param> | 2043 | /// <param name="conn"></param> |
@@ -2052,7 +2051,7 @@ namespace OpenSim.Data.MySQL | |||
2052 | } | 2051 | } |
2053 | 2052 | ||
2054 | /// <summary> | 2053 | /// <summary> |
2055 | /// | 2054 | /// |
2056 | /// </summary> | 2055 | /// </summary> |
2057 | /// <param name="da"></param> | 2056 | /// <param name="da"></param> |
2058 | /// <param name="conn"></param> | 2057 | /// <param name="conn"></param> |
@@ -2063,7 +2062,7 @@ namespace OpenSim.Data.MySQL | |||
2063 | } | 2062 | } |
2064 | 2063 | ||
2065 | /// <summary> | 2064 | /// <summary> |
2066 | /// | 2065 | /// |
2067 | /// </summary> | 2066 | /// </summary> |
2068 | /// <param name="da"></param> | 2067 | /// <param name="da"></param> |
2069 | /// <param name="conn"></param> | 2068 | /// <param name="conn"></param> |
@@ -2082,7 +2081,7 @@ namespace OpenSim.Data.MySQL | |||
2082 | } | 2081 | } |
2083 | 2082 | ||
2084 | /// <summary> | 2083 | /// <summary> |
2085 | /// | 2084 | /// |
2086 | /// </summary> | 2085 | /// </summary> |
2087 | /// <param name="conn">MySQL connection handler</param> | 2086 | /// <param name="conn">MySQL connection handler</param> |
2088 | // private static void InitDB(MySqlConnection conn) | 2087 | // private static void InitDB(MySqlConnection conn) |
@@ -2174,7 +2173,7 @@ namespace OpenSim.Data.MySQL | |||
2174 | // } | 2173 | // } |
2175 | 2174 | ||
2176 | /// <summary> | 2175 | /// <summary> |
2177 | /// | 2176 | /// |
2178 | /// </summary> | 2177 | /// </summary> |
2179 | /// <param name="conn"></param> | 2178 | /// <param name="conn"></param> |
2180 | /// <param name="m"></param> | 2179 | /// <param name="m"></param> |
diff --git a/OpenSim/Data/NHibernate/LLQuaternionUserType.cs b/OpenSim/Data/NHibernate/LLQuaternionUserType.cs index c4f3136..80fb9ff 100644 --- a/OpenSim/Data/NHibernate/LLQuaternionUserType.cs +++ b/OpenSim/Data/NHibernate/LLQuaternionUserType.cs | |||
@@ -72,7 +72,7 @@ namespace OpenSim.Data.NHibernate | |||
72 | public object NullSafeGet(IDataReader rs, string[] names, object owner) | 72 | public object NullSafeGet(IDataReader rs, string[] names, object owner) |
73 | { | 73 | { |
74 | object quat = null; | 74 | object quat = null; |
75 | 75 | ||
76 | int x = rs.GetOrdinal(names[0]); | 76 | int x = rs.GetOrdinal(names[0]); |
77 | int y = rs.GetOrdinal(names[1]); | 77 | int y = rs.GetOrdinal(names[1]); |
78 | int z = rs.GetOrdinal(names[2]); | 78 | int z = rs.GetOrdinal(names[2]); |
@@ -105,10 +105,10 @@ namespace OpenSim.Data.NHibernate | |||
105 | 105 | ||
106 | public SqlType[] SqlTypes | 106 | public SqlType[] SqlTypes |
107 | { | 107 | { |
108 | get { return new SqlType [] { | 108 | get { return new SqlType [] { |
109 | NHibernateUtil.Single.SqlType, | 109 | NHibernateUtil.Single.SqlType, |
110 | NHibernateUtil.Single.SqlType, | 110 | NHibernateUtil.Single.SqlType, |
111 | NHibernateUtil.Single.SqlType, | 111 | NHibernateUtil.Single.SqlType, |
112 | NHibernateUtil.Single.SqlType | 112 | NHibernateUtil.Single.SqlType |
113 | }; } | 113 | }; } |
114 | } | 114 | } |
diff --git a/OpenSim/Data/NHibernate/LLVector3UserType.cs b/OpenSim/Data/NHibernate/LLVector3UserType.cs index b040ca7d..d2df2c4 100644 --- a/OpenSim/Data/NHibernate/LLVector3UserType.cs +++ b/OpenSim/Data/NHibernate/LLVector3UserType.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Data.NHibernate | |||
70 | public object NullSafeGet(IDataReader rs, string[] names, object owner) | 70 | public object NullSafeGet(IDataReader rs, string[] names, object owner) |
71 | { | 71 | { |
72 | object vector = null; | 72 | object vector = null; |
73 | 73 | ||
74 | int x = rs.GetOrdinal(names[0]); | 74 | int x = rs.GetOrdinal(names[0]); |
75 | int y = rs.GetOrdinal(names[1]); | 75 | int y = rs.GetOrdinal(names[1]); |
76 | int z = rs.GetOrdinal(names[2]); | 76 | int z = rs.GetOrdinal(names[2]); |
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index 2e9e897..400451f 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs | |||
@@ -93,7 +93,7 @@ namespace OpenSim.Data.NHibernate | |||
93 | 93 | ||
94 | factory = cfg.BuildSessionFactory(); | 94 | factory = cfg.BuildSessionFactory(); |
95 | session = factory.OpenSession(); | 95 | session = factory.OpenSession(); |
96 | 96 | ||
97 | // This actually does the roll forward assembly stuff | 97 | // This actually does the roll forward assembly stuff |
98 | Assembly assem = GetType().Assembly; | 98 | Assembly assem = GetType().Assembly; |
99 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "AssetStore"); | 99 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "AssetStore"); |
@@ -111,7 +111,7 @@ namespace OpenSim.Data.NHibernate | |||
111 | { | 111 | { |
112 | m_log.ErrorFormat("[NHIBERNATE] no such asset {0}", uuid); | 112 | m_log.ErrorFormat("[NHIBERNATE] no such asset {0}", uuid); |
113 | return null; | 113 | return null; |
114 | } | 114 | } |
115 | catch (Exception e) | 115 | catch (Exception e) |
116 | { | 116 | { |
117 | m_log.Error("[NHIBERNATE] unexpected exception: ", e); | 117 | m_log.Error("[NHIBERNATE] unexpected exception: ", e); |
@@ -121,7 +121,7 @@ namespace OpenSim.Data.NHibernate | |||
121 | 121 | ||
122 | private void Save(AssetBase asset) | 122 | private void Save(AssetBase asset) |
123 | { | 123 | { |
124 | try | 124 | try |
125 | { | 125 | { |
126 | // a is not used anywhere? | 126 | // a is not used anywhere? |
127 | // AssetBase a = session.Load(typeof(AssetBase), asset.FullID) as AssetBase; | 127 | // AssetBase a = session.Load(typeof(AssetBase), asset.FullID) as AssetBase; |
diff --git a/OpenSim/Data/NHibernate/NHibernateManager.cs b/OpenSim/Data/NHibernate/NHibernateManager.cs index 4c5ec01..161ec1d 100644 --- a/OpenSim/Data/NHibernate/NHibernateManager.cs +++ b/OpenSim/Data/NHibernate/NHibernateManager.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Data.NHibernate | |||
51 | // "NHibernate.Driver.SqliteClientDriver"; | 51 | // "NHibernate.Driver.SqliteClientDriver"; |
52 | // cfg.Properties[NHibernate.Cfg.Environment.ConnectionString] = | 52 | // cfg.Properties[NHibernate.Cfg.Environment.ConnectionString] = |
53 | // "URI=file:opensim-nh.db,version=3"; | 53 | // "URI=file:opensim-nh.db,version=3"; |
54 | 54 | ||
55 | // factory = cfg.BuildSessionFactory(); | 55 | // factory = cfg.BuildSessionFactory(); |
56 | } | 56 | } |
57 | 57 | ||
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index 52db32d..9682d87 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs | |||
@@ -89,10 +89,10 @@ namespace OpenSim.Data.NHibernate | |||
89 | using (MemoryStream stream = | 89 | using (MemoryStream stream = |
90 | HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) | 90 | HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) |
91 | cfg.AddInputStream(stream); | 91 | cfg.AddInputStream(stream); |
92 | 92 | ||
93 | factory = cfg.BuildSessionFactory(); | 93 | factory = cfg.BuildSessionFactory(); |
94 | session = factory.OpenSession(); | 94 | session = factory.OpenSession(); |
95 | 95 | ||
96 | // This actually does the roll forward assembly stuff | 96 | // This actually does the roll forward assembly stuff |
97 | Assembly assem = GetType().Assembly; | 97 | Assembly assem = GetType().Assembly; |
98 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "RegionStore"); | 98 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "RegionStore"); |
@@ -113,7 +113,7 @@ namespace OpenSim.Data.NHibernate | |||
113 | { | 113 | { |
114 | return null; | 114 | return null; |
115 | } | 115 | } |
116 | 116 | ||
117 | // This looks inefficient, but it turns out that it isn't | 117 | // This looks inefficient, but it turns out that it isn't |
118 | // based on trial runs with nhibernate 1.2 | 118 | // based on trial runs with nhibernate 1.2 |
119 | private void SaveOrUpdate(SceneObjectPart p) | 119 | private void SaveOrUpdate(SceneObjectPart p) |
@@ -164,7 +164,7 @@ namespace OpenSim.Data.NHibernate | |||
164 | /// <param name="regionUUID">the region UUID</param> | 164 | /// <param name="regionUUID">the region UUID</param> |
165 | public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) | 165 | public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) |
166 | { | 166 | { |
167 | try | 167 | try |
168 | { | 168 | { |
169 | foreach (SceneObjectPart part in obj.Children.Values) | 169 | foreach (SceneObjectPart part in obj.Children.Values) |
170 | { | 170 | { |
@@ -173,7 +173,7 @@ namespace OpenSim.Data.NHibernate | |||
173 | } | 173 | } |
174 | session.Flush(); | 174 | session.Flush(); |
175 | } | 175 | } |
176 | catch (Exception e) | 176 | catch (Exception e) |
177 | { | 177 | { |
178 | m_log.Error("Can't save: ", e); | 178 | m_log.Error("Can't save: ", e); |
179 | } | 179 | } |
@@ -196,7 +196,7 @@ namespace OpenSim.Data.NHibernate | |||
196 | group.AddPart(p); | 196 | group.AddPart(p); |
197 | group.RootPart = p; | 197 | group.RootPart = p; |
198 | } | 198 | } |
199 | else | 199 | else |
200 | { | 200 | { |
201 | group.AddPart(p); | 201 | group.AddPart(p); |
202 | } | 202 | } |
@@ -232,7 +232,7 @@ namespace OpenSim.Data.NHibernate | |||
232 | { | 232 | { |
233 | Dictionary<LLUUID, SceneObjectGroup> SOG = new Dictionary<LLUUID, SceneObjectGroup>(); | 233 | Dictionary<LLUUID, SceneObjectGroup> SOG = new Dictionary<LLUUID, SceneObjectGroup>(); |
234 | List<SceneObjectGroup> ret = new List<SceneObjectGroup>(); | 234 | List<SceneObjectGroup> ret = new List<SceneObjectGroup>(); |
235 | 235 | ||
236 | ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart)); | 236 | ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart)); |
237 | criteria.Add(Expression.Eq("RegionID", regionUUID)); | 237 | criteria.Add(Expression.Eq("RegionID", regionUUID)); |
238 | criteria.AddOrder( Order.Asc("ParentID") ); | 238 | criteria.AddOrder( Order.Asc("ParentID") ); |
@@ -246,12 +246,12 @@ namespace OpenSim.Data.NHibernate | |||
246 | group.RootPart = p; | 246 | group.RootPart = p; |
247 | SOG.Add(p.ParentUUID, group); | 247 | SOG.Add(p.ParentUUID, group); |
248 | } | 248 | } |
249 | else | 249 | else |
250 | { | 250 | { |
251 | SOG[p.ParentUUID].AddPart(p); | 251 | SOG[p.ParentUUID].AddPart(p); |
252 | } | 252 | } |
253 | // get the inventory | 253 | // get the inventory |
254 | 254 | ||
255 | ICriteria InvCriteria = session.CreateCriteria(typeof(TaskInventoryItem)); | 255 | ICriteria InvCriteria = session.CreateCriteria(typeof(TaskInventoryItem)); |
256 | InvCriteria.Add(Expression.Eq("ParentPartID", p.UUID)); | 256 | InvCriteria.Add(Expression.Eq("ParentPartID", p.UUID)); |
257 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); | 257 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); |
@@ -263,7 +263,7 @@ namespace OpenSim.Data.NHibernate | |||
263 | if (inventory.Count > 0) | 263 | if (inventory.Count > 0) |
264 | p.RestoreInventoryItems(inventory); | 264 | p.RestoreInventoryItems(inventory); |
265 | } | 265 | } |
266 | foreach (SceneObjectGroup g in SOG.Values) | 266 | foreach (SceneObjectGroup g in SOG.Values) |
267 | { | 267 | { |
268 | ret.Add(g); | 268 | ret.Add(g); |
269 | } | 269 | } |
@@ -304,7 +304,7 @@ namespace OpenSim.Data.NHibernate | |||
304 | } | 304 | } |
305 | 305 | ||
306 | /// <summary> | 306 | /// <summary> |
307 | /// | 307 | /// |
308 | /// </summary> | 308 | /// </summary> |
309 | /// <param name="globalID"></param> | 309 | /// <param name="globalID"></param> |
310 | public void RemoveLandObject(LLUUID globalID) | 310 | public void RemoveLandObject(LLUUID globalID) |
@@ -313,7 +313,7 @@ namespace OpenSim.Data.NHibernate | |||
313 | } | 313 | } |
314 | 314 | ||
315 | /// <summary> | 315 | /// <summary> |
316 | /// | 316 | /// |
317 | /// </summary> | 317 | /// </summary> |
318 | /// <param name="parcel"></param> | 318 | /// <param name="parcel"></param> |
319 | public void StoreLandObject(ILandObject parcel) | 319 | public void StoreLandObject(ILandObject parcel) |
@@ -322,7 +322,7 @@ namespace OpenSim.Data.NHibernate | |||
322 | } | 322 | } |
323 | 323 | ||
324 | /// <summary> | 324 | /// <summary> |
325 | /// | 325 | /// |
326 | /// </summary> | 326 | /// </summary> |
327 | /// <param name="regionUUID"></param> | 327 | /// <param name="regionUUID"></param> |
328 | /// <returns></returns> | 328 | /// <returns></returns> |
@@ -341,7 +341,7 @@ namespace OpenSim.Data.NHibernate | |||
341 | { | 341 | { |
342 | session.Flush(); | 342 | session.Flush(); |
343 | } | 343 | } |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
346 | /// Load a region banlist | 346 | /// Load a region banlist |
347 | /// </summary> | 347 | /// </summary> |
@@ -373,7 +373,7 @@ namespace OpenSim.Data.NHibernate | |||
373 | } | 373 | } |
374 | 374 | ||
375 | /// <summary> | 375 | /// <summary> |
376 | /// | 376 | /// |
377 | /// </summary> | 377 | /// </summary> |
378 | /// <param name="val"></param> | 378 | /// <param name="val"></param> |
379 | /// <returns></returns> | 379 | /// <returns></returns> |
@@ -399,17 +399,17 @@ namespace OpenSim.Data.NHibernate | |||
399 | { | 399 | { |
400 | ICriteria criteria = session.CreateCriteria(typeof(TaskInventoryItem)); | 400 | ICriteria criteria = session.CreateCriteria(typeof(TaskInventoryItem)); |
401 | criteria.Add(Expression.Eq("ParentPartID", primID)); | 401 | criteria.Add(Expression.Eq("ParentPartID", primID)); |
402 | try | 402 | try |
403 | { | 403 | { |
404 | foreach (TaskInventoryItem i in criteria.List()) | 404 | foreach (TaskInventoryItem i in criteria.List()) |
405 | { | 405 | { |
406 | session.Delete(i); | 406 | session.Delete(i); |
407 | } | 407 | } |
408 | 408 | ||
409 | foreach (TaskInventoryItem i in items) | 409 | foreach (TaskInventoryItem i in items) |
410 | { | 410 | { |
411 | session.Save(i); | 411 | session.Save(i); |
412 | 412 | ||
413 | } | 413 | } |
414 | session.Flush(); | 414 | session.Flush(); |
415 | } | 415 | } |
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index bceae7c..c776474 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs | |||
@@ -53,8 +53,8 @@ namespace OpenSim.Data.NHibernate | |||
53 | private ISessionFactory factory; | 53 | private ISessionFactory factory; |
54 | private ISession session; | 54 | private ISession session; |
55 | 55 | ||
56 | public override void Initialise() | 56 | public override void Initialise() |
57 | { | 57 | { |
58 | m_log.Info("[NHibernateUserData]: " + Name + " cannot be default-initialized!"); | 58 | m_log.Info("[NHibernateUserData]: " + Name + " cannot be default-initialized!"); |
59 | throw new PluginNotInitialisedException (Name); | 59 | throw new PluginNotInitialisedException (Name); |
60 | } | 60 | } |
@@ -83,7 +83,7 @@ namespace OpenSim.Data.NHibernate | |||
83 | 83 | ||
84 | factory = cfg.BuildSessionFactory(); | 84 | factory = cfg.BuildSessionFactory(); |
85 | session = factory.OpenSession(); | 85 | session = factory.OpenSession(); |
86 | 86 | ||
87 | // This actually does the roll forward assembly stuff | 87 | // This actually does the roll forward assembly stuff |
88 | Assembly assem = GetType().Assembly; | 88 | Assembly assem = GetType().Assembly; |
89 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "UserStore"); | 89 | Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "UserStore"); |
@@ -97,7 +97,7 @@ namespace OpenSim.Data.NHibernate | |||
97 | { | 97 | { |
98 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; | 98 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; |
99 | } | 99 | } |
100 | catch (ObjectNotFoundException) | 100 | catch (ObjectNotFoundException) |
101 | { | 101 | { |
102 | user = null; | 102 | user = null; |
103 | } | 103 | } |
@@ -109,12 +109,12 @@ namespace OpenSim.Data.NHibernate | |||
109 | { | 109 | { |
110 | UserProfileData user; | 110 | UserProfileData user; |
111 | // TODO: I'm sure I'll have to do something silly here | 111 | // TODO: I'm sure I'll have to do something silly here |
112 | try | 112 | try |
113 | { | 113 | { |
114 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; | 114 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; |
115 | user.CurrentAgent = GetAgentByUUID(uuid); | 115 | user.CurrentAgent = GetAgentByUUID(uuid); |
116 | } | 116 | } |
117 | catch (ObjectNotFoundException) | 117 | catch (ObjectNotFoundException) |
118 | { | 118 | { |
119 | user = null; | 119 | user = null; |
120 | } | 120 | } |
@@ -144,12 +144,12 @@ namespace OpenSim.Data.NHibernate | |||
144 | } | 144 | } |
145 | else | 145 | else |
146 | { | 146 | { |
147 | try | 147 | try |
148 | { | 148 | { |
149 | UserAgentData old = session.Load(typeof(UserAgentData), uuid) as UserAgentData; | 149 | UserAgentData old = session.Load(typeof(UserAgentData), uuid) as UserAgentData; |
150 | session.Delete(old); | 150 | session.Delete(old); |
151 | } | 151 | } |
152 | catch (ObjectNotFoundException) | 152 | catch (ObjectNotFoundException) |
153 | { | 153 | { |
154 | } | 154 | } |
155 | session.Save(agent); | 155 | session.Save(agent); |
@@ -174,12 +174,12 @@ namespace OpenSim.Data.NHibernate | |||
174 | 174 | ||
175 | override public void AddNewUserAgent(UserAgentData agent) | 175 | override public void AddNewUserAgent(UserAgentData agent) |
176 | { | 176 | { |
177 | try | 177 | try |
178 | { | 178 | { |
179 | UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData; | 179 | UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData; |
180 | session.Delete(old); | 180 | session.Delete(old); |
181 | } | 181 | } |
182 | catch (ObjectNotFoundException) | 182 | catch (ObjectNotFoundException) |
183 | { | 183 | { |
184 | } | 184 | } |
185 | session.Save(agent); | 185 | session.Save(agent); |
@@ -287,9 +287,9 @@ namespace OpenSim.Data.NHibernate | |||
287 | 287 | ||
288 | public override void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) | 288 | public override void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) |
289 | { | 289 | { |
290 | if (appearance == null) | 290 | if (appearance == null) |
291 | return; | 291 | return; |
292 | 292 | ||
293 | appearance.Owner = user; | 293 | appearance.Owner = user; |
294 | 294 | ||
295 | bool exists = ExistsAppearance(user); | 295 | bool exists = ExistsAppearance(user); |
diff --git a/OpenSim/Data/NHibernate/Terrain.cs b/OpenSim/Data/NHibernate/Terrain.cs index a95e45a..608f03e 100644 --- a/OpenSim/Data/NHibernate/Terrain.cs +++ b/OpenSim/Data/NHibernate/Terrain.cs | |||
@@ -32,21 +32,21 @@ using OpenSim.Framework; | |||
32 | using log4net; | 32 | using log4net; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | 34 | ||
35 | namespace OpenSim.Data.NHibernate | 35 | namespace OpenSim.Data.NHibernate |
36 | { | 36 | { |
37 | public class Terrain | 37 | public class Terrain |
38 | { | 38 | { |
39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 39 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | 40 | ||
41 | private double[,] map; | 41 | private double[,] map; |
42 | private LLUUID regionID; | 42 | private LLUUID regionID; |
43 | 43 | ||
44 | public Terrain(LLUUID Region, double[,] array) | 44 | public Terrain(LLUUID Region, double[,] array) |
45 | { | 45 | { |
46 | map = array; | 46 | map = array; |
47 | regionID = Region; | 47 | regionID = Region; |
48 | } | 48 | } |
49 | 49 | ||
50 | public Terrain() | 50 | public Terrain() |
51 | { | 51 | { |
52 | map = new double[Constants.RegionSize, Constants.RegionSize]; | 52 | map = new double[Constants.RegionSize, Constants.RegionSize]; |
@@ -65,7 +65,7 @@ namespace OpenSim.Data.NHibernate | |||
65 | get { return serializeTerrain(map); } | 65 | get { return serializeTerrain(map); } |
66 | set { map = parseTerrain(value); } | 66 | set { map = parseTerrain(value); } |
67 | } | 67 | } |
68 | 68 | ||
69 | public double[,] Doubles | 69 | public double[,] Doubles |
70 | { | 70 | { |
71 | get {return map;} | 71 | get {return map;} |
@@ -76,7 +76,7 @@ namespace OpenSim.Data.NHibernate | |||
76 | { | 76 | { |
77 | double[,] terret = new double[256,256]; | 77 | double[,] terret = new double[256,256]; |
78 | terret.Initialize(); | 78 | terret.Initialize(); |
79 | 79 | ||
80 | MemoryStream str = new MemoryStream(data); | 80 | MemoryStream str = new MemoryStream(data); |
81 | BinaryReader br = new BinaryReader(str); | 81 | BinaryReader br = new BinaryReader(str); |
82 | try { | 82 | try { |
@@ -87,7 +87,7 @@ namespace OpenSim.Data.NHibernate | |||
87 | terret[x, y] = br.ReadDouble(); | 87 | terret[x, y] = br.ReadDouble(); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | } | 90 | } |
91 | catch (Exception e) | 91 | catch (Exception e) |
92 | { | 92 | { |
93 | m_log.Error("Issue parsing Map", e); | 93 | m_log.Error("Issue parsing Map", e); |
@@ -99,7 +99,7 @@ namespace OpenSim.Data.NHibernate | |||
99 | { | 99 | { |
100 | MemoryStream str = new MemoryStream((int)(65536 * sizeof (double))); | 100 | MemoryStream str = new MemoryStream((int)(65536 * sizeof (double))); |
101 | BinaryWriter bw = new BinaryWriter(str); | 101 | BinaryWriter bw = new BinaryWriter(str); |
102 | 102 | ||
103 | // TODO: COMPATIBILITY - Add byte-order conversions | 103 | // TODO: COMPATIBILITY - Add byte-order conversions |
104 | for (int x = 0; x < 256; x++) | 104 | for (int x = 0; x < 256; x++) |
105 | { | 105 | { |
@@ -108,11 +108,11 @@ namespace OpenSim.Data.NHibernate | |||
108 | double height = val[x, y]; | 108 | double height = val[x, y]; |
109 | if (height <= 0.0) | 109 | if (height <= 0.0) |
110 | height = double.Epsilon; | 110 | height = double.Epsilon; |
111 | 111 | ||
112 | bw.Write(height); | 112 | bw.Write(height); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | return str.ToArray(); | 115 | return str.ToArray(); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | } \ No newline at end of file | 118 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 99de5cd..9b274f4 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Data.SQLite | |||
141 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 141 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
142 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 142 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
143 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 143 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
144 | 144 | ||
145 | cmd.ExecuteNonQuery(); | 145 | cmd.ExecuteNonQuery(); |
146 | } | 146 | } |
147 | } | 147 | } |
@@ -155,7 +155,7 @@ namespace OpenSim.Data.SQLite | |||
155 | override public void UpdateAsset(AssetBase asset) | 155 | override public void UpdateAsset(AssetBase asset) |
156 | { | 156 | { |
157 | LogAssetLoad(asset); | 157 | LogAssetLoad(asset); |
158 | 158 | ||
159 | lock (this) | 159 | lock (this) |
160 | { | 160 | { |
161 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) | 161 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) |
@@ -167,7 +167,7 @@ namespace OpenSim.Data.SQLite | |||
167 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 167 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
168 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 168 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
169 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 169 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
170 | 170 | ||
171 | cmd.ExecuteNonQuery(); | 171 | cmd.ExecuteNonQuery(); |
172 | } | 172 | } |
173 | } | 173 | } |
@@ -269,7 +269,7 @@ namespace OpenSim.Data.SQLite | |||
269 | **********************************************************************/ | 269 | **********************************************************************/ |
270 | 270 | ||
271 | /// <summary> | 271 | /// <summary> |
272 | /// | 272 | /// |
273 | /// </summary> | 273 | /// </summary> |
274 | /// <param name="row"></param> | 274 | /// <param name="row"></param> |
275 | /// <returns></returns> | 275 | /// <returns></returns> |
@@ -301,7 +301,7 @@ namespace OpenSim.Data.SQLite | |||
301 | **********************************************************************/ | 301 | **********************************************************************/ |
302 | 302 | ||
303 | /// <summary> | 303 | /// <summary> |
304 | /// | 304 | /// |
305 | /// </summary> | 305 | /// </summary> |
306 | /// <param name="conn"></param> | 306 | /// <param name="conn"></param> |
307 | // private static void InitDB(SqliteConnection conn) | 307 | // private static void InitDB(SqliteConnection conn) |
@@ -312,7 +312,7 @@ namespace OpenSim.Data.SQLite | |||
312 | // } | 312 | // } |
313 | 313 | ||
314 | /// <summary> | 314 | /// <summary> |
315 | /// | 315 | /// |
316 | /// </summary> | 316 | /// </summary> |
317 | /// <param name="conn"></param> | 317 | /// <param name="conn"></param> |
318 | /// <param name="m"></param> | 318 | /// <param name="m"></param> |
@@ -331,10 +331,10 @@ namespace OpenSim.Data.SQLite | |||
331 | m_log.Info("[ASSET DB]: SQLite Database doesn't exist... creating"); | 331 | m_log.Info("[ASSET DB]: SQLite Database doesn't exist... creating"); |
332 | return false; | 332 | return false; |
333 | } | 333 | } |
334 | 334 | ||
335 | // if the tables are here, and we don't have a migration, | 335 | // if the tables are here, and we don't have a migration, |
336 | // set it to 1, as we're migrating off of legacy bits | 336 | // set it to 1, as we're migrating off of legacy bits |
337 | if (m.Version == 0) | 337 | if (m.Version == 0) |
338 | m.Version = 1; | 338 | m.Version = 1; |
339 | 339 | ||
340 | return true; | 340 | return true; |
@@ -343,7 +343,7 @@ namespace OpenSim.Data.SQLite | |||
343 | #region IPlugin interface | 343 | #region IPlugin interface |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
346 | /// | 346 | /// |
347 | /// </summary> | 347 | /// </summary> |
348 | override public string Version | 348 | override public string Version |
349 | { | 349 | { |
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index dc5ba5e..ffe7644 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs | |||
@@ -55,12 +55,12 @@ namespace OpenSim.Data.SQLite | |||
55 | public void Initialise(string connectionString) | 55 | public void Initialise(string connectionString) |
56 | { | 56 | { |
57 | m_connectionString = connectionString; | 57 | m_connectionString = connectionString; |
58 | 58 | ||
59 | m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString); | 59 | m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString); |
60 | 60 | ||
61 | m_connection = new SqliteConnection(m_connectionString); | 61 | m_connection = new SqliteConnection(m_connectionString); |
62 | m_connection.Open(); | 62 | m_connection.Open(); |
63 | 63 | ||
64 | Assembly assem = GetType().Assembly; | 64 | Assembly assem = GetType().Assembly; |
65 | Migration m = new Migration(m_connection, assem, "EstateStore"); | 65 | Migration m = new Migration(m_connection, assem, "EstateStore"); |
66 | m.Update(); | 66 | m.Update(); |
@@ -77,7 +77,7 @@ namespace OpenSim.Data.SQLite | |||
77 | if (f.Name.Substring(0, 2) == "m_") | 77 | if (f.Name.Substring(0, 2) == "m_") |
78 | m_FieldMap[f.Name.Substring(2)] = f; | 78 | m_FieldMap[f.Name.Substring(2)] = f; |
79 | } | 79 | } |
80 | 80 | ||
81 | private string[] FieldList | 81 | private string[] FieldList |
82 | { | 82 | { |
83 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } | 83 | get { return new List<string>(m_FieldMap.Keys).ToArray(); } |
@@ -134,7 +134,7 @@ namespace OpenSim.Data.SQLite | |||
134 | names.Remove("EstateID"); | 134 | names.Remove("EstateID"); |
135 | 135 | ||
136 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; | 136 | sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; |
137 | 137 | ||
138 | cmd.CommandText = sql; | 138 | cmd.CommandText = sql; |
139 | cmd.Parameters.Clear(); | 139 | cmd.Parameters.Clear(); |
140 | 140 | ||
@@ -272,16 +272,16 @@ namespace OpenSim.Data.SQLite | |||
272 | private void SaveBanList(EstateSettings es) | 272 | private void SaveBanList(EstateSettings es) |
273 | { | 273 | { |
274 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 274 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
275 | 275 | ||
276 | cmd.CommandText = "delete from estateban where EstateID = :EstateID"; | 276 | cmd.CommandText = "delete from estateban where EstateID = :EstateID"; |
277 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); | 277 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); |
278 | 278 | ||
279 | cmd.ExecuteNonQuery(); | 279 | cmd.ExecuteNonQuery(); |
280 | 280 | ||
281 | cmd.Parameters.Clear(); | 281 | cmd.Parameters.Clear(); |
282 | 282 | ||
283 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; | 283 | cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; |
284 | 284 | ||
285 | foreach (EstateBan b in es.EstateBans) | 285 | foreach (EstateBan b in es.EstateBans) |
286 | { | 286 | { |
287 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); | 287 | cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); |
@@ -295,16 +295,16 @@ namespace OpenSim.Data.SQLite | |||
295 | void SaveUUIDList(uint EstateID, string table, LLUUID[] data) | 295 | void SaveUUIDList(uint EstateID, string table, LLUUID[] data) |
296 | { | 296 | { |
297 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 297 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
298 | 298 | ||
299 | cmd.CommandText = "delete from "+table+" where EstateID = :EstateID"; | 299 | cmd.CommandText = "delete from "+table+" where EstateID = :EstateID"; |
300 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); | 300 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); |
301 | 301 | ||
302 | cmd.ExecuteNonQuery(); | 302 | cmd.ExecuteNonQuery(); |
303 | 303 | ||
304 | cmd.Parameters.Clear(); | 304 | cmd.Parameters.Clear(); |
305 | 305 | ||
306 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; | 306 | cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )"; |
307 | 307 | ||
308 | foreach (LLUUID uuid in data) | 308 | foreach (LLUUID uuid in data) |
309 | { | 309 | { |
310 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); | 310 | cmd.Parameters.Add(":EstateID", EstateID.ToString()); |
@@ -336,7 +336,7 @@ namespace OpenSim.Data.SQLite | |||
336 | uuids.Add(uuid); | 336 | uuids.Add(uuid); |
337 | } | 337 | } |
338 | r.Close(); | 338 | r.Close(); |
339 | 339 | ||
340 | return uuids.ToArray(); | 340 | return uuids.ToArray(); |
341 | } | 341 | } |
342 | } | 342 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index e29b99c..125b6e7 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |||
@@ -50,8 +50,8 @@ namespace OpenSim.Data.SQLite | |||
50 | private SqliteDataAdapter invItemsDa; | 50 | private SqliteDataAdapter invItemsDa; |
51 | private SqliteDataAdapter invFoldersDa; | 51 | private SqliteDataAdapter invFoldersDa; |
52 | 52 | ||
53 | public void Initialise() | 53 | public void Initialise() |
54 | { | 54 | { |
55 | m_log.Info("[SQLiteInventoryData]: " + Name + " cannot be default-initialized!"); | 55 | m_log.Info("[SQLiteInventoryData]: " + Name + " cannot be default-initialized!"); |
56 | throw new PluginNotInitialisedException (Name); | 56 | throw new PluginNotInitialisedException (Name); |
57 | } | 57 | } |
@@ -105,7 +105,7 @@ namespace OpenSim.Data.SQLite | |||
105 | } | 105 | } |
106 | 106 | ||
107 | /// <summary> | 107 | /// <summary> |
108 | /// | 108 | /// |
109 | /// </summary> | 109 | /// </summary> |
110 | /// <param name="row"></param> | 110 | /// <param name="row"></param> |
111 | /// <returns></returns> | 111 | /// <returns></returns> |
@@ -150,7 +150,7 @@ namespace OpenSim.Data.SQLite | |||
150 | } | 150 | } |
151 | 151 | ||
152 | /// <summary> | 152 | /// <summary> |
153 | /// | 153 | /// |
154 | /// </summary> | 154 | /// </summary> |
155 | /// <param name="row"></param> | 155 | /// <param name="row"></param> |
156 | /// <param name="item"></param> | 156 | /// <param name="item"></param> |
@@ -302,7 +302,7 @@ namespace OpenSim.Data.SQLite | |||
302 | /// <returns>A string containing the DB provider version</returns> | 302 | /// <returns>A string containing the DB provider version</returns> |
303 | public string Version | 303 | public string Version |
304 | { | 304 | { |
305 | get | 305 | get |
306 | { | 306 | { |
307 | Module module = GetType().Module; | 307 | Module module = GetType().Module; |
308 | // string dllName = module.Assembly.ManifestModule.Name; | 308 | // string dllName = module.Assembly.ManifestModule.Name; |
@@ -419,10 +419,10 @@ namespace OpenSim.Data.SQLite | |||
419 | * - We will only need to hit the database twice instead of n times. | 419 | * - We will only need to hit the database twice instead of n times. |
420 | * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned | 420 | * - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned |
421 | * by the same person, each user only has 1 inventory heirarchy | 421 | * by the same person, each user only has 1 inventory heirarchy |
422 | * - The returned list is not ordered, instead of breadth-first ordered | 422 | * - The returned list is not ordered, instead of breadth-first ordered |
423 | There are basically 2 usage cases for getFolderHeirarchy: | 423 | There are basically 2 usage cases for getFolderHeirarchy: |
424 | 1) Getting the user's entire inventory heirarchy when they log in | 424 | 1) Getting the user's entire inventory heirarchy when they log in |
425 | 2) Finding a subfolder heirarchy to delete when emptying the trash. | 425 | 2) Finding a subfolder heirarchy to delete when emptying the trash. |
426 | This implementation will pull all inventory folders from the database, and then prune away any folder that | 426 | This implementation will pull all inventory folders from the database, and then prune away any folder that |
427 | is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the | 427 | is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the |
428 | database than to make n requests. This pays off only if requested heirarchy is large. | 428 | database than to make n requests. This pays off only if requested heirarchy is large. |
@@ -449,17 +449,17 @@ namespace OpenSim.Data.SQLite | |||
449 | folderRows = inventoryFolderTable.Select(selectExp); | 449 | folderRows = inventoryFolderTable.Select(selectExp); |
450 | } | 450 | } |
451 | 451 | ||
452 | if ( folderRows!=null && folderRows.GetLength(0)>=1 ) // No result means parent folder does not exist | 452 | if (folderRows != null && folderRows.GetLength(0) >= 1) // No result means parent folder does not exist |
453 | { // or has no children | 453 | { // or has no children |
454 | /* if we're querying the root folder, just return an unordered list of all folders in the user's | 454 | /* if we're querying the root folder, just return an unordered list of all folders in the user's |
455 | * inventory | 455 | * inventory |
456 | */ | 456 | */ |
457 | if (parentFolder.ParentID == LLUUID.Zero) | 457 | if (parentFolder.ParentID == LLUUID.Zero) |
458 | { | 458 | { |
459 | foreach (DataRow row in folderRows) | 459 | foreach (DataRow row in folderRows) |
460 | { | 460 | { |
461 | InventoryFolderBase curFolder = buildFolder(row); | 461 | InventoryFolderBase curFolder = buildFolder(row); |
462 | if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy | 462 | if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy |
463 | folders.Add(buildFolder(row)); | 463 | folders.Add(buildFolder(row)); |
464 | } | 464 | } |
465 | } // If requesting root folder | 465 | } // If requesting root folder |
@@ -481,16 +481,16 @@ namespace OpenSim.Data.SQLite | |||
481 | InventoryFolderBase curFolder = buildFolder(row); | 481 | InventoryFolderBase curFolder = buildFolder(row); |
482 | if (curFolder.ParentID != LLUUID.Zero) // Discard root of tree - not needed | 482 | if (curFolder.ParentID != LLUUID.Zero) // Discard root of tree - not needed |
483 | { | 483 | { |
484 | if ( hashtable.ContainsKey(curFolder.ParentID ) ) | 484 | if (hashtable.ContainsKey(curFolder.ParentID)) |
485 | { | 485 | { |
486 | // Current folder already has a sibling - append to sibling list | 486 | // Current folder already has a sibling - append to sibling list |
487 | hashtable[curFolder.ParentID].Add( curFolder ); | 487 | hashtable[curFolder.ParentID].Add(curFolder); |
488 | } | 488 | } |
489 | else { | 489 | else { |
490 | List<InventoryFolderBase> siblingList = new List<InventoryFolderBase>(); | 490 | List<InventoryFolderBase> siblingList = new List<InventoryFolderBase>(); |
491 | siblingList.Add( curFolder ); | 491 | siblingList.Add(curFolder); |
492 | // Current folder has no known (yet) siblings | 492 | // Current folder has no known (yet) siblings |
493 | hashtable.Add( curFolder.ParentID, siblingList ); | 493 | hashtable.Add(curFolder.ParentID, siblingList); |
494 | } | 494 | } |
495 | } | 495 | } |
496 | } // For all inventory folders | 496 | } // For all inventory folders |
@@ -498,12 +498,12 @@ namespace OpenSim.Data.SQLite | |||
498 | // Note: Could release the ds lock here - we don't access folderRows or the database anymore. | 498 | // Note: Could release the ds lock here - we don't access folderRows or the database anymore. |
499 | // This is somewhat of a moot point as the callers of this function usually lock db anyways. | 499 | // This is somewhat of a moot point as the callers of this function usually lock db anyways. |
500 | 500 | ||
501 | if ( hashtable.ContainsKey( parentID ) ) // if requested folder does have children | 501 | if (hashtable.ContainsKey(parentID)) // if requested folder does have children |
502 | folders.AddRange( hashtable[parentID] ); | 502 | folders.AddRange(hashtable[parentID]); |
503 | 503 | ||
504 | // BreadthFirstSearch build inventory tree **Note: folders.Count is *not* static | 504 | // BreadthFirstSearch build inventory tree **Note: folders.Count is *not* static |
505 | for ( int i = 0; i < folders.Count; i++ ) | 505 | for (int i = 0; i < folders.Count; i++) |
506 | if (hashtable.ContainsKey(folders[i].ID)) | 506 | if (hashtable.ContainsKey(folders[i].ID)) |
507 | folders.AddRange(hashtable[folders[i].ID]); | 507 | folders.AddRange(hashtable[folders[i].ID]); |
508 | 508 | ||
509 | } // if requesting a subfolder heirarchy | 509 | } // if requesting a subfolder heirarchy |
@@ -601,7 +601,7 @@ namespace OpenSim.Data.SQLite | |||
601 | /// Delete all items in the specified folder | 601 | /// Delete all items in the specified folder |
602 | /// </summary> | 602 | /// </summary> |
603 | /// <param name="folderId">id of the folder, whose item content should be deleted</param> | 603 | /// <param name="folderId">id of the folder, whose item content should be deleted</param> |
604 | /// <todo>this is horribly inefficient, but I don't want to ruin the overall structure of this implementation</todo> | 604 | /// <todo>this is horribly inefficient, but I don't want to ruin the overall structure of this implementation</todo> |
605 | private void deleteItemsInFolder(LLUUID folderId) | 605 | private void deleteItemsInFolder(LLUUID folderId) |
606 | { | 606 | { |
607 | List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId)); | 607 | List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId)); |
@@ -743,7 +743,7 @@ namespace OpenSim.Data.SQLite | |||
743 | } | 743 | } |
744 | 744 | ||
745 | /// <summary> | 745 | /// <summary> |
746 | /// | 746 | /// |
747 | /// </summary> | 747 | /// </summary> |
748 | /// <param name="da"></param> | 748 | /// <param name="da"></param> |
749 | /// <param name="conn"></param> | 749 | /// <param name="conn"></param> |
@@ -765,7 +765,7 @@ namespace OpenSim.Data.SQLite | |||
765 | } | 765 | } |
766 | 766 | ||
767 | /// <summary> | 767 | /// <summary> |
768 | /// | 768 | /// |
769 | /// </summary> | 769 | /// </summary> |
770 | /// <param name="da"></param> | 770 | /// <param name="da"></param> |
771 | /// <param name="conn"></param> | 771 | /// <param name="conn"></param> |
@@ -787,7 +787,7 @@ namespace OpenSim.Data.SQLite | |||
787 | } | 787 | } |
788 | 788 | ||
789 | /// <summary> | 789 | /// <summary> |
790 | /// | 790 | /// |
791 | /// </summary> | 791 | /// </summary> |
792 | /// <param name="row"></param> | 792 | /// <param name="row"></param> |
793 | /// <returns></returns> | 793 | /// <returns></returns> |
@@ -804,7 +804,7 @@ namespace OpenSim.Data.SQLite | |||
804 | } | 804 | } |
805 | 805 | ||
806 | /// <summary> | 806 | /// <summary> |
807 | /// | 807 | /// |
808 | /// </summary> | 808 | /// </summary> |
809 | /// <param name="row"></param> | 809 | /// <param name="row"></param> |
810 | /// <param name="folder"></param> | 810 | /// <param name="folder"></param> |
@@ -819,7 +819,7 @@ namespace OpenSim.Data.SQLite | |||
819 | } | 819 | } |
820 | 820 | ||
821 | /// <summary> | 821 | /// <summary> |
822 | /// | 822 | /// |
823 | /// </summary> | 823 | /// </summary> |
824 | /// <param name="row"></param> | 824 | /// <param name="row"></param> |
825 | /// <param name="folder"></param> | 825 | /// <param name="folder"></param> |
@@ -836,7 +836,7 @@ namespace OpenSim.Data.SQLite | |||
836 | **********************************************************************/ | 836 | **********************************************************************/ |
837 | 837 | ||
838 | /// <summary> | 838 | /// <summary> |
839 | /// | 839 | /// |
840 | /// </summary> | 840 | /// </summary> |
841 | /// <param name="conn"></param> | 841 | /// <param name="conn"></param> |
842 | // private static void InitDB(SqliteConnection conn) | 842 | // private static void InitDB(SqliteConnection conn) |
@@ -852,7 +852,7 @@ namespace OpenSim.Data.SQLite | |||
852 | // } | 852 | // } |
853 | 853 | ||
854 | /// <summary> | 854 | /// <summary> |
855 | /// | 855 | /// |
856 | /// </summary> | 856 | /// </summary> |
857 | /// <param name="conn"></param> | 857 | /// <param name="conn"></param> |
858 | /// <param name="m"></param> | 858 | /// <param name="m"></param> |
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index b937272..a44b892 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -501,7 +501,7 @@ namespace OpenSim.Data.SQLite | |||
501 | } | 501 | } |
502 | 502 | ||
503 | /// <summary> | 503 | /// <summary> |
504 | /// | 504 | /// |
505 | /// </summary> | 505 | /// </summary> |
506 | /// <param name="globalID"></param> | 506 | /// <param name="globalID"></param> |
507 | public void RemoveLandObject(LLUUID globalID) | 507 | public void RemoveLandObject(LLUUID globalID) |
@@ -523,7 +523,7 @@ namespace OpenSim.Data.SQLite | |||
523 | } | 523 | } |
524 | 524 | ||
525 | /// <summary> | 525 | /// <summary> |
526 | /// | 526 | /// |
527 | /// </summary> | 527 | /// </summary> |
528 | /// <param name="parcel"></param> | 528 | /// <param name="parcel"></param> |
529 | public void StoreLandObject(ILandObject parcel) | 529 | public void StoreLandObject(ILandObject parcel) |
@@ -564,7 +564,7 @@ namespace OpenSim.Data.SQLite | |||
564 | } | 564 | } |
565 | 565 | ||
566 | /// <summary> | 566 | /// <summary> |
567 | /// | 567 | /// |
568 | /// </summary> | 568 | /// </summary> |
569 | /// <param name="regionUUID"></param> | 569 | /// <param name="regionUUID"></param> |
570 | /// <returns></returns> | 570 | /// <returns></returns> |
@@ -594,7 +594,7 @@ namespace OpenSim.Data.SQLite | |||
594 | } | 594 | } |
595 | 595 | ||
596 | /// <summary> | 596 | /// <summary> |
597 | /// | 597 | /// |
598 | /// </summary> | 598 | /// </summary> |
599 | public void Commit() | 599 | public void Commit() |
600 | { | 600 | { |
@@ -629,7 +629,7 @@ namespace OpenSim.Data.SQLite | |||
629 | **********************************************************************/ | 629 | **********************************************************************/ |
630 | 630 | ||
631 | /// <summary> | 631 | /// <summary> |
632 | /// | 632 | /// |
633 | /// </summary> | 633 | /// </summary> |
634 | /// <param name="dt"></param> | 634 | /// <param name="dt"></param> |
635 | /// <param name="name"></param> | 635 | /// <param name="name"></param> |
@@ -877,7 +877,7 @@ namespace OpenSim.Data.SQLite | |||
877 | **********************************************************************/ | 877 | **********************************************************************/ |
878 | 878 | ||
879 | /// <summary> | 879 | /// <summary> |
880 | /// | 880 | /// |
881 | /// </summary> | 881 | /// </summary> |
882 | /// <param name="row"></param> | 882 | /// <param name="row"></param> |
883 | /// <returns></returns> | 883 | /// <returns></returns> |
@@ -1071,7 +1071,7 @@ namespace OpenSim.Data.SQLite | |||
1071 | newData.UserLookAt = | 1071 | newData.UserLookAt = |
1072 | new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), | 1072 | new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), |
1073 | Convert.ToSingle(row["UserLookAtZ"])); | 1073 | Convert.ToSingle(row["UserLookAtZ"])); |
1074 | 1074 | ||
1075 | } | 1075 | } |
1076 | catch (InvalidCastException) | 1076 | catch (InvalidCastException) |
1077 | { | 1077 | { |
@@ -1132,7 +1132,7 @@ namespace OpenSim.Data.SQLite | |||
1132 | } | 1132 | } |
1133 | 1133 | ||
1134 | /// <summary> | 1134 | /// <summary> |
1135 | /// | 1135 | /// |
1136 | /// </summary> | 1136 | /// </summary> |
1137 | /// <param name="val"></param> | 1137 | /// <param name="val"></param> |
1138 | /// <returns></returns> | 1138 | /// <returns></returns> |
@@ -1166,7 +1166,7 @@ namespace OpenSim.Data.SQLite | |||
1166 | // } | 1166 | // } |
1167 | 1167 | ||
1168 | /// <summary> | 1168 | /// <summary> |
1169 | /// | 1169 | /// |
1170 | /// </summary> | 1170 | /// </summary> |
1171 | /// <param name="row"></param> | 1171 | /// <param name="row"></param> |
1172 | /// <param name="prim"></param> | 1172 | /// <param name="prim"></param> |
@@ -1233,7 +1233,7 @@ namespace OpenSim.Data.SQLite | |||
1233 | } | 1233 | } |
1234 | 1234 | ||
1235 | /// <summary> | 1235 | /// <summary> |
1236 | /// | 1236 | /// |
1237 | /// </summary> | 1237 | /// </summary> |
1238 | /// <param name="row"></param> | 1238 | /// <param name="row"></param> |
1239 | /// <param name="taskItem"></param> | 1239 | /// <param name="taskItem"></param> |
@@ -1263,7 +1263,7 @@ namespace OpenSim.Data.SQLite | |||
1263 | } | 1263 | } |
1264 | 1264 | ||
1265 | /// <summary> | 1265 | /// <summary> |
1266 | /// | 1266 | /// |
1267 | /// </summary> | 1267 | /// </summary> |
1268 | /// <param name="row"></param> | 1268 | /// <param name="row"></param> |
1269 | /// <param name="land"></param> | 1269 | /// <param name="land"></param> |
@@ -1308,7 +1308,7 @@ namespace OpenSim.Data.SQLite | |||
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | /// <summary> | 1310 | /// <summary> |
1311 | /// | 1311 | /// |
1312 | /// </summary> | 1312 | /// </summary> |
1313 | /// <param name="row"></param> | 1313 | /// <param name="row"></param> |
1314 | /// <param name="entry"></param> | 1314 | /// <param name="entry"></param> |
@@ -1321,7 +1321,7 @@ namespace OpenSim.Data.SQLite | |||
1321 | } | 1321 | } |
1322 | 1322 | ||
1323 | /// <summary> | 1323 | /// <summary> |
1324 | /// | 1324 | /// |
1325 | /// </summary> | 1325 | /// </summary> |
1326 | /// <param name="row"></param> | 1326 | /// <param name="row"></param> |
1327 | /// <returns></returns> | 1327 | /// <returns></returns> |
@@ -1376,7 +1376,7 @@ namespace OpenSim.Data.SQLite | |||
1376 | } | 1376 | } |
1377 | 1377 | ||
1378 | /// <summary> | 1378 | /// <summary> |
1379 | /// | 1379 | /// |
1380 | /// </summary> | 1380 | /// </summary> |
1381 | /// <param name="row"></param> | 1381 | /// <param name="row"></param> |
1382 | /// <param name="prim"></param> | 1382 | /// <param name="prim"></param> |
@@ -1418,7 +1418,7 @@ namespace OpenSim.Data.SQLite | |||
1418 | } | 1418 | } |
1419 | 1419 | ||
1420 | /// <summary> | 1420 | /// <summary> |
1421 | /// | 1421 | /// |
1422 | /// </summary> | 1422 | /// </summary> |
1423 | /// <param name="prim"></param> | 1423 | /// <param name="prim"></param> |
1424 | /// <param name="sceneGroupID"></param> | 1424 | /// <param name="sceneGroupID"></param> |
@@ -1574,7 +1574,7 @@ namespace OpenSim.Data.SQLite | |||
1574 | } | 1574 | } |
1575 | 1575 | ||
1576 | /// <summary> | 1576 | /// <summary> |
1577 | /// | 1577 | /// |
1578 | /// </summary> | 1578 | /// </summary> |
1579 | /// <param name="dt">Data Table</param> | 1579 | /// <param name="dt">Data Table</param> |
1580 | /// <returns></returns> | 1580 | /// <returns></returns> |
@@ -1631,7 +1631,7 @@ namespace OpenSim.Data.SQLite | |||
1631 | } | 1631 | } |
1632 | 1632 | ||
1633 | /// <summary> | 1633 | /// <summary> |
1634 | /// | 1634 | /// |
1635 | /// </summary> | 1635 | /// </summary> |
1636 | /// <param name="da"></param> | 1636 | /// <param name="da"></param> |
1637 | /// <param name="conn"></param> | 1637 | /// <param name="conn"></param> |
@@ -1650,7 +1650,7 @@ namespace OpenSim.Data.SQLite | |||
1650 | } | 1650 | } |
1651 | 1651 | ||
1652 | /// <summary> | 1652 | /// <summary> |
1653 | /// | 1653 | /// |
1654 | /// </summary> | 1654 | /// </summary> |
1655 | /// <param name="da"></param> | 1655 | /// <param name="da"></param> |
1656 | /// <param name="conn"></param> | 1656 | /// <param name="conn"></param> |
@@ -1669,7 +1669,7 @@ namespace OpenSim.Data.SQLite | |||
1669 | } | 1669 | } |
1670 | 1670 | ||
1671 | /// <summary> | 1671 | /// <summary> |
1672 | /// | 1672 | /// |
1673 | /// </summary> | 1673 | /// </summary> |
1674 | /// <param name="da"></param> | 1674 | /// <param name="da"></param> |
1675 | /// <param name="conn"></param> | 1675 | /// <param name="conn"></param> |
@@ -1680,7 +1680,7 @@ namespace OpenSim.Data.SQLite | |||
1680 | } | 1680 | } |
1681 | 1681 | ||
1682 | /// <summary> | 1682 | /// <summary> |
1683 | /// | 1683 | /// |
1684 | /// </summary> | 1684 | /// </summary> |
1685 | /// <param name="da"></param> | 1685 | /// <param name="da"></param> |
1686 | /// <param name="conn"></param> | 1686 | /// <param name="conn"></param> |
@@ -1694,7 +1694,7 @@ namespace OpenSim.Data.SQLite | |||
1694 | } | 1694 | } |
1695 | 1695 | ||
1696 | /// <summary> | 1696 | /// <summary> |
1697 | /// | 1697 | /// |
1698 | /// </summary> | 1698 | /// </summary> |
1699 | /// <param name="da"></param> | 1699 | /// <param name="da"></param> |
1700 | /// <param name="conn"></param> | 1700 | /// <param name="conn"></param> |
@@ -1705,7 +1705,7 @@ namespace OpenSim.Data.SQLite | |||
1705 | } | 1705 | } |
1706 | 1706 | ||
1707 | /// <summary> | 1707 | /// <summary> |
1708 | /// | 1708 | /// |
1709 | /// </summary> | 1709 | /// </summary> |
1710 | /// <param name="da"></param> | 1710 | /// <param name="da"></param> |
1711 | /// <param name="conn"></param> | 1711 | /// <param name="conn"></param> |
@@ -1799,7 +1799,7 @@ namespace OpenSim.Data.SQLite | |||
1799 | // } | 1799 | // } |
1800 | 1800 | ||
1801 | /// <summary> | 1801 | /// <summary> |
1802 | /// | 1802 | /// |
1803 | /// </summary> | 1803 | /// </summary> |
1804 | /// <param name="conn"></param> | 1804 | /// <param name="conn"></param> |
1805 | /// <param name="m"></param> | 1805 | /// <param name="m"></param> |
@@ -1845,8 +1845,8 @@ namespace OpenSim.Data.SQLite | |||
1845 | // if we've gotten this far, and our version is still 0, | 1845 | // if we've gotten this far, and our version is still 0, |
1846 | // it's because the migration was never done, so | 1846 | // it's because the migration was never done, so |
1847 | // initialize to 1 just to sync up to where we should be. | 1847 | // initialize to 1 just to sync up to where we should be. |
1848 | 1848 | ||
1849 | if (m.Version == 0) | 1849 | if (m.Version == 0) |
1850 | m.Version = 1; | 1850 | m.Version = 1; |
1851 | 1851 | ||
1852 | // pDa.Fill(tmpDS, "prims"); | 1852 | // pDa.Fill(tmpDS, "prims"); |
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 910d313..08a97f09 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs | |||
@@ -65,8 +65,8 @@ namespace OpenSim.Data.SQLite | |||
65 | private SqliteDataAdapter daf; | 65 | private SqliteDataAdapter daf; |
66 | SqliteConnection g_conn; | 66 | SqliteConnection g_conn; |
67 | 67 | ||
68 | public override void Initialise() | 68 | public override void Initialise() |
69 | { | 69 | { |
70 | m_log.Info("[SQLiteUserData]: " + Name + " cannot be default-initialized!"); | 70 | m_log.Info("[SQLiteUserData]: " + Name + " cannot be default-initialized!"); |
71 | throw new PluginNotInitialisedException (Name); | 71 | throw new PluginNotInitialisedException (Name); |
72 | } | 72 | } |
@@ -93,7 +93,7 @@ namespace OpenSim.Data.SQLite | |||
93 | 93 | ||
94 | Assembly assem = GetType().Assembly; | 94 | Assembly assem = GetType().Assembly; |
95 | Migration m = new Migration(g_conn, assem, "UserStore"); | 95 | Migration m = new Migration(g_conn, assem, "UserStore"); |
96 | 96 | ||
97 | // TODO: remove this after rev 6000 | 97 | // TODO: remove this after rev 6000 |
98 | TestTables(conn, m); | 98 | TestTables(conn, m); |
99 | 99 | ||
@@ -130,7 +130,7 @@ namespace OpenSim.Data.SQLite | |||
130 | return; | 130 | return; |
131 | } | 131 | } |
132 | 132 | ||
133 | public override void Dispose () {} | 133 | public override void Dispose () {} |
134 | 134 | ||
135 | /// <summary> | 135 | /// <summary> |
136 | /// see IUserDataPlugin, | 136 | /// see IUserDataPlugin, |
@@ -308,7 +308,7 @@ namespace OpenSim.Data.SQLite | |||
308 | } | 308 | } |
309 | 309 | ||
310 | /// <summary> | 310 | /// <summary> |
311 | /// | 311 | /// |
312 | /// </summary> | 312 | /// </summary> |
313 | /// <param name="queryID"></param> | 313 | /// <param name="queryID"></param> |
314 | /// <param name="query"></param> | 314 | /// <param name="query"></param> |
@@ -570,7 +570,7 @@ namespace OpenSim.Data.SQLite | |||
570 | } | 570 | } |
571 | return aa; | 571 | return aa; |
572 | } | 572 | } |
573 | 573 | ||
574 | /// <summary> | 574 | /// <summary> |
575 | /// Update a user appearence | 575 | /// Update a user appearence |
576 | /// </summary> | 576 | /// </summary> |
@@ -802,7 +802,7 @@ namespace OpenSim.Data.SQLite | |||
802 | } | 802 | } |
803 | 803 | ||
804 | /// <summary> | 804 | /// <summary> |
805 | /// | 805 | /// |
806 | /// </summary> | 806 | /// </summary> |
807 | /// <param name="row"></param> | 807 | /// <param name="row"></param> |
808 | /// <param name="user"></param> | 808 | /// <param name="user"></param> |
@@ -853,7 +853,7 @@ namespace OpenSim.Data.SQLite | |||
853 | } | 853 | } |
854 | 854 | ||
855 | /// <summary> | 855 | /// <summary> |
856 | /// | 856 | /// |
857 | /// </summary> | 857 | /// </summary> |
858 | /// <param name="row"></param> | 858 | /// <param name="row"></param> |
859 | /// <returns></returns> | 859 | /// <returns></returns> |
@@ -881,7 +881,7 @@ namespace OpenSim.Data.SQLite | |||
881 | } | 881 | } |
882 | 882 | ||
883 | /// <summary> | 883 | /// <summary> |
884 | /// | 884 | /// |
885 | /// </summary> | 885 | /// </summary> |
886 | /// <param name="row"></param> | 886 | /// <param name="row"></param> |
887 | /// <param name="ua"></param> | 887 | /// <param name="ua"></param> |
@@ -914,7 +914,7 @@ namespace OpenSim.Data.SQLite | |||
914 | **********************************************************************/ | 914 | **********************************************************************/ |
915 | 915 | ||
916 | /// <summary> | 916 | /// <summary> |
917 | /// | 917 | /// |
918 | /// </summary> | 918 | /// </summary> |
919 | /// <param name="da"></param> | 919 | /// <param name="da"></param> |
920 | /// <param name="conn"></param> | 920 | /// <param name="conn"></param> |
@@ -933,7 +933,7 @@ namespace OpenSim.Data.SQLite | |||
933 | } | 933 | } |
934 | 934 | ||
935 | /// <summary> | 935 | /// <summary> |
936 | /// | 936 | /// |
937 | /// </summary> | 937 | /// </summary> |
938 | /// <param name="daf"></param> | 938 | /// <param name="daf"></param> |
939 | /// <param name="conn"></param> | 939 | /// <param name="conn"></param> |
@@ -954,7 +954,7 @@ namespace OpenSim.Data.SQLite | |||
954 | } | 954 | } |
955 | 955 | ||
956 | /// <summary> | 956 | /// <summary> |
957 | /// | 957 | /// |
958 | /// </summary> | 958 | /// </summary> |
959 | /// <param name="conn"></param> | 959 | /// <param name="conn"></param> |
960 | private static void InitDB(SqliteConnection conn) | 960 | private static void InitDB(SqliteConnection conn) |
@@ -990,7 +990,7 @@ namespace OpenSim.Data.SQLite | |||
990 | } | 990 | } |
991 | 991 | ||
992 | /// <summary> | 992 | /// <summary> |
993 | /// | 993 | /// |
994 | /// </summary> | 994 | /// </summary> |
995 | /// <param name="conn"></param> | 995 | /// <param name="conn"></param> |
996 | /// <param name="m"></param> | 996 | /// <param name="m"></param> |
@@ -1016,7 +1016,7 @@ namespace OpenSim.Data.SQLite | |||
1016 | return false; | 1016 | return false; |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | if (m.Version == 0) | 1019 | if (m.Version == 0) |
1020 | m.Version = 1; | 1020 | m.Version = 1; |
1021 | 1021 | ||
1022 | return true; | 1022 | return true; |
diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs index e604bfd..b984c10 100644 --- a/OpenSim/Data/UserDataBase.cs +++ b/OpenSim/Data/UserDataBase.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Data | |||
75 | public abstract void AddAttachment(LLUUID user, LLUUID item); | 75 | public abstract void AddAttachment(LLUUID user, LLUUID item); |
76 | public abstract void RemoveAttachment(LLUUID user, LLUUID item); | 76 | public abstract void RemoveAttachment(LLUUID user, LLUUID item); |
77 | public abstract List<LLUUID> GetAttachments(LLUUID user); | 77 | public abstract List<LLUUID> GetAttachments(LLUUID user); |
78 | 78 | ||
79 | public abstract string Version {get;} | 79 | public abstract string Version {get;} |
80 | public abstract string Name {get;} | 80 | public abstract string Name {get;} |
81 | public abstract void Initialise(string connect); | 81 | public abstract void Initialise(string connect); |