diff options
author | Melanie | 2012-01-24 00:32:10 +0000 |
---|---|---|
committer | Melanie | 2012-01-24 00:32:10 +0000 |
commit | 87799c1f3ddfbc4b0994cac4e54498520899e4d4 (patch) | |
tree | d57c1643237aa84f0d986afa8a1e2be4514e064b /OpenSim/Data/MySQL | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC_OLD-87799c1f3ddfbc4b0994cac4e54498520899e4d4.zip opensim-SC_OLD-87799c1f3ddfbc4b0994cac4e54498520899e4d4.tar.gz opensim-SC_OLD-87799c1f3ddfbc4b0994cac4e54498520899e4d4.tar.bz2 opensim-SC_OLD-87799c1f3ddfbc4b0994cac4e54498520899e4d4.tar.xz |
Change Telehubs to store only the data that is really needed and not
additional redundant information.
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 53 |
1 files changed, 13 insertions, 40 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index b94f6ac..ebb41a5 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -997,9 +997,7 @@ namespace OpenSim.Data.MySQL | |||
997 | "covenant, Sandbox, sunvectorx, sunvectory, " + | 997 | "covenant, Sandbox, sunvectorx, sunvectory, " + |
998 | "sunvectorz, loaded_creation_datetime, " + | 998 | "sunvectorz, loaded_creation_datetime, " + |
999 | "loaded_creation_id, map_tile_ID, " + | 999 | "loaded_creation_id, map_tile_ID, " + |
1000 | "TelehubEnabled, TelehubObject, TelehubName, " + | 1000 | "TelehubObject) " + |
1001 | "TelehubPosX, TelehubPosY, TelehubPosZ, " + | ||
1002 | "TelehubRotX, TelehubRotY, TelehubRotZ, TelehubRotW) " + | ||
1003 | "values (?RegionUUID, ?BlockTerraform, " + | 1001 | "values (?RegionUUID, ?BlockTerraform, " + |
1004 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + | 1002 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + |
1005 | "?AllowLandResell, ?AllowLandJoinDivide, " + | 1003 | "?AllowLandResell, ?AllowLandJoinDivide, " + |
@@ -1015,10 +1013,7 @@ namespace OpenSim.Data.MySQL | |||
1015 | "?SunPosition, ?Covenant, ?Sandbox, " + | 1013 | "?SunPosition, ?Covenant, ?Sandbox, " + |
1016 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + | 1014 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + |
1017 | "?LoadedCreationDateTime, ?LoadedCreationID, " + | 1015 | "?LoadedCreationDateTime, ?LoadedCreationID, " + |
1018 | "?TerrainImageID, " + | 1016 | "?TerrainImageID) "; |
1019 | "?TelehubEnabled, ?TelehubObject, ?TelehubName, " + | ||
1020 | "?TelehubPosX, ?TelehubPosY, ?TelehubPosZ, " + | ||
1021 | "?TelehubRotX, ?TelehubRotY, ?TelehubRotZ, ?TelehubRotW )"; | ||
1022 | 1017 | ||
1023 | FillRegionSettingsCommand(cmd, rs); | 1018 | FillRegionSettingsCommand(cmd, rs); |
1024 | 1019 | ||
@@ -1306,20 +1301,7 @@ namespace OpenSim.Data.MySQL | |||
1306 | newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; | 1301 | newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; |
1307 | 1302 | ||
1308 | newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]); | 1303 | newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]); |
1309 | newSettings.HasTelehub = Convert.ToBoolean(row["TelehubEnabled"]); | ||
1310 | newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]); | 1304 | newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]); |
1311 | newSettings.TelehubName = (string) row["TelehubName"]; | ||
1312 | newSettings.TelehubPos = new Vector3 ( | ||
1313 | Convert.ToSingle(row["TelehubPosX"]), | ||
1314 | Convert.ToSingle(row["TelehubPosY"]), | ||
1315 | Convert.ToSingle(row["TelehubPosZ"]) | ||
1316 | ); | ||
1317 | newSettings.TelehubRot = new Quaternion ( | ||
1318 | Convert.ToSingle(row["TelehubRotX"]), | ||
1319 | Convert.ToSingle(row["TelehubRotY"]), | ||
1320 | Convert.ToSingle(row["TelehubRotZ"]), | ||
1321 | Convert.ToSingle(row["TelehubRotW"]) | ||
1322 | ); | ||
1323 | 1305 | ||
1324 | return newSettings; | 1306 | return newSettings; |
1325 | } | 1307 | } |
@@ -1650,16 +1632,7 @@ namespace OpenSim.Data.MySQL | |||
1650 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); | 1632 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); |
1651 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); | 1633 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); |
1652 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); | 1634 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); |
1653 | cmd.Parameters.AddWithValue("TelehubEnabled", settings.HasTelehub); | ||
1654 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); | 1635 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); |
1655 | cmd.Parameters.AddWithValue("TelehubName", settings.TelehubName); | ||
1656 | cmd.Parameters.AddWithValue("TelehubPosX", settings.TelehubPos.X); | ||
1657 | cmd.Parameters.AddWithValue("TelehubPosY", settings.TelehubPos.Y); | ||
1658 | cmd.Parameters.AddWithValue("TelehubPosZ", settings.TelehubPos.Z); | ||
1659 | cmd.Parameters.AddWithValue("TelehubRotX", settings.TelehubRot.X); | ||
1660 | cmd.Parameters.AddWithValue("TelehubRotY", settings.TelehubRot.Y); | ||
1661 | cmd.Parameters.AddWithValue("TelehubRotZ", settings.TelehubRot.Z); | ||
1662 | cmd.Parameters.AddWithValue("TelehubRotW", settings.TelehubRot.W); | ||
1663 | } | 1636 | } |
1664 | 1637 | ||
1665 | /// <summary> | 1638 | /// <summary> |
@@ -1874,20 +1847,20 @@ namespace OpenSim.Data.MySQL | |||
1874 | 1847 | ||
1875 | using (MySqlCommand cmd = dbcon.CreateCommand()) | 1848 | using (MySqlCommand cmd = dbcon.CreateCommand()) |
1876 | { | 1849 | { |
1877 | cmd.CommandText = "select PointX, PointY, PointZ from spawn_points where RegionID = ?RegionID"; | 1850 | cmd.CommandText = "select Yaw, Pitch, Distance from spawn_points where RegionID = ?RegionID"; |
1878 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); | 1851 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); |
1879 | 1852 | ||
1880 | using (IDataReader r = cmd.ExecuteReader()) | 1853 | using (IDataReader r = cmd.ExecuteReader()) |
1881 | { | 1854 | { |
1882 | while (r.Read()) | 1855 | while (r.Read()) |
1883 | { | 1856 | { |
1884 | Vector3 point = new Vector3(); | 1857 | SpawnPoint sp = new SpawnPoint(); |
1885 | 1858 | ||
1886 | point.X = (float)r["PointX"]; | 1859 | sp.Yaw = (float)r["Yaw"]; |
1887 | point.Y = (float)r["PointY"]; | 1860 | sp.Pitch = (float)r["Pitch"]; |
1888 | point.Z = (float)r["PointZ"]; | 1861 | sp.Distance = (float)r["Distance"]; |
1889 | 1862 | ||
1890 | rs.AddSpawnPoint(point); | 1863 | rs.AddSpawnPoint(sp); |
1891 | } | 1864 | } |
1892 | } | 1865 | } |
1893 | } | 1866 | } |
@@ -1912,14 +1885,14 @@ namespace OpenSim.Data.MySQL | |||
1912 | 1885 | ||
1913 | cmd.Parameters.Clear(); | 1886 | cmd.Parameters.Clear(); |
1914 | 1887 | ||
1915 | cmd.CommandText = "insert into spawn_points (RegionID, PointX, PointY, PointZ) values ( ?RegionID, ?PointX, ?PointY,?PointZ)"; | 1888 | cmd.CommandText = "insert into spawn_points (RegionID, Yaw, Pitch, Distance) values ( ?RegionID, ?Yaw, ?Pitch, ?Distance)"; |
1916 | 1889 | ||
1917 | foreach (Vector3 p in rs.SpawnPoints()) | 1890 | foreach (SpawnPoint p in rs.SpawnPoints()) |
1918 | { | 1891 | { |
1919 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); | 1892 | cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString()); |
1920 | cmd.Parameters.AddWithValue("?PointX", p.X); | 1893 | cmd.Parameters.AddWithValue("?Yaw", p.Yaw); |
1921 | cmd.Parameters.AddWithValue("?PointY", p.Y); | 1894 | cmd.Parameters.AddWithValue("?Pitch", p.Pitch); |
1922 | cmd.Parameters.AddWithValue("?PointZ", p.Z); | 1895 | cmd.Parameters.AddWithValue("?Distance", p.Distance); |
1923 | 1896 | ||
1924 | cmd.ExecuteNonQuery(); | 1897 | cmd.ExecuteNonQuery(); |
1925 | cmd.Parameters.Clear(); | 1898 | cmd.Parameters.Clear(); |