From 717fd3b5b91f54113ef554799f124275d5489ea1 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Wed, 3 Jun 2009 12:48:04 +0000 Subject: From: Chris Yeoh This patch adds oar file date and time (UTC) meta data to an oar file when it is created. It also adds a unique ID, though this id does not in anyway identify the machine that the oar file was created on. When an oar file with this meta data is loaded this extra information is saved with the region settings and available via LSL through: - osLoadedCreationDate() - osLoadedCreationTime() - osLoadedCreationID() If there is no meta data these fields will be blank. Subsequent oar file loads will erase the information for the previous oar file load. Persistence has only been implemented for MySQL, the other backends need updating. Overall this allows us to much more easily identify the specific version of software that clients are using. Its very straightforward to edit the oar file to change the ID string to be something more human friendly. Included in the patch is a new file OpenSim/Data/MySQL/Resources/030_RegionStore.sql required for the MySQL DB migration. btw I had a chat with justincc about this a few weeks ago since he wrote the oar file import/export and he sounded happy to accept something that included date/time information but didn't want anything that would silently leak private information like machine names. --- OpenSim/Data/MySQL/MySQLRegionData.cs | 26 ++++++++++++++++++++++-- OpenSim/Data/MySQL/Resources/030_RegionStore.sql | 7 +++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 OpenSim/Data/MySQL/Resources/030_RegionStore.sql (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 7038396..72c089e 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -741,7 +741,8 @@ namespace OpenSim.Data.MySQL "terrain_raise_limit, terrain_lower_limit, " + "use_estate_sun, fixed_sun, sun_position, " + "covenant, Sandbox, sunvectorx, sunvectory, " + - "sunvectorz) values ( ?RegionUUID, ?BlockTerraform, " + + "sunvectorz, loaded_creation_date, loaded_creation_time, " + + "loaded_creation_id) values ( ?RegionUUID, ?BlockTerraform, " + "?BlockFly, ?AllowDamage, ?RestrictPushing, " + "?AllowLandResell, ?AllowLandJoinDivide, " + "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + @@ -754,12 +755,14 @@ namespace OpenSim.Data.MySQL "?WaterHeight, ?TerrainRaiseLimit, " + "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + "?SunPosition, ?Covenant, ?Sandbox, " + - "?SunVectorX, ?SunVectorY, ?SunVectorZ)"; + "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + + "?LoadedCreationDate, ?LoadedCreationTime, ?LoadedCreationID)"; FillRegionSettingsCommand(cmd, rs); ExecuteNonQuery(cmd); cmd.Dispose(); + } } @@ -1039,6 +1042,21 @@ namespace OpenSim.Data.MySQL newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); newSettings.Covenant = new UUID((String) row["covenant"]); + if (row["loaded_creation_date"] is DBNull) + newSettings.LoadedCreationDate = ""; + else + newSettings.LoadedCreationDate = (String) row["loaded_creation_date"]; + + if (row["loaded_creation_time"] is DBNull) + newSettings.LoadedCreationTime = ""; + else + newSettings.LoadedCreationTime = (String) row["loaded_creation_time"]; + + if (row["loaded_creation_id"] is DBNull) + newSettings.LoadedCreationID = ""; + else + newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; + return newSettings; } @@ -1357,6 +1375,10 @@ 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("LoadedCreationDate", settings.LoadedCreationDate); + cmd.Parameters.AddWithValue("LoadedCreationTime", settings.LoadedCreationTime); + cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); + } /// diff --git a/OpenSim/Data/MySQL/Resources/030_RegionStore.sql b/OpenSim/Data/MySQL/Resources/030_RegionStore.sql new file mode 100644 index 0000000..dfdcf6d --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/030_RegionStore.sql @@ -0,0 +1,7 @@ +BEGIN; + +ALTER TABLE regionsettings ADD COLUMN loaded_creation_date varchar(20) default NULL; +ALTER TABLE regionsettings ADD COLUMN loaded_creation_time varchar(20) default NULL; +ALTER TABLE regionsettings ADD COLUMN loaded_creation_id varchar(64) default NULL; + +COMMIT; -- cgit v1.1