From cc7814db3560250a1c9b37174143e16df43ccc54 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 19 Jul 2009 04:18:39 +0000 Subject: [PATCH] 6.0.14.2 compat --- Server/Mobile.cs | 4 ++-- Server/Network/NetState.cs | 22 ++++++++++++++++++---- Server/Network/PacketHandlers.cs | 6 +++--- Server/Network/Packets.cs | 21 +++++++++++---------- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/Server/Mobile.cs b/Server/Mobile.cs index 9ef3f569f..6cdff7497 100644 --- a/Server/Mobile.cs +++ b/Server/Mobile.cs @@ -6769,7 +6769,7 @@ namespace Server ClearFastwalkStack(); Send( new MobileIncoming( this, this ) ); - Send( SupportedFeatures.Instantiate( ns.Account ) ); + Send( SupportedFeatures.Instantiate( ns ) ); Send( new MobileUpdate( this ) ); Send( new MobileAttributes( this ) ); } @@ -8816,7 +8816,7 @@ namespace Server ClearFastwalkStack(); Send( new MobileIncoming( this, this ) ); - Send( SupportedFeatures.Instantiate( ns.Account ) ); + Send( SupportedFeatures.Instantiate( ns ) ); Send( new MobileUpdate( this ) ); Send( new MobileAttributes( this ) ); } diff --git a/Server/Network/NetState.cs b/Server/Network/NetState.cs index c3a897e25..27ac4100d 100644 --- a/Server/Network/NetState.cs +++ b/Server/Network/NetState.cs @@ -201,13 +201,19 @@ namespace Server.Network { set { m_Version = value; - if ( value >= m_Version6017 ) + if ( value >= m_Version60142 ) { + m_Post60142 = m_Post6017 = true; + } else if ( value >= m_Version6017 ) { m_Post6017 = true; - else - m_Post6017 = false; + } } } + public bool ExtendedSupportedFeatures + { + get { return m_Post60142; } + } + public bool IsUOTDClient { get @@ -217,8 +223,10 @@ namespace Server.Network { } private static ClientVersion m_Version6017 = new ClientVersion( "6.0.1.7" ); - + private static ClientVersion m_Version60142 = new ClientVersion( "6.0.14.2" ); + private bool m_Post6017; + private bool m_Post60142; public bool IsPost6017 { get { @@ -226,6 +234,12 @@ namespace Server.Network { } } + public bool IsPost60142 { + get { + return m_Post60142; + } + } + public List Trades { get { return m_Trades; diff --git a/Server/Network/PacketHandlers.cs b/Server/Network/PacketHandlers.cs index a6f89d8ec..2b57b1568 100644 --- a/Server/Network/PacketHandlers.cs +++ b/Server/Network/PacketHandlers.cs @@ -1952,7 +1952,7 @@ namespace Server.Network state.Send( SeasonChange.Instantiate( m.GetSeason(), true ) ); - state.Send( SupportedFeatures.Instantiate( state.Account ) ); + state.Send( SupportedFeatures.Instantiate( state ) ); state.Sequence = 0; state.Send( new MobileUpdate( m ) ); @@ -1969,7 +1969,7 @@ namespace Server.Network m.SendEverything(); - state.Send( SupportedFeatures.Instantiate( state.Account ) ); + state.Send( SupportedFeatures.Instantiate( state ) ); state.Send( new MobileUpdate( m ) ); //state.Send( new MobileAttributes( m ) ); state.Send( new MobileStatus( m, m ) ); @@ -2201,7 +2201,7 @@ namespace Server.Network state.CompressionEnabled = true; if ( Core.AOS ) - state.Send( SupportedFeatures.Instantiate( state.Account ) ); + state.Send( SupportedFeatures.Instantiate( state ) ); state.Send( new CharacterList( state.Account, state.CityInfo ) ); } diff --git a/Server/Network/Packets.cs b/Server/Network/Packets.cs index ccf49341e..2b96810c8 100644 --- a/Server/Network/Packets.cs +++ b/Server/Network/Packets.cs @@ -2493,18 +2493,12 @@ namespace Server.Network public static int Value{ get{ return m_AdditionalFlags; } set{ m_AdditionalFlags = value; } } - [Obsolete( "Specify account instead" )] - public static SupportedFeatures Instantiate() + public static SupportedFeatures Instantiate( NetState ns ) { - return Instantiate( null ); + return new SupportedFeatures( ns ); } - public static SupportedFeatures Instantiate( IAccount account ) - { - return new SupportedFeatures( account ); - } - - public SupportedFeatures( IAccount acct ) : base( 0xB9, 3 ) + public SupportedFeatures( NetState ns ) : base( 0xB9, ns.ExtendedSupportedFeatures ? 5 : 3 ) { int flags = ExpansionInfo.CurrentExpansion.SupportedFeatures; @@ -2519,13 +2513,20 @@ namespace Server.Network flags |= 0x801C; * */ + IAccount acct = ns.Account as IAccount; + if ( acct != null && acct.Limit >= 6 ) { flags |= 0x8020; flags &= ~0x004; } - m_Stream.Write( (ushort) flags ); + if ( ns.ExtendedSupportedFeatures ) { + m_Stream.Write( (uint) flags ); + } else { + m_Stream.Write( (ushort) flags ); + } + //m_Stream.Write( (ushort) m_Value ); // 0x01 = T2A, 0x02 = LBR } }