aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs1
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs79
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations17
3 files changed, 92 insertions, 5 deletions
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index 3d647ca..3dd46cb 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -210,7 +210,6 @@ namespace OpenSim.Data.MySQL
210 } 210 }
211 211
212 LoadBanList(es); 212 LoadBanList(es);
213
214 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers"); 213 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
215 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users"); 214 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
216 es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups"); 215 es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 6d14b82..31d17f1 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
@@ -994,7 +996,9 @@ namespace OpenSim.Data.MySQL
994 "use_estate_sun, fixed_sun, sun_position, " + 996 "use_estate_sun, fixed_sun, sun_position, " +
995 "covenant, Sandbox, sunvectorx, sunvectory, " + 997 "covenant, Sandbox, sunvectorx, sunvectory, " +
996 "sunvectorz, loaded_creation_datetime, " + 998 "sunvectorz, loaded_creation_datetime, " +
997 "loaded_creation_id, map_tile_ID) values (?RegionUUID, ?BlockTerraform, " + 999 "loaded_creation_id, map_tile_ID, " +
1000 "TelehubObject) " +
1001 "values (?RegionUUID, ?BlockTerraform, " +
998 "?BlockFly, ?AllowDamage, ?RestrictPushing, " + 1002 "?BlockFly, ?AllowDamage, ?RestrictPushing, " +
999 "?AllowLandResell, ?AllowLandJoinDivide, " + 1003 "?AllowLandResell, ?AllowLandJoinDivide, " +
1000 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + 1004 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " +
@@ -1009,7 +1013,7 @@ namespace OpenSim.Data.MySQL
1009 "?SunPosition, ?Covenant, ?Sandbox, " + 1013 "?SunPosition, ?Covenant, ?Sandbox, " +
1010 "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + 1014 "?SunVectorX, ?SunVectorY, ?SunVectorZ, " +
1011 "?LoadedCreationDateTime, ?LoadedCreationID, " + 1015 "?LoadedCreationDateTime, ?LoadedCreationID, " +
1012 "?TerrainImageID)"; 1016 "?TerrainImageID, ?TelehubObject) ";
1013 1017
1014 FillRegionSettingsCommand(cmd, rs); 1018 FillRegionSettingsCommand(cmd, rs);
1015 1019
@@ -1017,6 +1021,7 @@ namespace OpenSim.Data.MySQL
1017 } 1021 }
1018 } 1022 }
1019 } 1023 }
1024 SaveSpawnPoints(rs);
1020 } 1025 }
1021 1026
1022 public List<LandData> LoadLandObjects(UUID regionUUID) 1027 public List<LandData> LoadLandObjects(UUID regionUUID)
@@ -1296,6 +1301,7 @@ namespace OpenSim.Data.MySQL
1296 newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; 1301 newSettings.LoadedCreationID = (String) row["loaded_creation_id"];
1297 1302
1298 newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]); 1303 newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]);
1304 newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]);
1299 1305
1300 return newSettings; 1306 return newSettings;
1301 } 1307 }
@@ -1626,7 +1632,7 @@ namespace OpenSim.Data.MySQL
1626 cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); 1632 cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime);
1627 cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); 1633 cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID);
1628 cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); 1634 cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID);
1629 1635 cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject);
1630 } 1636 }
1631 1637
1632 /// <summary> 1638 /// <summary>
@@ -1828,5 +1834,72 @@ namespace OpenSim.Data.MySQL
1828 } 1834 }
1829 } 1835 }
1830 } 1836 }
1837
1838 private void LoadSpawnPoints(RegionSettings rs)
1839 {
1840 rs.ClearSpawnPoints();
1841
1842 lock (m_dbLock)
1843 {
1844 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1845 {
1846 dbcon.Open();
1847
1848 using (MySqlCommand cmd = dbcon.CreateCommand())
1849 {
1850 cmd.CommandText = "select Yaw, Pitch, Distance from spawn_points where RegionID = ?RegionID";
1851 cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
1852
1853 using (IDataReader r = cmd.ExecuteReader())
1854 {
1855 while (r.Read())
1856 {
1857 SpawnPoint sp = new SpawnPoint();
1858
1859 sp.Yaw = (float)r["Yaw"];
1860 sp.Pitch = (float)r["Pitch"];
1861 sp.Distance = (float)r["Distance"];
1862
1863 rs.AddSpawnPoint(sp);
1864 }
1865 }
1866 }
1867 }
1868 }
1869 }
1870
1871 private void SaveSpawnPoints(RegionSettings rs)
1872 {
1873 lock (m_dbLock)
1874 {
1875 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1876 {
1877 dbcon.Open();
1878
1879 using (MySqlCommand cmd = dbcon.CreateCommand())
1880 {
1881 cmd.CommandText = "delete from spawn_points where RegionID = ?RegionID";
1882 cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
1883
1884 cmd.ExecuteNonQuery();
1885
1886 cmd.Parameters.Clear();
1887
1888 cmd.CommandText = "insert into spawn_points (RegionID, Yaw, Pitch, Distance) values ( ?RegionID, ?Yaw, ?Pitch, ?Distance)";
1889
1890 foreach (SpawnPoint p in rs.SpawnPoints())
1891 {
1892 cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
1893 cmd.Parameters.AddWithValue("?Yaw", p.Yaw);
1894 cmd.Parameters.AddWithValue("?Pitch", p.Pitch);
1895 cmd.Parameters.AddWithValue("?Distance", p.Distance);
1896
1897 cmd.ExecuteNonQuery();
1898 cmd.Parameters.Clear();
1899 }
1900 }
1901 }
1902 }
1903 }
1831 } 1904 }
1832} 1905}
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index 987625b..720e200 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -841,4 +841,19 @@ alter table regionban ENGINE = MyISAM;
841alter table regionsettings ENGINE = MyISAM; 841alter table regionsettings ENGINE = MyISAM;
842alter table terrain ENGINE = MyISAM; 842alter table terrain ENGINE = MyISAM;
843 843
844COMMIT; \ No newline at end of file 844COMMIT;
845
846:VERSION 39 #--------------- Telehub support
847
848BEGIN;
849CREATE TABLE IF NOT EXISTS `spawn_points` (
850 `RegionID` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
851 `Yaw` float NOT NULL,
852 `Pitch` float NOT NULL,
853 `Distance` float NOT NULL,
854 KEY `RegionID` (`RegionID`)
855) ENGINE=Innodb;
856
857ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL;
858COMMIT;
859