public void Send(Packet p)
{
if (m_BlockAllPackets)
{
p.OnSend();
return;
}
PacketProfile prof = PacketProfile.GetOutgoingProfile((byte)p.PacketID);
DateTime start = (prof == null ? DateTime.MinValue : DateTime.Now);
int length;
byte[] buffer = p.Compile(m_CompressionEnabled, out length);
if (buffer != null && buffer.Length > 0 && length > 0)
{
m_NetState.Send(buffer, length);
}
if (prof != null)
{
prof.Record(length, DateTime.Now - start);
}
p.OnSend();
}