Go Back   RunUO - Ultima Online Emulation > RunUO > Core Modifications > Network Modifications

Network Modifications This forum is for modifications to the networking code of RunUO

Reply
 
Thread Tools Display Modes
Old 03-09-2006, 02:35 AM   #1 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default 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.

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.
XxSP1DERxX is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5