Esempio n. 1
0
        private static void SendReplyPacket(UdpClient udp, QPacket p, RMCPacket rmc, ClientInfo client, RMCPacketReply reply, bool useCompression)
        {
            QPacket np = new QPacket(p.toBuffer());

            np.flags = new List <QPacket.PACKETFLAG>()
            {
                QPacket.PACKETFLAG.FLAG_NEED_ACK
            };
            np.m_oSourceVPort      = p.m_oDestinationVPort;
            np.m_oDestinationVPort = p.m_oSourceVPort;
            np.m_uiSignature       = client.IDsend;
            np.uiSeqId++;
            MemoryStream m = new MemoryStream();

            Helper.WriteU8(m, (byte)rmc.proto);
            Helper.WriteU8(m, 0x1);
            Helper.WriteU32(m, rmc.callID);
            Helper.WriteU32(m, rmc.methodID | 0x8000);
            byte[] buff = reply.ToBuffer();
            m.Write(buff, 0, buff.Length);
            buff = m.ToArray();
            m    = new MemoryStream();
            Helper.WriteU32(m, (uint)buff.Length);
            m.Write(buff, 0, buff.Length);
            np.payload     = m.ToArray();
            np.payloadSize = (ushort)np.payload.Length;
            WriteLog("send response packet");
            Send(udp, np, client);
            WriteLog("Response Data Content : \n" + reply.ToString());
        }
Esempio n. 2
0
        private static void SendReply(UdpClient udp, QPacket p, RMCPacket rmc, ClientInfo client, RMCPacketReply reply, bool useCompression = true, uint error = 0)
        {
            WriteLog(2, "Response : " + reply.ToString());
            string payload = reply.PayloadToString();

            if (payload != "")
            {
                WriteLog(5, "Response Data Content : \n" + payload);
            }
            SendACK(udp, p, client);
            SendReplyPacket(udp, p, rmc, client, reply, useCompression, error);
        }