From 3dc2010da6412941bfbcdb29007b12a8f37b7bef Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 29 Jun 2009 15:05:12 +0000 Subject: From: Chris Yeoh 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. --- .../CoreModules/World/Archiver/ArchiveReadRequest.cs | 15 +++++---------- .../World/Archiver/ArchiveWriteRequestExecution.cs | 6 +++--- 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/CoreModules/World') 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 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; // Loaded metadata will empty if no information exists in the archive - currentRegionSettings.LoadedCreationDate = ""; - currentRegionSettings.LoadedCreationTime = ""; + currentRegionSettings.LoadedCreationDateTime = 0; currentRegionSettings.LoadedCreationID = ""; while (xtr.Read()) { if (xtr.NodeType == XmlNodeType.Element) { - if (xtr.Name.ToString() == "date") + if (xtr.Name.ToString() == "datetime") { - // Disable date & time for now until load problem in - // http://opensimulator.org/mantis/view.php?id=3741 (note 0012120 by WWWench) is resolved - //currentRegionSettings.LoadedCreationDate = xtr.ReadElementContentAsString(); + int value; + if (Int32.TryParse(xtr.ReadElementContentAsString(), out value)) + currentRegionSettings.LoadedCreationDateTime = value; } - else if (xtr.Name.ToString() == "time") - { - //currentRegionSettings.LoadedCreationTime = xtr.ReadElementContentAsString(); - } else if (xtr.Name.ToString() == "id") { 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 xtw.WriteStartDocument(); xtw.WriteStartElement("archive"); xtw.WriteAttributeString("major_version", "0"); - xtw.WriteAttributeString("minor_version", "2"); + xtw.WriteAttributeString("minor_version", "3"); xtw.WriteStartElement("creation_info"); DateTime now = DateTime.UtcNow; - xtw.WriteElementString("date", now.ToLongDateString()); - xtw.WriteElementString("time", now.ToLongTimeString()); + TimeSpan t = now - new DateTime(1970, 1, 1); + xtw.WriteElementString("datetime", ((int)t.TotalSeconds).ToString()); xtw.WriteElementString("id", UUID.Random().ToString()); xtw.WriteEndElement(); xtw.WriteEndElement(); -- cgit v1.1