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/Region/CoreModules/World/Archiver | |
parent | Thank you kindly, Godfrey, for a patch that: (diff) | |
download | opensim-SC-3dc2010da6412941bfbcdb29007b12a8f37b7bef.zip opensim-SC-3dc2010da6412941bfbcdb29007b12a8f37b7bef.tar.gz opensim-SC-3dc2010da6412941bfbcdb29007b12a8f37b7bef.tar.bz2 opensim-SC-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/Region/CoreModules/World/Archiver')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs | 6 |
2 files changed, 8 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 5c596a1..150798b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -504,24 +504,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
504 | RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; | 504 | RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; |
505 | 505 | ||
506 | // Loaded metadata will empty if no information exists in the archive | 506 | // Loaded metadata will empty if no information exists in the archive |
507 | currentRegionSettings.LoadedCreationDate = ""; | 507 | currentRegionSettings.LoadedCreationDateTime = 0; |
508 | currentRegionSettings.LoadedCreationTime = ""; | ||
509 | currentRegionSettings.LoadedCreationID = ""; | 508 | currentRegionSettings.LoadedCreationID = ""; |
510 | 509 | ||
511 | while (xtr.Read()) | 510 | while (xtr.Read()) |
512 | { | 511 | { |
513 | if (xtr.NodeType == XmlNodeType.Element) | 512 | if (xtr.NodeType == XmlNodeType.Element) |
514 | { | 513 | { |
515 | if (xtr.Name.ToString() == "date") | 514 | if (xtr.Name.ToString() == "datetime") |
516 | { | 515 | { |
517 | // Disable date & time for now until load problem in | 516 | int value; |
518 | // http://opensimulator.org/mantis/view.php?id=3741 (note 0012120 by WWWench) is resolved | 517 | if (Int32.TryParse(xtr.ReadElementContentAsString(), out value)) |
519 | //currentRegionSettings.LoadedCreationDate = xtr.ReadElementContentAsString(); | 518 | currentRegionSettings.LoadedCreationDateTime = value; |
520 | } | 519 | } |
521 | else if (xtr.Name.ToString() == "time") | ||
522 | { | ||
523 | //currentRegionSettings.LoadedCreationTime = xtr.ReadElementContentAsString(); | ||
524 | } | ||
525 | else if (xtr.Name.ToString() == "id") | 520 | else if (xtr.Name.ToString() == "id") |
526 | { | 521 | { |
527 | currentRegionSettings.LoadedCreationID = xtr.ReadElementContentAsString(); | 522 | currentRegionSettings.LoadedCreationID = xtr.ReadElementContentAsString(); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index ac5d067..a62c5b3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -152,12 +152,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
152 | xtw.WriteStartDocument(); | 152 | xtw.WriteStartDocument(); |
153 | xtw.WriteStartElement("archive"); | 153 | xtw.WriteStartElement("archive"); |
154 | xtw.WriteAttributeString("major_version", "0"); | 154 | xtw.WriteAttributeString("major_version", "0"); |
155 | xtw.WriteAttributeString("minor_version", "2"); | 155 | xtw.WriteAttributeString("minor_version", "3"); |
156 | 156 | ||
157 | xtw.WriteStartElement("creation_info"); | 157 | xtw.WriteStartElement("creation_info"); |
158 | DateTime now = DateTime.UtcNow; | 158 | DateTime now = DateTime.UtcNow; |
159 | xtw.WriteElementString("date", now.ToLongDateString()); | 159 | TimeSpan t = now - new DateTime(1970, 1, 1); |
160 | xtw.WriteElementString("time", now.ToLongTimeString()); | 160 | xtw.WriteElementString("datetime", ((int)t.TotalSeconds).ToString()); |
161 | xtw.WriteElementString("id", UUID.Random().ToString()); | 161 | xtw.WriteElementString("id", UUID.Random().ToString()); |
162 | xtw.WriteEndElement(); | 162 | xtw.WriteEndElement(); |
163 | xtw.WriteEndElement(); | 163 | xtw.WriteEndElement(); |