From 93b26f89336d83f2eab43ced0081d60b1acf2d7f Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 26 Mar 2009 17:25:12 +0000 Subject: * iars: Serialize information about item creators to archive --- .../External/UserProfileSerializer.cs | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 OpenSim/Framework/Serialization/External/UserProfileSerializer.cs (limited to 'OpenSim/Framework/Serialization/External/UserProfileSerializer.cs') diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs new file mode 100644 index 0000000..fc76fb6 --- /dev/null +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -0,0 +1,71 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System.IO; +using System.Xml; +using OpenSim.Framework; + +namespace OpenSim.Framework.Serialization.External +{ + /// + /// Serialize and deserialize region settings for an archive file format. + /// + /// We didn't use automatic .NET serialization since this is really + /// a file format rather than an object serialization. + public class UserProfileSerializer + { + public const int MAJOR_VERSION = 0; + public const int MINOR_VERSION = 1; + + public static string Serialize(UserProfileData profile) + { + StringWriter sw = new StringWriter(); + XmlTextWriter xtw = new XmlTextWriter(sw); + xtw.Formatting = Formatting.Indented; + xtw.WriteStartDocument(); + + xtw.WriteStartElement("user_profile"); + xtw.WriteAttributeString("major_version", MAJOR_VERSION.ToString()); + xtw.WriteAttributeString("minor_version", MINOR_VERSION.ToString()); + + xtw.WriteElementString("name", profile.Name); + xtw.WriteElementString("id", profile.ID); + xtw.WriteElementString("about", profile.AboutText); + + // Not sure if we're storing this yet, need to take a look +// xtw.WriteElementString("Url", profile.Url); + // or, indeed, interests + + xtw.WriteEndElement(); + + xtw.Close(); + sw.Close(); + + return sw.ToString(); + } + } +} \ No newline at end of file -- cgit v1.1 From 3f1ec6334f59303d8223265dda97dc6b86b3fd3d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 26 Mar 2009 17:30:43 +0000 Subject: * Fix build break from last commit --- OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Serialization/External/UserProfileSerializer.cs') diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index fc76fb6..544d13d 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -27,6 +27,7 @@ using System.IO; using System.Xml; +using OpenMetaverse; using OpenSim.Framework; namespace OpenSim.Framework.Serialization.External @@ -53,7 +54,7 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteAttributeString("minor_version", MINOR_VERSION.ToString()); xtw.WriteElementString("name", profile.Name); - xtw.WriteElementString("id", profile.ID); + xtw.WriteElementString("id", profile.ID.ToString()); xtw.WriteElementString("about", profile.AboutText); // Not sure if we're storing this yet, need to take a look -- cgit v1.1 From 1ccc99a3f9d96fbdea478be7e7df427a9e5377a7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 23 Apr 2009 20:15:05 +0000 Subject: * refactor: move archive user inventory item serialization out to a separate file --- OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Framework/Serialization/External/UserProfileSerializer.cs') diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index 544d13d..6bf56c2 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -33,10 +33,8 @@ using OpenSim.Framework; namespace OpenSim.Framework.Serialization.External { /// - /// Serialize and deserialize region settings for an archive file format. + /// Serialize and deserialize region settings as an external format. /// - /// We didn't use automatic .NET serialization since this is really - /// a file format rather than an object serialization. public class UserProfileSerializer { public const int MAJOR_VERSION = 0; -- cgit v1.1 From 840de6c036570d559ec6924cd8405d3f34a99fdd Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 1 Jun 2009 06:37:14 +0000 Subject: Minor: Change OpenSim to OpenSimulator in older copyright headers and LICENSE.txt. --- OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/Serialization/External/UserProfileSerializer.cs') diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index 6bf56c2..eb77e65 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -9,7 +9,7 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSim Project nor the + * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * -- cgit v1.1 From ee205e7e812e170f670e690a4e0fa9caa652f226 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 1 Oct 2009 01:00:09 +0900 Subject: Formatting cleanup. --- OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Serialization/External/UserProfileSerializer.cs') diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index eb77e65..fb269b7 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -36,7 +36,7 @@ namespace OpenSim.Framework.Serialization.External /// Serialize and deserialize region settings as an external format. /// public class UserProfileSerializer - { + { public const int MAJOR_VERSION = 0; public const int MINOR_VERSION = 1; @@ -65,6 +65,6 @@ namespace OpenSim.Framework.Serialization.External sw.Close(); return sw.ToString(); - } + } } } \ No newline at end of file -- cgit v1.1 From 1e1b2ab221851efc414678b7ea52ef2ca788ce9f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 10:40:07 -0800 Subject: * OMG! All but one references to UserProfileCacheService have been rerouted! * HG is seriously broken here * Compiles. Untested. --- .../Framework/Serialization/External/UserProfileSerializer.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework/Serialization/External/UserProfileSerializer.cs') diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index fb269b7..de106b2 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -29,6 +29,7 @@ using System.IO; using System.Xml; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Services.Interfaces; namespace OpenSim.Framework.Serialization.External { @@ -40,7 +41,7 @@ namespace OpenSim.Framework.Serialization.External public const int MAJOR_VERSION = 0; public const int MINOR_VERSION = 1; - public static string Serialize(UserProfileData profile) + public static string Serialize(UserAccount profile) { StringWriter sw = new StringWriter(); XmlTextWriter xtw = new XmlTextWriter(sw); @@ -51,9 +52,9 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteAttributeString("major_version", MAJOR_VERSION.ToString()); xtw.WriteAttributeString("minor_version", MINOR_VERSION.ToString()); - xtw.WriteElementString("name", profile.Name); - xtw.WriteElementString("id", profile.ID.ToString()); - xtw.WriteElementString("about", profile.AboutText); + xtw.WriteElementString("name", profile.FirstName + " " + profile.LastName); + xtw.WriteElementString("id", profile.PrincipalID.ToString()); + xtw.WriteElementString("about", ""); // Not sure if we're storing this yet, need to take a look // xtw.WriteElementString("Url", profile.Url); -- cgit v1.1 From 53e83e5dbb3590cb9c858aa301665357d1511b30 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 16:20:59 -0800 Subject: * Starting to clean the house... * Fixed circular dependency --- OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/Serialization/External/UserProfileSerializer.cs') diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index de106b2..a8ffa17 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -41,7 +41,7 @@ namespace OpenSim.Framework.Serialization.External public const int MAJOR_VERSION = 0; public const int MINOR_VERSION = 1; - public static string Serialize(UserAccount profile) + public static string Serialize(UUID userID, string firstName, string lastName) { StringWriter sw = new StringWriter(); XmlTextWriter xtw = new XmlTextWriter(sw); @@ -52,8 +52,8 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteAttributeString("major_version", MAJOR_VERSION.ToString()); xtw.WriteAttributeString("minor_version", MINOR_VERSION.ToString()); - xtw.WriteElementString("name", profile.FirstName + " " + profile.LastName); - xtw.WriteElementString("id", profile.PrincipalID.ToString()); + xtw.WriteElementString("name", firstName + " " + lastName); + xtw.WriteElementString("id", userID.ToString()); xtw.WriteElementString("about", ""); // Not sure if we're storing this yet, need to take a look -- cgit v1.1 From 68b7307f4f9c6390f4ad4326724247257409ab02 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 16:34:01 -0800 Subject: Forgot to remove 'using' --- OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Framework/Serialization/External/UserProfileSerializer.cs') diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index a8ffa17..f50b49a 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -29,7 +29,6 @@ using System.IO; using System.Xml; using OpenMetaverse; using OpenSim.Framework; -using OpenSim.Services.Interfaces; namespace OpenSim.Framework.Serialization.External { -- cgit v1.1 From f17066b7bf27c22448d883e0af9d20a42f671b62 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 3 Feb 2012 22:21:54 +0000 Subject: Change LandDataSerializer deserialization so that in the future it won't care about extra elements or element order. This brings it into line with other deserializations such as object and will improve future backward compatibility. --- OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Serialization/External/UserProfileSerializer.cs') diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index f50b49a..c685a15 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -33,8 +33,11 @@ using OpenSim.Framework; namespace OpenSim.Framework.Serialization.External { /// - /// Serialize and deserialize region settings as an external format. + /// Serialize and deserialize user profiles as an external format. /// + /// + /// Currently UNUSED. + /// public class UserProfileSerializer { public const int MAJOR_VERSION = 0; -- cgit v1.1