From efc09e80222847d4af92a7bff1c8f25ac1ea566b Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Sun, 21 Oct 2012 14:59:22 +0200 Subject: [PATCH] SQLite DB: some values of land data will be not saved / loaded http://opensimulator.org/mantis/view.php?id=6370 Signed-off-by: BlueWall --- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 25 +++++++++++++++---- .../World/Land/LandManagementModule.cs | 1 + 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index f40e86644c..38a81929f3 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1366,6 +1366,13 @@ namespace OpenSim.Data.SQLite createCol(land, "UserLookAtZ", typeof(Double)); createCol(land, "AuthbuyerID", typeof(String)); createCol(land, "OtherCleanTime", typeof(Int32)); + createCol(land, "Dwell", typeof(Int32)); + createCol(land, "MediaType", typeof(String)); + createCol(land, "MediaDescription", typeof(String)); + createCol(land, "MediaSize", typeof(String)); + createCol(land, "MediaLoop", typeof(Boolean)); + createCol(land, "ObscureMedia", typeof(Boolean)); + createCol(land, "ObscureMusic", typeof(Boolean)); land.PrimaryKey = new DataColumn[] { land.Columns["UUID"] }; @@ -1781,9 +1788,16 @@ namespace OpenSim.Data.SQLite newData.PassHours = Convert.ToSingle(row["PassHours"]); newData.PassPrice = Convert.ToInt32(row["PassPrice"]); newData.SnapshotID = (UUID)(String)row["SnapshotUUID"]; + newData.Dwell = Convert.ToInt32(row["Dwell"]); + newData.MediaType = (String)row["MediaType"]; + newData.MediaDescription = (String)row["MediaDescription"]; + newData.MediaWidth = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[0]); + newData.MediaHeight = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[1]); + newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]); + newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); + newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); try { - newData.UserLocation = new Vector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]), Convert.ToSingle(row["UserLocationZ"])); @@ -2195,12 +2209,13 @@ namespace OpenSim.Data.SQLite row["UserLookAtZ"] = land.UserLookAt.Z; row["AuthbuyerID"] = land.AuthBuyerID.ToString(); row["OtherCleanTime"] = land.OtherCleanTime; + row["Dwell"] = land.Dwell; row["MediaType"] = land.MediaType; row["MediaDescription"] = land.MediaDescription; - row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString(); - row["MediaLoop"] = land.MediaLoop.ToString(); - row["ObscureMusic"] = land.ObscureMusic.ToString(); - row["ObscureMedia"] = land.ObscureMedia.ToString(); + row["MediaSize"] = String.Format("{0},{1}", land.MediaWidth, land.MediaHeight); + row["MediaLoop"] = land.MediaLoop; + row["ObscureMusic"] = land.ObscureMusic; + row["ObscureMedia"] = land.ObscureMedia; } /// diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 8b7406d7db..e93546258d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -950,6 +950,7 @@ namespace OpenSim.Region.CoreModules.World.Land ILandObject newLand = startLandObject.Copy(); newLand.LandData.Name = newLand.LandData.Name; newLand.LandData.GlobalID = UUID.Random(); + newLand.LandData.Dwell = 0; newLand.SetLandBitmap(newLand.GetSquareLandBitmap(start_x, start_y, end_x, end_y));