public IOClient(Connection c) { this.connection = c; this.connectedAt = Server.CurrentTimeMillis(); this.mm_stream = new PacketWriter(255); }
public Packet(int packetID, int length) { m_PacketID = packetID; m_Length = length; m_Stream = PacketWriter.CreateInstance(length); m_Stream.Write((byte)packetID); }
public byte[] Compile() { System.IO.MemoryStream ms = m_Stream.UnderlyingStream; m_CompiledBuffer = ms.GetBuffer(); m_CompiledLength = (int)ms.Length; int length = m_CompiledLength; byte[] old = m_CompiledBuffer; m_CompiledBuffer = new byte[length]; Buffer.BlockCopy(old, 0, m_CompiledBuffer, 0, length); PacketWriter.ReleaseInstance(m_Stream); m_Stream = null; return Encrypt(m_CompiledBuffer); }
public Packet(int packetID) { m_PacketID = packetID; m_Length = 32; m_Stream = PacketWriter.CreateInstance(); m_Stream.Write((byte)packetID); }