diff options
author | Melanie | 2012-01-22 16:35:14 +0000 |
---|---|---|
committer | Melanie | 2012-01-22 16:35:14 +0000 |
commit | 02572ab1d3ae23205e0a2192c9b30aa22b566143 (patch) | |
tree | fe483f85a77cb00a21dd4be65a71941329f22482 /OpenSim/Data | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Change the key name I missed in last commit (diff) | |
download | opensim-SC-02572ab1d3ae23205e0a2192c9b30aa22b566143.zip opensim-SC-02572ab1d3ae23205e0a2192c9b30aa22b566143.tar.gz opensim-SC-02572ab1d3ae23205e0a2192c9b30aa22b566143.tar.bz2 opensim-SC-02572ab1d3ae23205e0a2192c9b30aa22b566143.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Framework/RegionSettings.cs
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLEstateData.cs | 1 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 70 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/RegionStore.migrations | 26 |
3 files changed, 95 insertions, 2 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 40619de..afd42d7 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -861,6 +861,8 @@ namespace OpenSim.Data.MySQL | |||
861 | } | 861 | } |
862 | } | 862 | } |
863 | 863 | ||
864 | LoadSpawnPoints(rs); | ||
865 | |||
864 | return rs; | 866 | return rs; |
865 | } | 867 | } |
866 | 868 | ||
@@ -1032,6 +1034,7 @@ namespace OpenSim.Data.MySQL | |||
1032 | } | 1034 | } |
1033 | } | 1035 | } |
1034 | } | 1036 | } |
1037 | SaveSpawnPoints(rs); | ||
1035 | } | 1038 | } |
1036 | 1039 | ||
1037 | public virtual List<LandData> LoadLandObjects(UUID regionUUID) | 1040 | public virtual List<LandData> LoadLandObjects(UUID regionUUID) |
@@ -1852,5 +1855,72 @@ namespace OpenSim.Data.MySQL | |||
1852 | } | 1855 | } |
1853 | } | 1856 | } |
1854 | } | 1857 | } |
1858 | |||
1859 | private void LoadSpawnPoints(RegionSettings rs) | ||
1860 | { | ||
1861 | rs.ClearSpawnPoints(); | ||
1862 | |||
1863 | lock (m_dbLock) | ||
1864 | { | ||
1865 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
1866 | { | ||
1867 | dbcon.Open(); | ||
1868 | |||
1869 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
1870 | { | ||
1871 | cmd.CommandText = "select PointX, PointY, PointZ from spawn_points where RegionID = ?RegionID"; | ||
1872 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); | ||
1873 | |||
1874 | using (IDataReader r = cmd.ExecuteReader()) | ||
1875 | { | ||
1876 | while (r.Read()) | ||
1877 | { | ||
1878 | Vector3 point = new Vector3(); | ||
1879 | |||
1880 | point.X = (float)r["PointX"]; | ||
1881 | point.Y = (float)r["PointY"]; | ||
1882 | point.Z = (float)r["PointZ"]; | ||
1883 | |||
1884 | rs.AddSpawnPoint(point); | ||
1885 | } | ||
1886 | } | ||
1887 | } | ||
1888 | } | ||
1889 | } | ||
1890 | } | ||
1891 | |||
1892 | private void SaveSpawnPoints(RegionSettings rs) | ||
1893 | { | ||
1894 | lock (m_dbLock) | ||
1895 | { | ||
1896 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
1897 | { | ||
1898 | dbcon.Open(); | ||
1899 | |||
1900 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
1901 | { | ||
1902 | cmd.CommandText = "delete from spawn_points where RegionID = ?RegionID"; | ||
1903 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); | ||
1904 | |||
1905 | cmd.ExecuteNonQuery(); | ||
1906 | |||
1907 | cmd.Parameters.Clear(); | ||
1908 | |||
1909 | cmd.CommandText = "insert into spawn_points (RegionID, PointX, PointY, PointZ) values ( ?EstateID, ?PointX, ?PointY,?PointZ)"; | ||
1910 | |||
1911 | foreach (Vector3 p in rs.SpawnPoints()) | ||
1912 | { | ||
1913 | cmd.Parameters.AddWithValue("?EstateID", rs.RegionUUID.ToString()); | ||
1914 | cmd.Parameters.AddWithValue("?PointX", p.X); | ||
1915 | cmd.Parameters.AddWithValue("?PointY", p.Y); | ||
1916 | cmd.Parameters.AddWithValue("?PointZ", p.Z); | ||
1917 | |||
1918 | cmd.ExecuteNonQuery(); | ||
1919 | cmd.Parameters.Clear(); | ||
1920 | } | ||
1921 | } | ||
1922 | } | ||
1923 | } | ||
1924 | } | ||
1855 | } | 1925 | } |
1856 | } | 1926 | } |
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index c2b130c..3872a75 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 `RegionID` (`RegionID`) | ||
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 | |||