From 5c545d1d2e0a1862d063a1bdf80d2cd2fa311101 Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Fri, 3 Feb 2012 22:02:36 +0100 Subject: Fix: Covenant changed time not set http://opensimulator.org/mantis/view.php?id=5869 Signed-off-by: BlueWall --- OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 9 +++++---- OpenSim/Data/MSSQL/Resources/RegionStore.migrations | 8 ++++++++ OpenSim/Data/MySQL/MySQLSimulationData.cs | 7 ++++--- OpenSim/Data/MySQL/Resources/RegionStore.migrations | 5 +++++ OpenSim/Data/SQLite/Resources/RegionStore.migrations | 7 ++++++- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 3 +++ OpenSim/Framework/IClientAPI.cs | 2 +- OpenSim/Framework/RegionSettings.cs | 10 +++++++++- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 8 ++++---- .../Region/CoreModules/World/Estate/EstateManagementModule.cs | 2 ++ .../Agent/InternetRelayClientView/Server/IRCClientView.cs | 2 +- OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 2 +- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 13 files changed, 50 insertions(+), 17 deletions(-) diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index be60d4c..e58620a 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs @@ -1252,7 +1252,7 @@ VALUES ,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se ,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit ,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position -,[covenant] = @covenant , [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id +,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id WHERE [regionUUID] = @regionUUID"; using (SqlConnection conn = new SqlConnection(m_connectionString)) @@ -1307,14 +1307,14 @@ VALUES [block_show_in_search],[agent_limit],[object_bonus],[maturity],[disable_scripts],[disable_collisions],[disable_physics], [terrain_texture_1],[terrain_texture_2],[terrain_texture_3],[terrain_texture_4],[elevation_1_nw],[elevation_2_nw],[elevation_1_ne], [elevation_2_ne],[elevation_1_se],[elevation_2_se],[elevation_1_sw],[elevation_2_sw],[water_height],[terrain_raise_limit], - [terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id] + [terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[covenant_datetime],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id] ) VALUES (@regionUUID,@block_terraform,@block_fly,@allow_damage,@restrict_pushing,@allow_land_resell,@allow_land_join_divide, @block_show_in_search,@agent_limit,@object_bonus,@maturity,@disable_scripts,@disable_collisions,@disable_physics, @terrain_texture_1,@terrain_texture_2,@terrain_texture_3,@terrain_texture_4,@elevation_1_nw,@elevation_2_nw,@elevation_1_ne, @elevation_2_ne,@elevation_1_se,@elevation_2_se,@elevation_1_sw,@elevation_2_sw,@water_height,@terrain_raise_limit, - @terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant,@sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)"; + @terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant, @covenant_datetime, @sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)"; using (SqlConnection conn = new SqlConnection(m_connectionString)) using (SqlCommand cmd = new SqlCommand(sql, conn)) @@ -1376,7 +1376,7 @@ VALUES Convert.ToSingle(row["sunvectorz"]) ); newSettings.Covenant = new UUID((Guid)row["covenant"]); - + newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); if (row["loaded_creation_id"] is DBNull) @@ -1789,6 +1789,7 @@ VALUES parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y)); parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z)); parameters.Add(_Database.CreateParameter("covenant", settings.Covenant)); + parameters.Add(_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime)); parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime)); parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID)); diff --git a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations index 3995e6c..a98690a 100644 --- a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations @@ -1043,3 +1043,11 @@ FOR CreatorID ALTER TABLE primitems ALTER COLUMN CreatorID uniqueidentifier NOT NULL COMMIT + +:VERSION 29 #--------------------- + +BEGIN TRANSACTION + +ALTER TABLE regionsettings ADD covenant_datetime int NOT NULL default 0 + +COMMIT diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 3275146..7c995ad 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -994,7 +994,7 @@ namespace OpenSim.Data.MySQL "elevation_2_sw, water_height, " + "terrain_raise_limit, terrain_lower_limit, " + "use_estate_sun, fixed_sun, sun_position, " + - "covenant, Sandbox, sunvectorx, sunvectory, " + + "covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " + "sunvectorz, loaded_creation_datetime, " + "loaded_creation_id, map_tile_ID, " + "TelehubObject, parcel_tile_ID) " + @@ -1010,7 +1010,7 @@ namespace OpenSim.Data.MySQL "?Elevation2SE, ?Elevation1SW, ?Elevation2SW, " + "?WaterHeight, ?TerrainRaiseLimit, " + "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + - "?SunPosition, ?Covenant, ?Sandbox, " + + "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + "?LoadedCreationDateTime, ?LoadedCreationID, " + "?TerrainImageID, ?TelehubObject, ?ParcelImageID) "; @@ -1292,7 +1292,7 @@ namespace OpenSim.Data.MySQL newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); newSettings.Covenant = DBGuid.FromDB(row["covenant"]); - + newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); if (row["loaded_creation_id"] is DBNull) @@ -1630,6 +1630,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("FixedSun", settings.FixedSun); cmd.Parameters.AddWithValue("SunPosition", settings.SunPosition); cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); + cmd.Parameters.AddWithValue("CovenantChangedDateTime", settings.CovenantChangedDateTime); cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 642e3b7..9891f4b 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations @@ -869,3 +869,8 @@ BEGIN; ALTER TABLE `landaccesslist` ADD COLUMN `Expires` INTEGER NOT NULL DEFAULT 0; COMMIT; +:VERSION 42 #--------------------- Region Covenant changed time + +BEGIN; +ALTER TABLE regionsettings ADD COLUMN covenant_datetime int unsigned NOT NULL DEFAULT '0'; +COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index 5e2045b..31195af 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations @@ -466,4 +466,9 @@ ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0'; ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE; ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE; ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE; -COMMIT; \ No newline at end of file +COMMIT; + +:VERSION 22 +BEGIN; +ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0; +COMMIT; diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 2d06f82..a313c4f 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1185,6 +1185,7 @@ namespace OpenSim.Data.SQLite createCol(regionsettings, "fixed_sun", typeof (Int32)); createCol(regionsettings, "sun_position", typeof (Double)); createCol(regionsettings, "covenant", typeof(String)); + createCol(regionsettings, "covenant_datetime", typeof(Int32)); createCol(regionsettings, "map_tile_ID", typeof(String)); regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] }; return regionsettings; @@ -1509,6 +1510,7 @@ namespace OpenSim.Data.SQLite newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); newSettings.Covenant = new UUID((String) row["covenant"]); + newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]); return newSettings; @@ -1833,6 +1835,7 @@ namespace OpenSim.Data.SQLite row["fixed_sun"] = settings.FixedSun; row["sun_position"] = settings.SunPosition; row["covenant"] = settings.Covenant.ToString(); + row["covenant_datetime"] = settings.CovenantChangedDateTime; row["map_tile_ID"] = settings.TerrainImageID.ToString(); } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index dd3e656..c85e599 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -1235,7 +1235,7 @@ namespace OpenSim.Framework void SendEstateCovenantInformation(UUID covenant); void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, - uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner); + uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner); /// /// Send land properties to the client. diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 91e07df..4ce3392 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs @@ -413,6 +413,14 @@ namespace OpenSim.Framework set { m_Covenant = value; } } + private int m_CovenantChanged = 0; + + public int CovenantChangedDateTime + { + get { return m_CovenantChanged; } + set { m_CovenantChanged = value; } + } + private int m_LoadedCreationDateTime; public int LoadedCreationDateTime { @@ -492,4 +500,4 @@ namespace OpenSim.Framework l_SpawnPoints.Clear(); } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index cdd4957..8273c6f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -4439,7 +4439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); edata.CovenantID = covenant; - edata.CovenantTimestamp = 0; + edata.CovenantTimestamp = (uint) m_scene.RegionInfo.RegionSettings.CovenantChangedDateTime; edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; edata.EstateName = Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateName); einfopack.Data = edata; @@ -4447,8 +4447,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP } public void SendDetailedEstateData( - UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, - UUID covenant, string abuseEmail, UUID estateOwner) + UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, + UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) { // m_log.DebugFormat( // "[LLCLIENTVIEW]: Sending detailed estate data to {0} with covenant asset id {1}", Name, covenant); @@ -4473,7 +4473,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP returnblock[4].Parameter = Utils.StringToBytes(sunPosition.ToString()); returnblock[5].Parameter = Utils.StringToBytes(parentEstate.ToString()); returnblock[6].Parameter = Utils.StringToBytes(covenant.ToString()); - returnblock[7].Parameter = Utils.StringToBytes("1160895077"); // what is this? + returnblock[7].Parameter = Utils.StringToBytes(covenantChanged.ToString()); returnblock[8].Parameter = Utils.StringToBytes("1"); // what is this? returnblock[9].Parameter = Utils.StringToBytes(abuseEmail); diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 2e1487f..c303d6d 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -80,6 +80,7 @@ namespace OpenSim.Region.CoreModules.World.Estate GetEstateFlags(), sun, Scene.RegionInfo.RegionSettings.Covenant, + (uint) Scene.RegionInfo.RegionSettings.CovenantChangedDateTime, Scene.RegionInfo.EstateSettings.AbuseEmail, estateOwner); @@ -268,6 +269,7 @@ namespace OpenSim.Region.CoreModules.World.Estate // remoteClient.Name, estateCovenantID); Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; + Scene.RegionInfo.RegionSettings.CovenantChangedDateTime = Util.UnixTimeSinceEpoch(); Scene.RegionInfo.RegionSettings.Save(); TriggerRegionInfoChange(); } diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 11f927c..c928af7 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1243,7 +1243,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } - public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) + public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) { } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 81bf9ed..be0d56e 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -933,7 +933,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC public void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List SpawnPoint) { } - public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) + public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) { } diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4d3d257..14c1287 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -972,7 +972,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) + public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) { } -- cgit v1.1