diff options
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 52 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/RegionStore.migrations | 15 |
2 files changed, 16 insertions, 51 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index bddb971..a346548 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -1012,9 +1012,7 @@ namespace OpenSim.Data.MySQL | |||
1012 | "covenant, Sandbox, sunvectorx, sunvectory, " + | 1012 | "covenant, Sandbox, sunvectorx, sunvectory, " + |
1013 | "sunvectorz, loaded_creation_datetime, " + | 1013 | "sunvectorz, loaded_creation_datetime, " + |
1014 | "loaded_creation_id, map_tile_ID, block_search, casino, " + | 1014 | "loaded_creation_id, map_tile_ID, block_search, casino, " + |
1015 | "TelehubEnabled, TelehubObject, TelehubName, " + | 1015 | "TelehubObject) " + |
1016 | "TelehubPosX, TelehubPosY, TelehubPosZ, " + | ||
1017 | "TelehubRotX, TelehubRotY, TelehubRotZ, TelehubRotW) " + | ||
1018 | "values (?RegionUUID, ?BlockTerraform, " + | 1016 | "values (?RegionUUID, ?BlockTerraform, " + |
1019 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + | 1017 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + |
1020 | "?AllowLandResell, ?AllowLandJoinDivide, " + | 1018 | "?AllowLandResell, ?AllowLandJoinDivide, " + |
@@ -1031,9 +1029,7 @@ namespace OpenSim.Data.MySQL | |||
1031 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + | 1029 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + |
1032 | "?LoadedCreationDateTime, ?LoadedCreationID, " + | 1030 | "?LoadedCreationDateTime, ?LoadedCreationID, " + |
1033 | "?TerrainImageID, ?block_search, ?casino, " + | 1031 | "?TerrainImageID, ?block_search, ?casino, " + |
1034 | "?TelehubEnabled, ?TelehubObject, ?TelehubName, " + | 1032 | "?TelehubObject, " + |
1035 | "?TelehubPosX, ?TelehubPosY, ?TelehubPosZ, " + | ||
1036 | "?TelehubRotX, ?TelehubRotY, ?TelehubRotZ, ?TelehubRotW )"; | ||
1037 | 1033 | ||
1038 | FillRegionSettingsCommand(cmd, rs); | 1034 | FillRegionSettingsCommand(cmd, rs); |
1039 | 1035 | ||
@@ -1321,20 +1317,7 @@ namespace OpenSim.Data.MySQL | |||
1321 | newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; | 1317 | newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; |
1322 | 1318 | ||
1323 | newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]); | 1319 | newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]); |
1324 | newSettings.HasTelehub = Convert.ToBoolean(row["TelehubEnabled"]); | ||
1325 | newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]); | 1320 | newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]); |
1326 | newSettings.TelehubName = (string) row["TelehubName"]; | ||
1327 | newSettings.TelehubPos = new Vector3 ( | ||
1328 | Convert.ToSingle(row["TelehubPosX"]), | ||
1329 | Convert.ToSingle(row["TelehubPosY"]), | ||
1330 | Convert.ToSingle(row["TelehubPosZ"]) | ||
1331 | ); | ||
1332 | newSettings.TelehubRot = new Quaternion ( | ||
1333 | Convert.ToSingle(row["TelehubRotX"]), | ||
1334 | Convert.ToSingle(row["TelehubRotY"]), | ||
1335 | Convert.ToSingle(row["TelehubRotZ"]), | ||
1336 | Convert.ToSingle(row["TelehubRotW"]) | ||
1337 | ); | ||
1338 | 1321 | ||
1339 | newSettings.GodBlockSearch = Convert.ToBoolean(row["block_search"]); | 1322 | newSettings.GodBlockSearch = Convert.ToBoolean(row["block_search"]); |
1340 | newSettings.Casino = Convert.ToBoolean(row["casino"]); | 1323 | newSettings.Casino = Convert.ToBoolean(row["casino"]); |
@@ -1675,16 +1658,7 @@ namespace OpenSim.Data.MySQL | |||
1675 | cmd.Parameters.AddWithValue("block_search", settings.GodBlockSearch); | 1658 | cmd.Parameters.AddWithValue("block_search", settings.GodBlockSearch); |
1676 | cmd.Parameters.AddWithValue("casino", settings.Casino); | 1659 | cmd.Parameters.AddWithValue("casino", settings.Casino); |
1677 | 1660 | ||
1678 | cmd.Parameters.AddWithValue("TelehubEnabled", settings.HasTelehub); | ||
1679 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); | 1661 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); |
1680 | cmd.Parameters.AddWithValue("TelehubName", settings.TelehubName); | ||
1681 | cmd.Parameters.AddWithValue("TelehubPosX", settings.TelehubPos.X); | ||
1682 | cmd.Parameters.AddWithValue("TelehubPosY", settings.TelehubPos.Y); | ||
1683 | cmd.Parameters.AddWithValue("TelehubPosZ", settings.TelehubPos.Z); | ||
1684 | cmd.Parameters.AddWithValue("TelehubRotX", settings.TelehubRot.X); | ||
1685 | cmd.Parameters.AddWithValue("TelehubRotY", settings.TelehubRot.Y); | ||
1686 | cmd.Parameters.AddWithValue("TelehubRotZ", settings.TelehubRot.Z); | ||
1687 | cmd.Parameters.AddWithValue("TelehubRotW", settings.TelehubRot.W); | ||
1688 | } | 1662 | } |
1689 | 1663 | ||
1690 | /// <summary> | 1664 | /// <summary> |
@@ -1899,20 +1873,20 @@ namespace OpenSim.Data.MySQL | |||
1899 | 1873 | ||
1900 | using (MySqlCommand cmd = dbcon.CreateCommand()) | 1874 | using (MySqlCommand cmd = dbcon.CreateCommand()) |
1901 | { | 1875 | { |
1902 | cmd.CommandText = "select PointX, PointY, PointZ from spawn_points where RegionID = ?RegionID"; | 1876 | cmd.CommandText = "select Yaw, Pitch, Distance from spawn_points where RegionID = ?RegionID"; |
1903 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); | 1877 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); |
1904 | 1878 | ||
1905 | using (IDataReader r = cmd.ExecuteReader()) | 1879 | using (IDataReader r = cmd.ExecuteReader()) |
1906 | { | 1880 | { |
1907 | while (r.Read()) | 1881 | while (r.Read()) |
1908 | { | 1882 | { |
1909 | Vector3 point = new Vector3(); | 1883 | SpawnPoint sp = new SpawnPoint(); |
1910 | 1884 | ||
1911 | point.X = (float)r["PointX"]; | 1885 | sp.Yaw = (float)r["Yaw"]; |
1912 | point.Y = (float)r["PointY"]; | 1886 | sp.Pitch = (float)r["Pitch"]; |
1913 | point.Z = (float)r["PointZ"]; | 1887 | sp.Distance = (float)r["Distance"]; |
1914 | 1888 | ||
1915 | rs.AddSpawnPoint(point); | 1889 | rs.AddSpawnPoint(sp); |
1916 | } | 1890 | } |
1917 | } | 1891 | } |
1918 | } | 1892 | } |
@@ -1937,14 +1911,14 @@ namespace OpenSim.Data.MySQL | |||
1937 | 1911 | ||
1938 | cmd.Parameters.Clear(); | 1912 | cmd.Parameters.Clear(); |
1939 | 1913 | ||
1940 | cmd.CommandText = "insert into spawn_points (RegionID, PointX, PointY, PointZ) values ( ?RegionID, ?PointX, ?PointY,?PointZ)"; | 1914 | cmd.CommandText = "insert into spawn_points (RegionID, Yaw, Pitch, Distance) values ( ?RegionID, ?Yaw, ?Pitch, ?Distance)"; |
1941 | 1915 | ||
1942 | foreach (Vector3 p in rs.SpawnPoints()) | 1916 | foreach (SpawnPoint p in rs.SpawnPoints()) |
1943 | { | 1917 | { |
1944 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); | 1918 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); |
1945 | cmd.Parameters.AddWithValue("?PointX", p.X); | 1919 | cmd.Parameters.AddWithValue("?Yaw", p.Yaw); |
1946 | cmd.Parameters.AddWithValue("?PointY", p.Y); | 1920 | cmd.Parameters.AddWithValue("?Pitch", p.Pitch); |
1947 | cmd.Parameters.AddWithValue("?PointZ", p.Z); | 1921 | cmd.Parameters.AddWithValue("?Distance", p.Distance); |
1948 | 1922 | ||
1949 | cmd.ExecuteNonQuery(); | 1923 | cmd.ExecuteNonQuery(); |
1950 | cmd.Parameters.Clear(); | 1924 | cmd.Parameters.Clear(); |
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 3872a75..219de62 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations | |||
@@ -848,21 +848,12 @@ COMMIT; | |||
848 | BEGIN; | 848 | BEGIN; |
849 | CREATE TABLE IF NOT EXISTS `spawn_points` ( | 849 | CREATE TABLE IF NOT EXISTS `spawn_points` ( |
850 | `RegionID` varchar(36) COLLATE utf8_unicode_ci NOT NULL, | 850 | `RegionID` varchar(36) COLLATE utf8_unicode_ci NOT NULL, |
851 | `PointX` float NOT NULL, | 851 | `Yaw` float NOT NULL, |
852 | `PointY` float NOT NULL, | 852 | `Pitch` float NOT NULL, |
853 | `PointZ` float NOT NULL, | 853 | `Distance` float NOT NULL, |
854 | KEY `RegionID` (`RegionID`) | 854 | KEY `RegionID` (`RegionID`) |
855 | ) ENGINE=Innodb; | 855 | ) ENGINE=Innodb; |
856 | 856 | ||
857 | ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL; | 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; | 858 | COMMIT; |
868 | 859 | ||