public ServerPacket(byte service, int method, short requestId, ulong listenerId) { m_memStream = new MemoryStream(); m_stream = CodedOutputStream.CreateInstance(m_memStream); // Write header m_stream.WriteRawByte(service); m_stream.WriteInt32NoTag(method); m_stream.WriteInt16NoTag(requestId); Console.WriteLine("OUT: service {0}, method {1}, requestId {2}, listenerId {3}", service, method, requestId, listenerId); if (service != 0xFE) m_stream.WriteRawVarint64(listenerId); }