Get Client Type (ML -> T2A)
Add this to the NetState class (in the core), OR add this with the modification of making it static and using state.Flags instead of m_Flags as well as state.ClientVersion instead of m_Version, to anywhere you want to use this.
The function GetClientType() will return the proper client type. Please note that a Samurai Empire installation which has properly patched to 5.0.0a or beyond will be exact to the ML installation (in terms of data and authentication). This is distinguished only by the version file in the Ultima Online Directory, which says Win32_SE or Win32_ML respectively for their original installations. Furthermore, OSI verifies a Mondain's Legacy client based on the type of account which was bought. Therefore using an ML client with an 8th age account, will give an error saying that you are not upgraded enough to use ML features.
Add this to the NetState class (in the core), OR add this with the modification of making it static and using state.Flags instead of m_Flags as well as state.ClientVersion instead of m_Version, to anywhere you want to use this.
Code:
public bool HasFlag( int flag )
{
return ( m_Flags & flag ) != 0;
}
private static readonly ClientVersion m_MLVersion = new ClientVersion( "5.0.0a" );
public string GetClientType()
{
if ( HasFlag( 0x10 ) )
{
if ( m_Version >= m_MLVersion )
return "Mondain's Legacy";
else
return "Samurai Empire";
}
else if ( HasFlag( 0x08 ) )
return "Age of Shadows";
else if ( HasFlag( 0x04 ) )
return "Blackthorn's Revenge";
else if ( HasFlag( 0x02 ) )
return "Third Dawn";
else if ( HasFlag( 0x01 ) )
return "Renaissance";
else
return "The Second Age";
}
The function GetClientType() will return the proper client type. Please note that a Samurai Empire installation which has properly patched to 5.0.0a or beyond will be exact to the ML installation (in terms of data and authentication). This is distinguished only by the version file in the Ultima Online Directory, which says Win32_SE or Win32_ML respectively for their original installations. Furthermore, OSI verifies a Mondain's Legacy client based on the type of account which was bought. Therefore using an ML client with an 8th age account, will give an error saying that you are not upgraded enough to use ML features.