diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLEstateData.cs | 65 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 70 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/EstateStore.migrations | 21 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/RegionStore.migrations | 26 | ||||
-rw-r--r-- | OpenSim/Framework/EstateSettings.cs | 150 | ||||
-rw-r--r-- | OpenSim/Framework/RegionSettings.cs | 150 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs | 46 |
8 files changed, 273 insertions, 267 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(); |
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 6d14b82..3883e24 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -846,6 +846,8 @@ namespace OpenSim.Data.MySQL | |||
846 | } | 846 | } |
847 | } | 847 | } |
848 | 848 | ||
849 | LoadSpawnPoints(rs); | ||
850 | |||
849 | return rs; | 851 | return rs; |
850 | } | 852 | } |
851 | 853 | ||
@@ -1017,6 +1019,7 @@ namespace OpenSim.Data.MySQL | |||
1017 | } | 1019 | } |
1018 | } | 1020 | } |
1019 | } | 1021 | } |
1022 | SaveSpawnPoints(rs); | ||
1020 | } | 1023 | } |
1021 | 1024 | ||
1022 | public List<LandData> LoadLandObjects(UUID regionUUID) | 1025 | public List<LandData> LoadLandObjects(UUID regionUUID) |
@@ -1828,5 +1831,72 @@ namespace OpenSim.Data.MySQL | |||
1828 | } | 1831 | } |
1829 | } | 1832 | } |
1830 | } | 1833 | } |
1834 | |||
1835 | private void LoadSpawnPoints(RegionSettings rs) | ||
1836 | { | ||
1837 | rs.ClearSpawnPoints(); | ||
1838 | |||
1839 | lock (m_dbLock) | ||
1840 | { | ||
1841 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
1842 | { | ||
1843 | dbcon.Open(); | ||
1844 | |||
1845 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
1846 | { | ||
1847 | cmd.CommandText = "select PointX, PointY, PointZ from spawn_points where RegionID = ?RegionID"; | ||
1848 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); | ||
1849 | |||
1850 | using (IDataReader r = cmd.ExecuteReader()) | ||
1851 | { | ||
1852 | while (r.Read()) | ||
1853 | { | ||
1854 | Vector3 point = new Vector3(); | ||
1855 | |||
1856 | point.X = (float)r["PointX"]; | ||
1857 | point.Y = (float)r["PointY"]; | ||
1858 | point.Z = (float)r["PointZ"]; | ||
1859 | |||
1860 | rs.AddSpawnPoint(point); | ||
1861 | } | ||
1862 | } | ||
1863 | } | ||
1864 | } | ||
1865 | } | ||
1866 | } | ||
1867 | |||
1868 | private void SaveSpawnPoints(RegionSettings rs) | ||
1869 | { | ||
1870 | lock (m_dbLock) | ||
1871 | { | ||
1872 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
1873 | { | ||
1874 | dbcon.Open(); | ||
1875 | |||
1876 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
1877 | { | ||
1878 | cmd.CommandText = "delete from spawn_points where RegionID = ?RegionID"; | ||
1879 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); | ||
1880 | |||
1881 | cmd.ExecuteNonQuery(); | ||
1882 | |||
1883 | cmd.Parameters.Clear(); | ||
1884 | |||
1885 | cmd.CommandText = "insert into spawn_points (RegionID, PointX, PointY, PointZ) values ( ?EstateID, ?PointX, ?PointY,?PointZ)"; | ||
1886 | |||
1887 | foreach (Vector3 p in rs.SpawnPoints()) | ||
1888 | { | ||
1889 | cmd.Parameters.AddWithValue("?EstateID", rs.RegionUUID.ToString()); | ||
1890 | cmd.Parameters.AddWithValue("?PointX", p.X); | ||
1891 | cmd.Parameters.AddWithValue("?PointY", p.Y); | ||
1892 | cmd.Parameters.AddWithValue("?PointZ", p.Z); | ||
1893 | |||
1894 | cmd.ExecuteNonQuery(); | ||
1895 | cmd.Parameters.Clear(); | ||
1896 | } | ||
1897 | } | ||
1898 | } | ||
1899 | } | ||
1900 | } | ||
1831 | } | 1901 | } |
1832 | } | 1902 | } |
diff --git a/OpenSim/Data/MySQL/Resources/EstateStore.migrations b/OpenSim/Data/MySQL/Resources/EstateStore.migrations index 591295b..df82a2e 100644 --- a/OpenSim/Data/MySQL/Resources/EstateStore.migrations +++ b/OpenSim/Data/MySQL/Resources/EstateStore.migrations | |||
@@ -78,25 +78,4 @@ ALTER TABLE estate_settings AUTO_INCREMENT = 100; | |||
78 | COMMIT; | 78 | COMMIT; |
79 | 79 | ||
80 | 80 | ||
81 | :VERSION 33 #--------------------- ( Supporting Telehubs | ||
82 | 81 | ||
83 | BEGIN; | ||
84 | CREATE TABLE IF NOT EXISTS `spawn_points` ( | ||
85 | `EstateID` varchar(36) COLLATE utf8_unicode_ci NOT NULL, | ||
86 | `PointX` float NOT NULL, | ||
87 | `PointY` float NOT NULL, | ||
88 | `PointZ` float NOT NULL, | ||
89 | KEY `EstateID` (`EstateID`) | ||
90 | ) ENGINE=Innodb; | ||
91 | |||
92 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL; | ||
93 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubName` varchar(255) NOT NULL; | ||
94 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubEnabled` tinyint(4) NOT NULL; | ||
95 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubPosX` float NOT NULL; | ||
96 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubPosY` float NOT NULL; | ||
97 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubPosZ` float NOT NULL; | ||
98 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubRotX` float NOT NULL; | ||
99 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubRotY` float NOT NULL; | ||
100 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubRotZ` float NOT NULL; | ||
101 | ALTER TABLE `estate_settings` ADD COLUMN `TelehubRotW` float NOT NULL; | ||
102 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 987625b..ce66cfb 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations | |||
@@ -841,4 +841,28 @@ alter table regionban ENGINE = MyISAM; | |||
841 | alter table regionsettings ENGINE = MyISAM; | 841 | alter table regionsettings ENGINE = MyISAM; |
842 | alter table terrain ENGINE = MyISAM; | 842 | alter table terrain ENGINE = MyISAM; |
843 | 843 | ||
844 | COMMIT; \ No newline at end of file | 844 | COMMIT; |
845 | |||
846 | :VERSION 39 #--------------- Telehub support | ||
847 | |||
848 | BEGIN; | ||
849 | CREATE TABLE IF NOT EXISTS `spawn_points` ( | ||
850 | `RegionID` varchar(36) COLLATE utf8_unicode_ci NOT NULL, | ||
851 | `PointX` float NOT NULL, | ||
852 | `PointY` float NOT NULL, | ||
853 | `PointZ` float NOT NULL, | ||
854 | KEY `EstateID` (`EstateID`) | ||
855 | ) ENGINE=Innodb; | ||
856 | |||
857 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL; | ||
858 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubName` varchar(255) NOT NULL; | ||
859 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubEnabled` tinyint(4) NOT NULL; | ||
860 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubPosX` float NOT NULL; | ||
861 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubPosY` float NOT NULL; | ||
862 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubPosZ` float NOT NULL; | ||
863 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubRotX` float NOT NULL; | ||
864 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubRotY` float NOT NULL; | ||
865 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubRotZ` float NOT NULL; | ||
866 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubRotW` float NOT NULL; | ||
867 | COMMIT; | ||
868 | |||
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs index 9bdeab8..2a495b0 100644 --- a/OpenSim/Framework/EstateSettings.cs +++ b/OpenSim/Framework/EstateSettings.cs | |||
@@ -373,155 +373,5 @@ namespace OpenSim.Framework | |||
373 | 373 | ||
374 | return l_EstateAccess.Contains(user); | 374 | return l_EstateAccess.Contains(user); |
375 | } | 375 | } |
376 | |||
377 | // Telehub support | ||
378 | private bool m_TelehubEnabled = false; | ||
379 | public bool HasTelehub | ||
380 | { | ||
381 | get { return m_TelehubEnabled; } | ||
382 | set { m_TelehubEnabled = value; } | ||
383 | } | ||
384 | |||
385 | // Connected Telehub object | ||
386 | private UUID m_TelehubObject; | ||
387 | public UUID TelehubObject | ||
388 | { | ||
389 | get | ||
390 | { | ||
391 | if (HasTelehub) | ||
392 | { | ||
393 | return m_TelehubObject; | ||
394 | } | ||
395 | else | ||
396 | { | ||
397 | return UUID.Zero; | ||
398 | } | ||
399 | } | ||
400 | set | ||
401 | { | ||
402 | m_TelehubObject = value; | ||
403 | } | ||
404 | } | ||
405 | |||
406 | // Connected Telehub name | ||
407 | private string m_TelehubName; | ||
408 | public string TelehubName | ||
409 | { | ||
410 | get | ||
411 | { | ||
412 | if (HasTelehub) | ||
413 | { | ||
414 | return m_TelehubName; | ||
415 | } | ||
416 | else | ||
417 | { | ||
418 | return String.Empty; | ||
419 | } | ||
420 | } | ||
421 | set | ||
422 | { | ||
423 | m_TelehubName = value; | ||
424 | } | ||
425 | } | ||
426 | |||
427 | // Connected Telehub position | ||
428 | private float m_TelehubPosX; | ||
429 | private float m_TelehubPosY; | ||
430 | private float m_TelehubPosZ; | ||
431 | public Vector3 TelehubPos | ||
432 | { | ||
433 | get | ||
434 | { | ||
435 | if (HasTelehub) | ||
436 | { | ||
437 | Vector3 Pos = new Vector3(m_TelehubPosX, m_TelehubPosY, m_TelehubPosZ); | ||
438 | return Pos; | ||
439 | } | ||
440 | else | ||
441 | { | ||
442 | return Vector3.Zero; | ||
443 | } | ||
444 | } | ||
445 | set | ||
446 | { | ||
447 | |||
448 | m_TelehubPosX = value.X; | ||
449 | m_TelehubPosY = value.Y; | ||
450 | m_TelehubPosZ = value.Z; | ||
451 | } | ||
452 | } | ||
453 | |||
454 | // Connected Telehub rotation | ||
455 | private float m_TelehubRotX; | ||
456 | private float m_TelehubRotY; | ||
457 | private float m_TelehubRotZ; | ||
458 | private float m_TelehubRotW; | ||
459 | public Quaternion TelehubRot | ||
460 | { | ||
461 | get | ||
462 | { | ||
463 | if (HasTelehub) | ||
464 | { | ||
465 | Quaternion quat = new Quaternion(); | ||
466 | |||
467 | quat.X = m_TelehubRotX; | ||
468 | quat.Y = m_TelehubRotY; | ||
469 | quat.Z = m_TelehubRotZ; | ||
470 | quat.W = m_TelehubRotW; | ||
471 | |||
472 | return quat; | ||
473 | } | ||
474 | else | ||
475 | { | ||
476 | // What else to do?? | ||
477 | Quaternion quat = new Quaternion(); | ||
478 | |||
479 | quat.X = m_TelehubRotX; | ||
480 | quat.X = m_TelehubRotY; | ||
481 | quat.X = m_TelehubRotZ; | ||
482 | quat.X = m_TelehubRotW; | ||
483 | |||
484 | return quat; | ||
485 | } | ||
486 | } | ||
487 | set | ||
488 | { | ||
489 | m_TelehubRotX = value.X; | ||
490 | m_TelehubRotY = value.Y; | ||
491 | m_TelehubRotZ = value.Z; | ||
492 | m_TelehubRotW = value.W; | ||
493 | } | ||
494 | } | ||
495 | |||
496 | // Our Connected Telehub's SpawnPoints | ||
497 | public List<Vector3> l_SpawnPoints = new List<Vector3>(); | ||
498 | |||
499 | // Add a SpawnPoint | ||
500 | // ** These are not region coordinates ** | ||
501 | // They are relative to the Telehub coordinates | ||
502 | // | ||
503 | public void AddSpawnPoint(Vector3 point) | ||
504 | { | ||
505 | l_SpawnPoints.Add(point); | ||
506 | } | ||
507 | |||
508 | // Remove a SpawnPoint | ||
509 | public void RemoveSpawnPoint(int point_index) | ||
510 | { | ||
511 | l_SpawnPoints.RemoveAt(point_index); | ||
512 | } | ||
513 | |||
514 | // Return the List of SpawnPoints | ||
515 | public List<Vector3> SpawnPoints() | ||
516 | { | ||
517 | return l_SpawnPoints; | ||
518 | |||
519 | } | ||
520 | |||
521 | // Clear the SpawnPoints List of all entries | ||
522 | public void ClearSpawnPoints() | ||
523 | { | ||
524 | l_SpawnPoints.Clear(); | ||
525 | } | ||
526 | } | 376 | } |
527 | } | 377 | } |
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 673cf20..a2dd64f 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | ||
29 | using System.IO; | 30 | using System.IO; |
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | 32 | ||
@@ -397,5 +398,154 @@ namespace OpenSim.Framework | |||
397 | set { m_LoadedCreationID = value; } | 398 | set { m_LoadedCreationID = value; } |
398 | } | 399 | } |
399 | 400 | ||
401 | // Telehub support | ||
402 | private bool m_TelehubEnabled = false; | ||
403 | public bool HasTelehub | ||
404 | { | ||
405 | get { return m_TelehubEnabled; } | ||
406 | set { m_TelehubEnabled = value; } | ||
407 | } | ||
408 | |||
409 | // Connected Telehub object | ||
410 | private UUID m_TelehubObject; | ||
411 | public UUID TelehubObject | ||
412 | { | ||
413 | get | ||
414 | { | ||
415 | if (HasTelehub) | ||
416 | { | ||
417 | return m_TelehubObject; | ||
418 | } | ||
419 | else | ||
420 | { | ||
421 | return UUID.Zero; | ||
422 | } | ||
423 | } | ||
424 | set | ||
425 | { | ||
426 | m_TelehubObject = value; | ||
427 | } | ||
428 | } | ||
429 | |||
430 | // Connected Telehub name | ||
431 | private string m_TelehubName; | ||
432 | public string TelehubName | ||
433 | { | ||
434 | get | ||
435 | { | ||
436 | if (HasTelehub) | ||
437 | { | ||
438 | return m_TelehubName; | ||
439 | } | ||
440 | else | ||
441 | { | ||
442 | return String.Empty; | ||
443 | } | ||
444 | } | ||
445 | set | ||
446 | { | ||
447 | m_TelehubName = value; | ||
448 | } | ||
449 | } | ||
450 | |||
451 | // Connected Telehub position | ||
452 | private float m_TelehubPosX; | ||
453 | private float m_TelehubPosY; | ||
454 | private float m_TelehubPosZ; | ||
455 | public Vector3 TelehubPos | ||
456 | { | ||
457 | get | ||
458 | { | ||
459 | if (HasTelehub) | ||
460 | { | ||
461 | Vector3 Pos = new Vector3(m_TelehubPosX, m_TelehubPosY, m_TelehubPosZ); | ||
462 | return Pos; | ||
463 | } | ||
464 | else | ||
465 | { | ||
466 | return Vector3.Zero; | ||
467 | } | ||
468 | } | ||
469 | set | ||
470 | { | ||
471 | |||
472 | m_TelehubPosX = value.X; | ||
473 | m_TelehubPosY = value.Y; | ||
474 | m_TelehubPosZ = value.Z; | ||
475 | } | ||
476 | } | ||
477 | |||
478 | // Connected Telehub rotation | ||
479 | private float m_TelehubRotX; | ||
480 | private float m_TelehubRotY; | ||
481 | private float m_TelehubRotZ; | ||
482 | private float m_TelehubRotW; | ||
483 | public Quaternion TelehubRot | ||
484 | { | ||
485 | get | ||
486 | { | ||
487 | if (HasTelehub) | ||
488 | { | ||
489 | Quaternion quat = new Quaternion(); | ||
490 | |||
491 | quat.X = m_TelehubRotX; | ||
492 | quat.Y = m_TelehubRotY; | ||
493 | quat.Z = m_TelehubRotZ; | ||
494 | quat.W = m_TelehubRotW; | ||
495 | |||
496 | return quat; | ||
497 | } | ||
498 | else | ||
499 | { | ||
500 | // What else to do?? | ||
501 | Quaternion quat = new Quaternion(); | ||
502 | |||
503 | quat.X = m_TelehubRotX; | ||
504 | quat.X = m_TelehubRotY; | ||
505 | quat.X = m_TelehubRotZ; | ||
506 | quat.X = m_TelehubRotW; | ||
507 | |||
508 | return quat; | ||
509 | } | ||
510 | } | ||
511 | set | ||
512 | { | ||
513 | m_TelehubRotX = value.X; | ||
514 | m_TelehubRotY = value.Y; | ||
515 | m_TelehubRotZ = value.Z; | ||
516 | m_TelehubRotW = value.W; | ||
517 | } | ||
518 | } | ||
519 | |||
520 | // Our Connected Telehub's SpawnPoints | ||
521 | public List<Vector3> l_SpawnPoints = new List<Vector3>(); | ||
522 | |||
523 | // Add a SpawnPoint | ||
524 | // ** These are not region coordinates ** | ||
525 | // They are relative to the Telehub coordinates | ||
526 | // | ||
527 | public void AddSpawnPoint(Vector3 point) | ||
528 | { | ||
529 | l_SpawnPoints.Add(point); | ||
530 | } | ||
531 | |||
532 | // Remove a SpawnPoint | ||
533 | public void RemoveSpawnPoint(int point_index) | ||
534 | { | ||
535 | l_SpawnPoints.RemoveAt(point_index); | ||
536 | } | ||
537 | |||
538 | // Return the List of SpawnPoints | ||
539 | public List<Vector3> SpawnPoints() | ||
540 | { | ||
541 | return l_SpawnPoints; | ||
542 | |||
543 | } | ||
544 | |||
545 | // Clear the SpawnPoints List of all entries | ||
546 | public void ClearSpawnPoints() | ||
547 | { | ||
548 | l_SpawnPoints.Clear(); | ||
549 | } | ||
400 | } | 550 | } |
401 | } | 551 | } |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 6a02ffe..cdcea65 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -609,9 +609,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
609 | { | 609 | { |
610 | case "info ui": | 610 | case "info ui": |
611 | // Send info: | 611 | // Send info: |
612 | if (Scene.RegionInfo.EstateSettings.HasTelehub) | 612 | if (Scene.RegionInfo.RegionSettings.HasTelehub) |
613 | { | 613 | { |
614 | EstateSettings settings = this.Scene.RegionInfo.EstateSettings; | 614 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; |
615 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | 615 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, |
616 | settings.TelehubRot, settings.SpawnPoints()); | 616 | settings.TelehubRot, settings.SpawnPoints()); |
617 | } | 617 | } |
@@ -626,7 +626,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
626 | part = Scene.GetSceneObjectPart((uint)param1); | 626 | part = Scene.GetSceneObjectPart((uint)param1); |
627 | if (m_Telehub.Connect(part)) | 627 | if (m_Telehub.Connect(part)) |
628 | { | 628 | { |
629 | EstateSettings settings = this.Scene.RegionInfo.EstateSettings; | 629 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; |
630 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | 630 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, |
631 | settings.TelehubRot, settings.SpawnPoints()); | 631 | settings.TelehubRot, settings.SpawnPoints()); |
632 | } | 632 | } |
@@ -637,7 +637,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
637 | part = Scene.GetSceneObjectPart((uint)param1); | 637 | part = Scene.GetSceneObjectPart((uint)param1); |
638 | if (m_Telehub.DisConnect(part)) | 638 | if (m_Telehub.DisConnect(part)) |
639 | { | 639 | { |
640 | EstateSettings settings = this.Scene.RegionInfo.EstateSettings; | 640 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; |
641 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | 641 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, |
642 | settings.TelehubRot, settings.SpawnPoints()); | 642 | settings.TelehubRot, settings.SpawnPoints()); |
643 | } | 643 | } |
@@ -648,7 +648,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
648 | part = Scene.GetSceneObjectPart((uint)param1); | 648 | part = Scene.GetSceneObjectPart((uint)param1); |
649 | if( m_Telehub.AddSpawnPoint(part.AbsolutePosition)) | 649 | if( m_Telehub.AddSpawnPoint(part.AbsolutePosition)) |
650 | { | 650 | { |
651 | EstateSettings settings = this.Scene.RegionInfo.EstateSettings; | 651 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; |
652 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | 652 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, |
653 | settings.TelehubRot, settings.SpawnPoints()); | 653 | settings.TelehubRot, settings.SpawnPoints()); |
654 | } | 654 | } |
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
658 | // Remove SpawnPoint from Telehub | 658 | // Remove SpawnPoint from Telehub |
659 | if (m_Telehub.RemoveSpawnPoint((int)param1)) | 659 | if (m_Telehub.RemoveSpawnPoint((int)param1)) |
660 | { | 660 | { |
661 | EstateSettings settings = this.Scene.RegionInfo.EstateSettings; | 661 | RegionSettings settings = this.Scene.RegionInfo.RegionSettings; |
662 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, | 662 | client.SendTelehubInfo(settings.TelehubObject, settings.TelehubName, settings.TelehubPos, |
663 | settings.TelehubRot, settings.SpawnPoints()); | 663 | settings.TelehubRot, settings.SpawnPoints()); |
664 | } | 664 | } |
diff --git a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs index 309ef13..ee77ae1 100644 --- a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs +++ b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs | |||
@@ -44,7 +44,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
44 | UUID EstateID; | 44 | UUID EstateID; |
45 | bool m_HasTelehub = false; | 45 | bool m_HasTelehub = false; |
46 | Scene m_Scene; | 46 | Scene m_Scene; |
47 | EstateSettings m_EstateSettings; | ||
48 | // This will get an option... | 47 | // This will get an option... |
49 | Vector3 InitialSpawnPoint = new Vector3(0.0f,0.0f,0.0f); | 48 | Vector3 InitialSpawnPoint = new Vector3(0.0f,0.0f,0.0f); |
50 | 49 | ||
@@ -56,7 +55,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
56 | public TelehubManager(Scene scene) | 55 | public TelehubManager(Scene scene) |
57 | { | 56 | { |
58 | m_Scene = scene; | 57 | m_Scene = scene; |
59 | m_EstateSettings = m_Scene.RegionInfo.EstateSettings; | ||
60 | } | 58 | } |
61 | 59 | ||
62 | // Fill our Telehub struct with values | 60 | // Fill our Telehub struct with values |
@@ -76,17 +74,17 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
76 | // Connect the Telehub | 74 | // Connect the Telehub |
77 | public bool Connect(SceneObjectPart part) | 75 | public bool Connect(SceneObjectPart part) |
78 | { | 76 | { |
79 | m_EstateSettings.ClearSpawnPoints(); | 77 | m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints(); |
80 | 78 | ||
81 | m_EstateSettings.TelehubObject = part.UUID; | 79 | m_Scene.RegionInfo.RegionSettings.TelehubObject = part.UUID; |
82 | m_EstateSettings.TelehubName = part.Name; | 80 | m_Scene.RegionInfo.RegionSettings.TelehubName = part.Name; |
83 | m_EstateSettings.TelehubPos = part.AbsolutePosition; | 81 | m_Scene.RegionInfo.RegionSettings.TelehubPos = part.AbsolutePosition; |
84 | m_EstateSettings.TelehubRot = part.GetWorldRotation(); | 82 | m_Scene.RegionInfo.RegionSettings.TelehubRot = part.GetWorldRotation(); |
85 | 83 | ||
86 | // Clear this for now | 84 | // Clear this for now |
87 | m_EstateSettings.AddSpawnPoint(InitialSpawnPoint); | 85 | m_Scene.RegionInfo.RegionSettings.AddSpawnPoint(InitialSpawnPoint); |
88 | m_EstateSettings.HasTelehub = true; | 86 | m_Scene.RegionInfo.RegionSettings.HasTelehub = true; |
89 | m_EstateSettings.Save(); | 87 | m_Scene.RegionInfo.RegionSettings.Save(); |
90 | return true; | 88 | return true; |
91 | } | 89 | } |
92 | 90 | ||
@@ -96,14 +94,14 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
96 | bool result = false; | 94 | bool result = false; |
97 | 95 | ||
98 | try{ | 96 | try{ |
99 | m_EstateSettings.TelehubObject = UUID.Zero; | 97 | m_Scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero; |
100 | m_EstateSettings.TelehubName = String.Empty; | 98 | m_Scene.RegionInfo.RegionSettings.TelehubName = String.Empty; |
101 | m_EstateSettings.TelehubPos = Vector3.Zero; | 99 | m_Scene.RegionInfo.RegionSettings.TelehubPos = Vector3.Zero; |
102 | // This is probably wrong! But, HasTelehub will block access | 100 | // This is probably wrong! But, HasTelehub will block access |
103 | m_EstateSettings.TelehubRot = Quaternion.Identity; | 101 | m_Scene.RegionInfo.RegionSettings.TelehubRot = Quaternion.Identity; |
104 | m_EstateSettings.ClearSpawnPoints(); | 102 | m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints(); |
105 | m_EstateSettings.HasTelehub = false; | 103 | m_Scene.RegionInfo.RegionSettings.HasTelehub = false; |
106 | m_EstateSettings.Save(); | 104 | m_Scene.RegionInfo.RegionSettings.Save(); |
107 | result = true; | 105 | result = true; |
108 | } | 106 | } |
109 | catch (Exception ex) | 107 | catch (Exception ex) |
@@ -122,22 +120,22 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
122 | public bool AddSpawnPoint(Vector3 point) | 120 | public bool AddSpawnPoint(Vector3 point) |
123 | { | 121 | { |
124 | 122 | ||
125 | float dist = (float) Util.GetDistanceTo(m_EstateSettings.TelehubPos, point); | 123 | float dist = (float) Util.GetDistanceTo(m_Scene.RegionInfo.RegionSettings.TelehubPos, point); |
126 | Vector3 nvec = Util.GetNormalizedVector(point - m_EstateSettings.TelehubPos); | 124 | Vector3 nvec = Util.GetNormalizedVector(point - m_Scene.RegionInfo.RegionSettings.TelehubPos); |
127 | Vector3 spoint = nvec * dist; | 125 | Vector3 spoint = nvec * dist; |
128 | 126 | ||
129 | m_EstateSettings.AddSpawnPoint(spoint); | 127 | m_Scene.RegionInfo.RegionSettings.AddSpawnPoint(spoint); |
130 | m_EstateSettings.Save(); | 128 | m_Scene.RegionInfo.RegionSettings.Save(); |
131 | return true; | 129 | return true; |
132 | } | 130 | } |
133 | 131 | ||
134 | // Remove a SpawnPoint from the Telehub | 132 | // Remove a SpawnPoint from the Telehub |
135 | public bool RemoveSpawnPoint(int spawnpoint) | 133 | public bool RemoveSpawnPoint(int spawnpoint) |
136 | { | 134 | { |
137 | m_EstateSettings.RemoveSpawnPoint(spawnpoint); | 135 | m_Scene.RegionInfo.RegionSettings.RemoveSpawnPoint(spawnpoint); |
138 | m_EstateSettings.Save(); | 136 | m_Scene.RegionInfo.RegionSettings.Save(); |
139 | 137 | ||
140 | return true; | 138 | return true; |
141 | } | 139 | } |
142 | } | 140 | } |
143 | } \ No newline at end of file | 141 | } |