aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorDr Scofield2009-06-03 12:48:04 +0000
committerDr Scofield2009-06-03 12:48:04 +0000
commit717fd3b5b91f54113ef554799f124275d5489ea1 (patch)
tree64748d1b66ada5dc3d3a97d80547c18570d05e14 /OpenSim/Data
parentFrom: Chris Yeoh <yeohc@au1.ibm.com> (diff)
downloadopensim-SC_OLD-717fd3b5b91f54113ef554799f124275d5489ea1.zip
opensim-SC_OLD-717fd3b5b91f54113ef554799f124275d5489ea1.tar.gz
opensim-SC_OLD-717fd3b5b91f54113ef554799f124275d5489ea1.tar.bz2
opensim-SC_OLD-717fd3b5b91f54113ef554799f124275d5489ea1.tar.xz
From: Chris Yeoh <yeohc@au1.ibm.com>
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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs26
-rw-r--r--OpenSim/Data/MySQL/Resources/030_RegionStore.sql7
2 files changed, 31 insertions, 2 deletions
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
741 "terrain_raise_limit, terrain_lower_limit, " + 741 "terrain_raise_limit, terrain_lower_limit, " +
742 "use_estate_sun, fixed_sun, sun_position, " + 742 "use_estate_sun, fixed_sun, sun_position, " +
743 "covenant, Sandbox, sunvectorx, sunvectory, " + 743 "covenant, Sandbox, sunvectorx, sunvectory, " +
744 "sunvectorz) values ( ?RegionUUID, ?BlockTerraform, " + 744 "sunvectorz, loaded_creation_date, loaded_creation_time, " +
745 "loaded_creation_id) values ( ?RegionUUID, ?BlockTerraform, " +
745 "?BlockFly, ?AllowDamage, ?RestrictPushing, " + 746 "?BlockFly, ?AllowDamage, ?RestrictPushing, " +
746 "?AllowLandResell, ?AllowLandJoinDivide, " + 747 "?AllowLandResell, ?AllowLandJoinDivide, " +
747 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + 748 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " +
@@ -754,12 +755,14 @@ namespace OpenSim.Data.MySQL
754 "?WaterHeight, ?TerrainRaiseLimit, " + 755 "?WaterHeight, ?TerrainRaiseLimit, " +
755 "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + 756 "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " +
756 "?SunPosition, ?Covenant, ?Sandbox, " + 757 "?SunPosition, ?Covenant, ?Sandbox, " +
757 "?SunVectorX, ?SunVectorY, ?SunVectorZ)"; 758 "?SunVectorX, ?SunVectorY, ?SunVectorZ, " +
759 "?LoadedCreationDate, ?LoadedCreationTime, ?LoadedCreationID)";
758 760
759 FillRegionSettingsCommand(cmd, rs); 761 FillRegionSettingsCommand(cmd, rs);
760 762
761 ExecuteNonQuery(cmd); 763 ExecuteNonQuery(cmd);
762 cmd.Dispose(); 764 cmd.Dispose();
765
763 } 766 }
764 } 767 }
765 768
@@ -1039,6 +1042,21 @@ namespace OpenSim.Data.MySQL
1039 newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); 1042 newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
1040 newSettings.Covenant = new UUID((String) row["covenant"]); 1043 newSettings.Covenant = new UUID((String) row["covenant"]);
1041 1044
1045 if (row["loaded_creation_date"] is DBNull)
1046 newSettings.LoadedCreationDate = "";
1047 else
1048 newSettings.LoadedCreationDate = (String) row["loaded_creation_date"];
1049
1050 if (row["loaded_creation_time"] is DBNull)
1051 newSettings.LoadedCreationTime = "";
1052 else
1053 newSettings.LoadedCreationTime = (String) row["loaded_creation_time"];
1054
1055 if (row["loaded_creation_id"] is DBNull)
1056 newSettings.LoadedCreationID = "";
1057 else
1058 newSettings.LoadedCreationID = (String) row["loaded_creation_id"];
1059
1042 return newSettings; 1060 return newSettings;
1043 } 1061 }
1044 1062
@@ -1357,6 +1375,10 @@ namespace OpenSim.Data.MySQL
1357 cmd.Parameters.AddWithValue("FixedSun", settings.FixedSun); 1375 cmd.Parameters.AddWithValue("FixedSun", settings.FixedSun);
1358 cmd.Parameters.AddWithValue("SunPosition", settings.SunPosition); 1376 cmd.Parameters.AddWithValue("SunPosition", settings.SunPosition);
1359 cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); 1377 cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString());
1378 cmd.Parameters.AddWithValue("LoadedCreationDate", settings.LoadedCreationDate);
1379 cmd.Parameters.AddWithValue("LoadedCreationTime", settings.LoadedCreationTime);
1380 cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID);
1381
1360 } 1382 }
1361 1383
1362 /// <summary> 1384 /// <summary>
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 @@
1BEGIN;
2
3ALTER TABLE regionsettings ADD COLUMN loaded_creation_date varchar(20) default NULL;
4ALTER TABLE regionsettings ADD COLUMN loaded_creation_time varchar(20) default NULL;
5ALTER TABLE regionsettings ADD COLUMN loaded_creation_id varchar(64) default NULL;
6
7COMMIT;