Scripts/Accounting/Account.cs
/// <summary>
/// Serializes this Account instance to an XmlTextWriter.
/// </summary>
/// <param name="xml">The XmlTextWriter instance from which to serialize.</param>
Serializes this Account instance to an XmlTextWriter.
Serializes this Account instance to an XmlTextWriter .
public void Save( XmlTextWriter xml )
		{
			xml.WriteStartElement( "account" );
			xml.WriteStartElement( "username" );
			xml.WriteString( m_Username );
			xml.WriteEndElement();
			if ( m_PlainPassword != null )
			{
				xml.WriteStartElement( "password" );
				xml.WriteString( m_PlainPassword );
				xml.WriteEndElement();
			}
			if ( m_CryptPassword != null )
			{
				xml.WriteStartElement( "cryptPassword" );
				xml.WriteString( m_CryptPassword );
				xml.WriteEndElement();
			}
			if ( m_NewCryptPassword != null )
			{
				xml.WriteStartElement( "newCryptPassword" );
				xml.WriteString( m_NewCryptPassword );
				xml.WriteEndElement();
			}
			if ( m_AccessLevel != AccessLevel.Player )
			{
				xml.WriteStartElement( "accessLevel" );
				xml.WriteString( m_AccessLevel.ToString() );
				xml.WriteEndElement();
			}
			if ( m_Flags != 0 )
			{
				xml.WriteStartElement( "flags" );
				xml.WriteString( XmlConvert.ToString( m_Flags ) );
				xml.WriteEndElement();
			}
			xml.WriteStartElement( "created" );
			xml.WriteString( XmlConvert.ToString( m_Created, XmlDateTimeSerializationMode.Local ) );
			xml.WriteEndElement();
			xml.WriteStartElement( "lastLogin" );
			xml.WriteString( XmlConvert.ToString( m_LastLogin, XmlDateTimeSerializationMode.Local ) );
			xml.WriteEndElement();
			xml.WriteStartElement( "totalGameTime" );
			xml.WriteString( XmlConvert.ToString( TotalGameTime ) );
			xml.WriteEndElement();
			xml.WriteStartElement( "chars" );
			for ( int i = 0; i < m_Mobiles.Length; ++i )
			{
				Mobile m = m_Mobiles[i];
				if ( m != null && !m.Deleted )
				{
					xml.WriteStartElement( "char" );
					xml.WriteAttributeString( "index", i.ToString() );
					xml.WriteString( m.Serial.Value.ToString() );
					xml.WriteEndElement();
				}
			}
			xml.WriteEndElement();
			if ( m_Comments != null && m_Comments.Count > 0 )
			{
				xml.WriteStartElement( "comments" );
				for ( int i = 0; i < m_Comments.Count; ++i )
					m_Comments[i].Save( xml );
				xml.WriteEndElement();
			}
			if ( m_Tags != null && m_Tags.Count > 0 )
			{
				xml.WriteStartElement( "tags" );
				for ( int i = 0; i < m_Tags.Count; ++i )
					m_Tags[i].Save( xml );
				xml.WriteEndElement();
			}
			if ( m_LoginIPs.Length > 0 )
			{
				xml.WriteStartElement( "addressList" );
				xml.WriteAttributeString( "count", m_LoginIPs.Length.ToString() );
				for ( int i = 0; i < m_LoginIPs.Length; ++i )
				{
					xml.WriteStartElement( "ip" );
					xml.WriteString( m_LoginIPs[i].ToString() );
					xml.WriteEndElement();
				}
				xml.WriteEndElement();
			}
			if ( m_IPRestrictions.Length > 0 )
			{
				xml.WriteStartElement( "accessCheck" );
				for ( int i = 0; i < m_IPRestrictions.Length; ++i )
				{
					xml.WriteStartElement( "ip" );
					xml.WriteString( m_IPRestrictions[i] );
					xml.WriteEndElement();
				}
				xml.WriteEndElement();
			}
			xml.WriteEndElement();
		}
