From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- .../External/ExternalRepresentationUtils.cs | 6 +-- .../Serialization/External/OspResolver.cs | 44 +++++++++++----------- .../External/RegionSettingsSerializer.cs | 34 ++++++++--------- .../External/UserInventoryItemSerializer.cs | 22 +++++------ .../External/UserProfileSerializer.cs | 12 +++--- 5 files changed, 59 insertions(+), 59 deletions(-) (limited to 'OpenSim/Framework/Serialization/External') diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index 55640ac..1523fa9 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs @@ -106,13 +106,13 @@ namespace OpenSim.Framework.Serialization.External { errors = true; parseExceptionAction(nodeToFill, nodeName, e); - + if (xtr.EOF) { m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to unexpected end of XML"); break; } - + if (++numErrors == 10) { m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to too many parsing errors"); @@ -369,7 +369,7 @@ namespace OpenSim.Framework.Serialization.External break; case XmlNodeType.XmlDeclaration: - // For various reasons, not all serializations have xml declarations (or consistent ones) + // For various reasons, not all serializations have xml declarations (or consistent ones) // and as it's embedded inside a byte stream we don't need it anyway, so ignore. break; diff --git a/OpenSim/Framework/Serialization/External/OspResolver.cs b/OpenSim/Framework/Serialization/External/OspResolver.cs index fa7160f..a1e9d55 100644 --- a/OpenSim/Framework/Serialization/External/OspResolver.cs +++ b/OpenSim/Framework/Serialization/External/OspResolver.cs @@ -35,13 +35,13 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Framework.Serialization { /// - /// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for + /// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for /// identifying user profiles or supplying a simple name if no profile is available. /// public class OspResolver { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public const string OSPA_PREFIX = "ospa:"; public const string OSPA_NAME_KEY = "n"; public const string OSPA_NAME_VALUE_SEPARATOR = " "; @@ -76,7 +76,7 @@ namespace OpenSim.Framework.Serialization return null; } - + /// /// Make an OSPA given a user name /// @@ -89,17 +89,17 @@ namespace OpenSim.Framework.Serialization // m_log.DebugFormat("[OSP RESOLVER]: Made OSPA {0} for {1} {2}", ospa, firstName, lastName); // System.Console.WriteLine("[OSP RESOLVER]: Made OSPA {0} for {1} {2}", ospa, firstName, lastName); - + return ospa; } - + /// /// Resolve an osp string into the most suitable internal OpenSim identifier. /// - /// + /// /// In some cases this will be a UUID if a suitable profile exists on the system. In other cases, this may /// just return the same identifier after creating a temporary profile. - /// + /// /// /// /// @@ -111,14 +111,14 @@ namespace OpenSim.Framework.Serialization if (!ospa.StartsWith(OSPA_PREFIX)) { // m_log.DebugFormat("[OSP RESOLVER]: ResolveOspa() got unrecognized format [{0}]", ospa); - return UUID.Zero; + return UUID.Zero; } // m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa); - + string ospaMeat = ospa.Substring(OSPA_PREFIX.Length); string[] ospaTuples = ospaMeat.Split(OSPA_TUPLE_SEPARATOR_ARRAY); - + foreach (string tuple in ospaTuples) { int tupleSeparatorIndex = tuple.IndexOf(OSPA_PAIR_SEPARATOR); @@ -128,17 +128,17 @@ namespace OpenSim.Framework.Serialization m_log.WarnFormat("[OSP RESOLVER]: Ignoring non-tuple component {0} in OSPA {1}", tuple, ospa); continue; } - + string key = tuple.Remove(tupleSeparatorIndex).Trim(); string value = tuple.Substring(tupleSeparatorIndex + 1).Trim(); - + if (OSPA_NAME_KEY == key) return ResolveOspaName(value, userService); } - + return UUID.Zero; } - + /// /// Hash a profile name into a UUID /// @@ -148,7 +148,7 @@ namespace OpenSim.Framework.Serialization { return new UUID(Utils.MD5(Encoding.Unicode.GetBytes(name)), 0); } - + /// /// Resolve an OSPI name by querying existing persistent user profiles. If there is no persistent user profile /// then a temporary user profile is inserted in the cache. @@ -164,13 +164,13 @@ namespace OpenSim.Framework.Serialization return UUID.Zero; int nameSeparatorIndex = name.IndexOf(OSPA_NAME_VALUE_SEPARATOR); - + if (nameSeparatorIndex < 0) { m_log.WarnFormat("[OSP RESOLVER]: Ignoring unseparated name {0}", name); return UUID.Zero; } - + string firstName = name.Remove(nameSeparatorIndex).TrimEnd(); string lastName = name.Substring(nameSeparatorIndex + 1).TrimStart(); @@ -178,14 +178,14 @@ namespace OpenSim.Framework.Serialization if (account != null) { // m_log.DebugFormat( -// "[OSP RESOLVER]: Found user account with uuid {0} for {1} {2}", +// "[OSP RESOLVER]: Found user account with uuid {0} for {1} {2}", // account.PrincipalID, firstName, lastName); - + return account.PrincipalID; } // else // { -// m_log.DebugFormat("[OSP RESOLVER]: No resolved OSPA user account for {0}", name); +// m_log.DebugFormat("[OSP RESOLVER]: No resolved OSPA user account for {0}", name); // } // XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc @@ -194,11 +194,11 @@ namespace OpenSim.Framework.Serialization tempUserProfile.FirstName = firstName; tempUserProfile.SurName = lastName; tempUserProfile.ID = HashName(tempUserProfile.Name); - + m_log.DebugFormat( "[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID); commsManager.UserService.AddTemporaryUserProfile(tempUserProfile); - + return tempUserProfile.ID; */ diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index 19468c3..617c451 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs @@ -50,7 +50,7 @@ namespace OpenSim.Framework.Serialization.External { return Deserialize(Encoding.ASCII.GetString(serializedSettings, 0, serializedSettings.Length)); } - + /// /// Deserialize settings /// @@ -60,14 +60,14 @@ namespace OpenSim.Framework.Serialization.External public static RegionSettings Deserialize(string serializedSettings) { RegionSettings settings = new RegionSettings(); - + StringReader sr = new StringReader(serializedSettings); XmlTextReader xtr = new XmlTextReader(sr); - + xtr.ReadStartElement("RegionSettings"); - + xtr.ReadStartElement("General"); - + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) { switch (xtr.Name) @@ -113,10 +113,10 @@ namespace OpenSim.Framework.Serialization.External break; } } - + xtr.ReadEndElement(); xtr.ReadStartElement("GroundTextures"); - + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) { switch (xtr.Name) @@ -159,10 +159,10 @@ namespace OpenSim.Framework.Serialization.External break; } } - + xtr.ReadEndElement(); xtr.ReadStartElement("Terrain"); - + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) { switch (xtr.Name) @@ -212,19 +212,19 @@ namespace OpenSim.Framework.Serialization.External xtr.Close(); sr.Close(); - + return settings; } - + public static string Serialize(RegionSettings settings) { StringWriter sw = new StringWriter(); XmlTextWriter xtw = new XmlTextWriter(sw); xtw.Formatting = Formatting.Indented; xtw.WriteStartDocument(); - + xtw.WriteStartElement("RegionSettings"); - + xtw.WriteStartElement("General"); xtw.WriteElementString("AllowDamage", settings.AllowDamage.ToString()); xtw.WriteElementString("AllowLandResell", settings.AllowLandResell.ToString()); @@ -255,7 +255,7 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("ElevationHighSE", settings.Elevation2SE.ToString()); xtw.WriteElementString("ElevationHighNE", settings.Elevation2NE.ToString()); xtw.WriteEndElement(); - + xtw.WriteStartElement("Terrain"); xtw.WriteElementString("WaterHeight", settings.WaterHeight.ToString()); xtw.WriteElementString("TerrainRaiseLimit", settings.TerrainRaiseLimit.ToString()); @@ -275,12 +275,12 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("SpawnPoint", sp.ToString()); } xtw.WriteEndElement(); - + xtw.WriteEndElement(); - + xtw.Close(); sw.Close(); - + return sw.ToString(); } } diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index 994cede..9b02553 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs @@ -36,9 +36,9 @@ using log4net; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Services.Interfaces; - + namespace OpenSim.Framework.Serialization.External -{ +{ /// /// Serialize and deserialize user inventory items as an external format. /// @@ -49,14 +49,14 @@ namespace OpenSim.Framework.Serialization.External private static Dictionary> m_InventoryItemXmlProcessors = new Dictionary>(); - #region InventoryItemBase Processor initialization + #region InventoryItemBase Processor initialization static UserInventoryItemSerializer() { m_InventoryItemXmlProcessors.Add("Name", ProcessName); m_InventoryItemXmlProcessors.Add("ID", ProcessID); m_InventoryItemXmlProcessors.Add("InvType", ProcessInvType); m_InventoryItemXmlProcessors.Add("CreatorUUID", ProcessCreatorUUID); - m_InventoryItemXmlProcessors.Add("CreatorID", ProcessCreatorID); + m_InventoryItemXmlProcessors.Add("CreatorID", ProcessCreatorID); m_InventoryItemXmlProcessors.Add("CreatorData", ProcessCreatorData); m_InventoryItemXmlProcessors.Add("CreationDate", ProcessCreationDate); m_InventoryItemXmlProcessors.Add("Owner", ProcessOwner); @@ -73,7 +73,7 @@ namespace OpenSim.Framework.Serialization.External m_InventoryItemXmlProcessors.Add("GroupID", ProcessGroupID); m_InventoryItemXmlProcessors.Add("GroupOwned", ProcessGroupOwned); } - #endregion + #endregion #region InventoryItemBase Processors private static void ProcessName(InventoryItemBase item, XmlReader reader) @@ -189,7 +189,7 @@ namespace OpenSim.Framework.Serialization.External { return Deserialize(Encoding.ASCII.GetString(serialization, 0, serialization.Length)); } - + /// /// Deserialize settings /// @@ -212,8 +212,8 @@ namespace OpenSim.Framework.Serialization.External //m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID); return item; - } - + } + public static string Serialize(InventoryItemBase inventoryItem, Dictionary options, IUserAccountService userAccountService) { StringWriter sw = new StringWriter(); @@ -294,11 +294,11 @@ namespace OpenSim.Framework.Serialization.External } writer.WriteEndElement(); - + writer.Close(); sw.Close(); - + return sw.ToString(); - } + } } } diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index c685a15..34eaa99 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -42,31 +42,31 @@ namespace OpenSim.Framework.Serialization.External { public const int MAJOR_VERSION = 0; public const int MINOR_VERSION = 1; - + public static string Serialize(UUID userID, string firstName, string lastName) { 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", firstName + " " + lastName); xtw.WriteElementString("id", userID.ToString()); xtw.WriteElementString("about", ""); - + // 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(); } } -- cgit v1.1