aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLEstateData.cs
diff options
context:
space:
mode:
authorMelanie2012-01-22 11:36:04 +0000
committerMelanie2012-01-22 11:36:04 +0000
commit68365c20c0b3a3164881398f3bc3710f7960c52d (patch)
treebef00ac36c0dc8f33c1df3066c9d0e09dbb71aa9 /OpenSim/Data/MySQL/MySQLEstateData.cs
parentTelehub Support: (diff)
downloadopensim-SC_OLD-68365c20c0b3a3164881398f3bc3710f7960c52d.zip
opensim-SC_OLD-68365c20c0b3a3164881398f3bc3710f7960c52d.tar.gz
opensim-SC_OLD-68365c20c0b3a3164881398f3bc3710f7960c52d.tar.bz2
opensim-SC_OLD-68365c20c0b3a3164881398f3bc3710f7960c52d.tar.xz
Move Telehub tables and data from EstateSettings to RegionSettings.
This is damage control es EstateSettings is not the place this can be put. EstateSettings is nt unique to a region and therefore would introduce a hard limit of one telehub per estate, completely shutting off the option of having SL style telehubs, e.g. one per region. Whole estate teleport routing can still be implemented id desiresd, this way all options are open while the other way most options get closed off.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLEstateData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs65
1 files changed, 0 insertions, 65 deletions
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index a357268..3dd46cb 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -157,7 +157,6 @@ namespace OpenSim.Data.MySQL
157 DoCreate(es); 157 DoCreate(es);
158 158
159 LoadBanList(es); 159 LoadBanList(es);
160 LoadSpawnPoints(es);
161 160
162 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers"); 161 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
163 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users"); 162 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
@@ -211,7 +210,6 @@ namespace OpenSim.Data.MySQL
211 } 210 }
212 211
213 LoadBanList(es); 212 LoadBanList(es);
214 LoadSpawnPoints(es);
215 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers"); 213 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
216 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users"); 214 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
217 es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups"); 215 es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
@@ -298,74 +296,11 @@ namespace OpenSim.Data.MySQL
298 } 296 }
299 297
300 SaveBanList(es); 298 SaveBanList(es);
301 SaveSpawnPoints(es);
302 SaveUUIDList(es.EstateID, "estate_managers", es.EstateManagers); 299 SaveUUIDList(es.EstateID, "estate_managers", es.EstateManagers);
303 SaveUUIDList(es.EstateID, "estate_users", es.EstateAccess); 300 SaveUUIDList(es.EstateID, "estate_users", es.EstateAccess);
304 SaveUUIDList(es.EstateID, "estate_groups", es.EstateGroups); 301 SaveUUIDList(es.EstateID, "estate_groups", es.EstateGroups);
305 } 302 }
306 303
307 private void LoadSpawnPoints(EstateSettings es)
308 {
309 es.ClearSpawnPoints();
310
311 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
312 {
313 dbcon.Open();
314
315 using (MySqlCommand cmd = dbcon.CreateCommand())
316 {
317 uint EstateID = es.EstateID;
318 cmd.CommandText = "select PointX, PointY, PointZ from spawn_points where EstateID = ?EstateID";
319 cmd.Parameters.AddWithValue("?EstateID", es.EstateID);
320
321 using (IDataReader r = cmd.ExecuteReader())
322 {
323 while (r.Read())
324 {
325 Vector3 point = new Vector3();
326
327 point.X = (float)r["PointX"];
328 point.Y = (float)r["PointY"];
329 point.Z = (float)r["PointZ"];
330
331 es.AddSpawnPoint(point);
332 }
333 }
334 }
335 }
336 }
337
338 private void SaveSpawnPoints(EstateSettings es)
339 {
340 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
341 {
342 dbcon.Open();
343
344 using (MySqlCommand cmd = dbcon.CreateCommand())
345 {
346 cmd.CommandText = "delete from spawn_points where EstateID = ?EstateID";
347 cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
348
349 cmd.ExecuteNonQuery();
350
351 cmd.Parameters.Clear();
352
353 cmd.CommandText = "insert into spawn_points (EstateID, PointX, PointY, PointZ) values ( ?EstateID, ?PointX, ?PointY,?PointZ)";
354
355 foreach (Vector3 p in es.SpawnPoints())
356 {
357 cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
358 cmd.Parameters.AddWithValue("?PointX", p.X);
359 cmd.Parameters.AddWithValue("?PointY", p.Y);
360 cmd.Parameters.AddWithValue("?PointZ", p.Z);
361
362 cmd.ExecuteNonQuery();
363 cmd.Parameters.Clear();
364 }
365 }
366 }
367 }
368
369 private void LoadBanList(EstateSettings es) 304 private void LoadBanList(EstateSettings es)
370 { 305 {
371 es.ClearBans(); 306 es.ClearBans();