From 2e0b9e16703d907824b4f86e4204ac5b69f785f1 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 18 Oct 2009 00:42:31 +0000 Subject: [PATCH] try to make 7.x clients not crash so much --- Server/Mobile.cs | 19 ++++++++++++++----- Server/Network/Packets.cs | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Server/Mobile.cs b/Server/Mobile.cs index fa7512c36..5b64279ba 100644 --- a/Server/Mobile.cs +++ b/Server/Mobile.cs @@ -4278,7 +4278,7 @@ namespace Server foreach( NetState ns in eable ) { - if( ns.Mobile != from && ns.Mobile.CanSee( from ) ) + if( !ns.IsPost7000 && ns.Mobile != from && ns.Mobile.CanSee( from ) ) { if( p == null ) { @@ -4413,7 +4413,7 @@ namespace Server foreach( NetState ns in eable ) { - if( ns.Mobile != this && ns.Mobile.CanSee( this ) ) + if( !ns.IsPost7000 && ns.Mobile != this && ns.Mobile.CanSee( this ) ) { if( p == null ) { @@ -6162,6 +6162,7 @@ namespace Server ProcessDelta(); Packet p = null; + Packet pOld = null; IPooledEnumerable eable = map.GetClientsInRange( m_Location ); @@ -6171,14 +6172,22 @@ namespace Server { state.Mobile.ProcessDelta(); - if( p == null ) - p = Packet.Acquire( new MobileAnimation( this, action, frameCount, repeatCount, forward, repeat, delay ) ); + if ( state.IsPost7000 ) { + if( p == null ) + p = Packet.Acquire( new MobileAnimation( this, action, frameCount, delay ) ); - state.Send( p ); + state.Send( p ); + } else { + if( pOld == null ) + pOld = Packet.Acquire( new OldMobileAnimation( this, action, frameCount, repeatCount, forward, repeat, delay ) ); + + state.Send( pOld ); + } } } Packet.Release( p ); + Packet.Release( pOld ); eable.Free(); } diff --git a/Server/Network/Packets.cs b/Server/Network/Packets.cs index adcece30a..a317cae57 100644 --- a/Server/Network/Packets.cs +++ b/Server/Network/Packets.cs @@ -2713,9 +2713,9 @@ namespace Server.Network } } - public sealed class MobileAnimation : Packet + public sealed class OldMobileAnimation : Packet { - public MobileAnimation( Mobile m, int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay ) : base( 0x6E, 14 ) + public OldMobileAnimation( Mobile m, int action, int frameCount, int repeatCount, bool forward, bool repeat, int delay ) : base( 0x6E, 14 ) { m_Stream.Write( (int) m.Serial ); m_Stream.Write( (short) action ); @@ -2726,6 +2726,17 @@ namespace Server.Network m_Stream.Write( (byte) delay ); } } + + public sealed class MobileAnimation : Packet + { + public MobileAnimation( Mobile m, int action, int frameCount, int delay ) : base( 0xE2, 10 ) + { + m_Stream.Write( (int) m.Serial ); + m_Stream.Write( (short) action ); + m_Stream.Write( (short) frameCount ); + m_Stream.Write( (byte) delay ); + } + } public sealed class MobileStatusCompact : Packet {