Made NetState.Send virtual.

Lifespan of Packet.UnderlyingStream extended until Packet.Release (previously was freed in Packet.Compile).
This commit is contained in:
krrios 2006-06-18 20:10:09 +00:00
parent e9b696064f
commit 9dd4c1d37b
2 changed files with 7 additions and 4 deletions

View file

@ -482,7 +482,7 @@ namespace Server.Network
m_CreatedCallback( this );
}
public void Send( Packet p )
public virtual void Send( Packet p )
{
if ( m_Socket == null || m_BlockAllPackets )
{
@ -730,7 +730,7 @@ namespace Server.Network
private bool m_Disposing;
public void Dispose( bool flush )
public virtual void Dispose( bool flush )
{
if ( m_Socket == null || m_Disposing )
return;

View file

@ -3568,6 +3568,9 @@ namespace Server.Network
if ( (m_State & State.Buffered) != 0 )
m_Buffers.ReleaseBuffer( m_CompiledBuffer );
PacketWriter.ReleaseInstance( m_Stream );
m_Stream = null;
m_State &= ~(State.Static | State.Acquired | State.Buffered);
m_CompiledBuffer = null;
@ -3671,8 +3674,8 @@ namespace Server.Network
Buffer.BlockCopy( old, 0, m_CompiledBuffer, 0, length );
}
PacketWriter.ReleaseInstance( m_Stream );
m_Stream = null;
//PacketWriter.ReleaseInstance( m_Stream );
//m_Stream = null;
}
}
}