diff options
author | Sean Dague | 2009-06-29 15:05:12 +0000 |
---|---|---|
committer | Sean Dague | 2009-06-29 15:05:12 +0000 |
commit | 3dc2010da6412941bfbcdb29007b12a8f37b7bef (patch) | |
tree | f9fa0ad53b712d91d8fcc21aa6513c8a94dd4bf4 /OpenSim/Data | |
parent | Thank you kindly, Godfrey, for a patch that: (diff) | |
download | opensim-SC_OLD-3dc2010da6412941bfbcdb29007b12a8f37b7bef.zip opensim-SC_OLD-3dc2010da6412941bfbcdb29007b12a8f37b7bef.tar.gz opensim-SC_OLD-3dc2010da6412941bfbcdb29007b12a8f37b7bef.tar.bz2 opensim-SC_OLD-3dc2010da6412941bfbcdb29007b12a8f37b7bef.tar.xz |
From: Chris Yeoh <yeohc@au1.ibm.com>
Attached is a patch that changes the oar file saving of creation date/time to an integer
instead of a string. I did this after justincc emailed me saying there is a problem
with internationalisation doing it the old way and I said I'd fix it. Its been
tested with MySQL and I've made the changes for MSSQL but that hasn't been well tested.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLRegionData.cs | 19 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/023_RegionStore.sql | 7 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 17 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/031_RegionStore.sql | 7 |
4 files changed, 23 insertions, 27 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 293282e..1aaf2a5 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -723,7 +723,7 @@ VALUES | |||
723 | ,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se | 723 | ,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se |
724 | ,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit | 724 | ,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit |
725 | ,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position | 725 | ,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position |
726 | ,[covenant] = @covenant , [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_date] = @loaded_creation_date, [loaded_creation_time] = @loaded_creation_time, [loaded_creation_id] = @loaded_creation_id | 726 | ,[covenant] = @covenant , [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id |
727 | WHERE [regionUUID] = @regionUUID"; | 727 | WHERE [regionUUID] = @regionUUID"; |
728 | 728 | ||
729 | using (AutoClosingSqlCommand cmd = _Database.Query(sql)) | 729 | using (AutoClosingSqlCommand cmd = _Database.Query(sql)) |
@@ -777,14 +777,14 @@ VALUES | |||
777 | [block_show_in_search],[agent_limit],[object_bonus],[maturity],[disable_scripts],[disable_collisions],[disable_physics], | 777 | [block_show_in_search],[agent_limit],[object_bonus],[maturity],[disable_scripts],[disable_collisions],[disable_physics], |
778 | [terrain_texture_1],[terrain_texture_2],[terrain_texture_3],[terrain_texture_4],[elevation_1_nw],[elevation_2_nw],[elevation_1_ne], | 778 | [terrain_texture_1],[terrain_texture_2],[terrain_texture_3],[terrain_texture_4],[elevation_1_nw],[elevation_2_nw],[elevation_1_ne], |
779 | [elevation_2_ne],[elevation_1_se],[elevation_2_se],[elevation_1_sw],[elevation_2_sw],[water_height],[terrain_raise_limit], | 779 | [elevation_2_ne],[elevation_1_se],[elevation_2_se],[elevation_1_sw],[elevation_2_sw],[water_height],[terrain_raise_limit], |
780 | [terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_date], [loaded_creation_time], [loaded_creation_id] | 780 | [terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id] |
781 | ) | 781 | ) |
782 | VALUES | 782 | VALUES |
783 | (@regionUUID,@block_terraform,@block_fly,@allow_damage,@restrict_pushing,@allow_land_resell,@allow_land_join_divide, | 783 | (@regionUUID,@block_terraform,@block_fly,@allow_damage,@restrict_pushing,@allow_land_resell,@allow_land_join_divide, |
784 | @block_show_in_search,@agent_limit,@object_bonus,@maturity,@disable_scripts,@disable_collisions,@disable_physics, | 784 | @block_show_in_search,@agent_limit,@object_bonus,@maturity,@disable_scripts,@disable_collisions,@disable_physics, |
785 | @terrain_texture_1,@terrain_texture_2,@terrain_texture_3,@terrain_texture_4,@elevation_1_nw,@elevation_2_nw,@elevation_1_ne, | 785 | @terrain_texture_1,@terrain_texture_2,@terrain_texture_3,@terrain_texture_4,@elevation_1_nw,@elevation_2_nw,@elevation_1_ne, |
786 | @elevation_2_ne,@elevation_1_se,@elevation_2_se,@elevation_1_sw,@elevation_2_sw,@water_height,@terrain_raise_limit, | 786 | @elevation_2_ne,@elevation_1_se,@elevation_2_se,@elevation_1_sw,@elevation_2_sw,@water_height,@terrain_raise_limit, |
787 | @terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant,@sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_date, @loaded_creation_time, @loaded_creation_id)"; | 787 | @terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant,@sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)"; |
788 | 788 | ||
789 | using (AutoClosingSqlCommand cmd = _Database.Query(sql)) | 789 | using (AutoClosingSqlCommand cmd = _Database.Query(sql)) |
790 | { | 790 | { |
@@ -845,15 +845,7 @@ VALUES | |||
845 | ); | 845 | ); |
846 | newSettings.Covenant = new UUID((Guid)row["covenant"]); | 846 | newSettings.Covenant = new UUID((Guid)row["covenant"]); |
847 | 847 | ||
848 | if (row["loaded_creation_date"] is DBNull) | 848 | newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); |
849 | newSettings.LoadedCreationDate = ""; | ||
850 | else | ||
851 | newSettings.LoadedCreationDate = (String)row["loaded_creation_date"]; | ||
852 | |||
853 | if (row["loaded_creation_time"] is DBNull) | ||
854 | newSettings.LoadedCreationTime = ""; | ||
855 | else | ||
856 | newSettings.LoadedCreationTime = (String)row["loaded_creation_time"]; | ||
857 | 849 | ||
858 | if (row["loaded_creation_id"] is DBNull) | 850 | if (row["loaded_creation_id"] is DBNull) |
859 | newSettings.LoadedCreationID = ""; | 851 | newSettings.LoadedCreationID = ""; |
@@ -1257,8 +1249,7 @@ VALUES | |||
1257 | parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y)); | 1249 | parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y)); |
1258 | parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z)); | 1250 | parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z)); |
1259 | parameters.Add(_Database.CreateParameter("covenant", settings.Covenant)); | 1251 | parameters.Add(_Database.CreateParameter("covenant", settings.Covenant)); |
1260 | parameters.Add(_Database.CreateParameter("LoadedCreationDate", settings.LoadedCreationDate)); | 1252 | parameters.Add(_Database.CreateParameter("LoadedCreationDateTime", settings.LoadedCreationDateTime)); |
1261 | parameters.Add(_Database.CreateParameter("LoadedCreationTime", settings.LoadedCreationTime)); | ||
1262 | parameters.Add(_Database.CreateParameter("LoadedCreationID", settings.LoadedCreationID)); | 1253 | parameters.Add(_Database.CreateParameter("LoadedCreationID", settings.LoadedCreationID)); |
1263 | 1254 | ||
1264 | return parameters.ToArray(); | 1255 | return parameters.ToArray(); |
diff --git a/OpenSim/Data/MSSQL/Resources/023_RegionStore.sql b/OpenSim/Data/MSSQL/Resources/023_RegionStore.sql new file mode 100644 index 0000000..61b08f1 --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/023_RegionStore.sql | |||
@@ -0,0 +1,7 @@ | |||
1 | BEGIN TRANSACTION | ||
2 | |||
3 | ALTER TABLE regionsettings DROP COLUMN loaded_creation_date; | ||
4 | ALTER TABLE regionsettings DROP COLUMN loaded_creation_time; | ||
5 | ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT NULL default 0; | ||
6 | |||
7 | COMMIT | ||
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 72c089e..a72ae45 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -741,7 +741,7 @@ 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, loaded_creation_date, loaded_creation_time, " + | 744 | "sunvectorz, loaded_creation_datetime, " + |
745 | "loaded_creation_id) values ( ?RegionUUID, ?BlockTerraform, " + | 745 | "loaded_creation_id) values ( ?RegionUUID, ?BlockTerraform, " + |
746 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + | 746 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + |
747 | "?AllowLandResell, ?AllowLandJoinDivide, " + | 747 | "?AllowLandResell, ?AllowLandJoinDivide, " + |
@@ -756,7 +756,7 @@ namespace OpenSim.Data.MySQL | |||
756 | "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + | 756 | "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + |
757 | "?SunPosition, ?Covenant, ?Sandbox, " + | 757 | "?SunPosition, ?Covenant, ?Sandbox, " + |
758 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + | 758 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + |
759 | "?LoadedCreationDate, ?LoadedCreationTime, ?LoadedCreationID)"; | 759 | "?LoadedCreationDateTime, ?LoadedCreationID)"; |
760 | 760 | ||
761 | FillRegionSettingsCommand(cmd, rs); | 761 | FillRegionSettingsCommand(cmd, rs); |
762 | 762 | ||
@@ -1042,15 +1042,7 @@ namespace OpenSim.Data.MySQL | |||
1042 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); | 1042 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); |
1043 | newSettings.Covenant = new UUID((String) row["covenant"]); | 1043 | newSettings.Covenant = new UUID((String) row["covenant"]); |
1044 | 1044 | ||
1045 | if (row["loaded_creation_date"] is DBNull) | 1045 | newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); |
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 | 1046 | ||
1055 | if (row["loaded_creation_id"] is DBNull) | 1047 | if (row["loaded_creation_id"] is DBNull) |
1056 | newSettings.LoadedCreationID = ""; | 1048 | newSettings.LoadedCreationID = ""; |
@@ -1375,8 +1367,7 @@ namespace OpenSim.Data.MySQL | |||
1375 | cmd.Parameters.AddWithValue("FixedSun", settings.FixedSun); | 1367 | cmd.Parameters.AddWithValue("FixedSun", settings.FixedSun); |
1376 | cmd.Parameters.AddWithValue("SunPosition", settings.SunPosition); | 1368 | cmd.Parameters.AddWithValue("SunPosition", settings.SunPosition); |
1377 | cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); | 1369 | cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); |
1378 | cmd.Parameters.AddWithValue("LoadedCreationDate", settings.LoadedCreationDate); | 1370 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDate); |
1379 | cmd.Parameters.AddWithValue("LoadedCreationTime", settings.LoadedCreationTime); | ||
1380 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); | 1371 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); |
1381 | 1372 | ||
1382 | } | 1373 | } |
diff --git a/OpenSim/Data/MySQL/Resources/031_RegionStore.sql b/OpenSim/Data/MySQL/Resources/031_RegionStore.sql new file mode 100644 index 0000000..d069296 --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/031_RegionStore.sql | |||
@@ -0,0 +1,7 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE regionsettings DROP COLUMN loaded_creation_date; | ||
4 | ALTER TABLE regionsettings DROP COLUMN loaded_creation_time; | ||
5 | ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT NULL default 0; | ||
6 | |||
7 | COMMIT; | ||