public ClientVersion( string fmt )
{
m_SourceString = fmt;
try
{
fmt = fmt.ToLower();
int br1 = fmt.IndexOf( '.' );
int br2 = fmt.IndexOf( '.', br1 + 1 );
int br3 = br2 + 1;
while ( br3 < fmt.Length && Char.IsDigit( fmt, br3 ) )
br3++;
m_Major = Utility.ToInt32( fmt.Substring( 0, br1 ) );
m_Minor = Utility.ToInt32( fmt.Substring( br1 + 1, br2 - br1 - 1 ) );
m_Revision = Utility.ToInt32( fmt.Substring( br2 + 1, br3 - br2 - 1 ) );
if( br3 < fmt.Length )
{
if( m_Major <= 5 && m_Minor <= 0 && m_Revision <= 6 ) //Anything before 5.0.7
{
if( !Char.IsWhiteSpace( fmt, br3 ) )
m_Patch = (fmt[br3] - 'a') + 1;
}
else
{
m_Patch = Utility.ToInt32( fmt.Substring( br3+1, fmt.Length - br3 - 1 ) );
}
}
if ( fmt.IndexOf( "god" ) >= 0 || fmt.IndexOf( "gq" ) >= 0 )
m_Type = ClientType.God;
else if ( fmt.IndexOf( "third dawn" ) >= 0 || fmt.IndexOf( "uo:td" ) >= 0 || fmt.IndexOf( "uotd" ) >= 0 || fmt.IndexOf( "uo3d" ) >= 0 || fmt.IndexOf( "uo:3d" ) >= 0 )
m_Type = ClientType.UOTD;
else
m_Type = ClientType.Regular;
}
catch
{
m_Major = 0;
m_Minor = 0;
m_Revision = 0;
m_Patch = 0;
m_Type = ClientType.Regular;
}
}