public void Save ( XmlTextWriter xml ) { xml . WriteStartElement ( " " ) ; xml . WriteStartElement ( " " ) ; xml . WriteString ( m_Username ) ; xml . WriteEndElement ( ) ; if ( m_PlainPassword != null ) { xml . WriteStartElement ( " " ) ; xml . WriteString ( m_PlainPassword ) ; xml . WriteEndElement ( ) ; } if ( m_CryptPassword != null ) { xml . WriteStartElement ( " " ) ; xml . WriteString ( m_CryptPassword ) ; xml . WriteEndElement ( ) ; } if ( m_NewCryptPassword != null ) { xml . WriteStartElement ( " " ) ; xml . WriteString ( m_NewCryptPassword ) ; xml . WriteEndElement ( ) ; } if ( m_AccessLevel != AccessLevel . Player ) { xml . WriteStartElement ( " " ) ; xml . WriteString ( m_AccessLevel . ToString ( ) ) ; xml . WriteEndElement ( ) ; } if ( m_Flags != 0 ) { xml . WriteStartElement ( " " ) ; xml . WriteString ( XmlConvert . ToString ( m_Flags ) ) ; xml . WriteEndElement ( ) ; } xml . WriteStartElement ( " " ) ; xml . WriteString ( XmlConvert . ToString ( m_Created , XmlDateTimeSerializationMode . Local ) ) ; xml . WriteEndElement ( ) ; xml . WriteStartElement ( " " ) ; xml . WriteString ( XmlConvert . ToString ( m_LastLogin , XmlDateTimeSerializationMode . Local ) ) ; xml . WriteEndElement ( ) ; xml . WriteStartElement ( " " ) ; xml . WriteString ( XmlConvert . ToString ( TotalGameTime ) ) ; xml . WriteEndElement ( ) ; xml . WriteStartElement ( " " ) ; for ( int i = 0 ; i < m_Mobiles . Length ; ++ i ) { Mobile m = m_Mobiles [ i ] ; if ( m != null && ! m . Deleted ) { xml . WriteStartElement ( " " ) ; xml . WriteAttributeString ( " " , i . ToString ( ) ) ; xml . WriteString ( m . Serial . Value . ToString ( ) ) ; xml . WriteEndElement ( ) ; } } xml . WriteEndElement ( ) ; if ( m_Comments != null && m_Comments . Count > 0 ) { xml . WriteStartElement ( " " ) ; for ( int i = 0 ; i < m_Comments . Count ; ++ i ) m_Comments [ i ] . Save ( xml ) ; xml . WriteEndElement ( ) ; } if ( m_Tags != null && m_Tags . Count > 0 ) { xml . WriteStartElement ( " " ) ; for ( int i = 0 ; i < m_Tags . Count ; ++ i ) m_Tags [ i ] . Save ( xml ) ; xml . WriteEndElement ( ) ; } if ( m_LoginIPs . Length > 0 ) { xml . WriteStartElement ( " " ) ; xml . WriteAttributeString ( " " , m_LoginIPs . Length . ToString ( ) ) ; for ( int i = 0 ; i < m_LoginIPs . Length ; ++ i ) { xml . WriteStartElement ( " " ) ; xml . WriteString ( m_LoginIPs [ i ] . ToString ( ) ) ; xml . WriteEndElement ( ) ; } xml . WriteEndElement ( ) ; } if ( m_IPRestrictions . Length > 0 ) { xml . WriteStartElement ( " " ) ; for ( int i = 0 ; i < m_IPRestrictions . Length ; ++ i ) { xml . WriteStartElement ( " " ) ; xml . WriteString ( m_IPRestrictions [ i ] ) ; xml . WriteEndElement ( ) ; } xml . WriteEndElement ( ) ; } xml . WriteEndElement ( ) ; }
Serializes this Account instance to an XmlTextWriter.
Serializes this Account instance to an XmlTextWriter .
//xml.WriteAttributeString( "length", m_Mobiles.Length.ToString() );	//Legacy, Not used anymore
xml
XmlTextWriter
The XmlTextWriter instance from which to serialize.
The XmlTextWriter instance from which to serialize .