Ejemplo n.º 1
0
 public void ParseBuffer(byte[] data)
 {
     m_Reader.Add(data, 0, data.Length);
     if (m_Reader.BytesAvailable <= 0)
     {
         return;
     }
     while (m_Reader.BytesAvailable != 0)
     {
         if (Build())
         {
             if ((account.IsMITM) && (!ForbiddenHeaders.Contains((int)m_ProtocolID)))
             {
                 using (BigEndianWriter writer = new BigEndianWriter())
                 {
                     writer.WriteBytes(m_Data);
                     MessagePackaging pack = new MessagePackaging(writer);
                     pack.Pack((int)m_ProtocolID);
                     account.SocketManager.SendToDofusClient(pack.Writer.Content);
                     account.Log(new BotTextInformation("SND (-> Dof) " + m_ProtocolID), 0);
                 }
             }
             //using (
             // StreamWriter fileWriter =
             // new StreamWriter(
             // Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
             // @"\BlueSheep\Packets.txt", true))
             // fileWriter.WriteLine("[" + DateTime.Now.ToShortTimeString() + "] Paquet reçu : " + m_ProtocolID);
             Treatment.Treatment treatment = new Treatment.Treatment(account);
             if (m_ProtocolID == 6372)
             {
                 using (BigEndianWriter writer = new BigEndianWriter())
                 {
                     writer.WriteBytes(m_Data);
                     MessagePackaging pack = new MessagePackaging(writer);
                     pack.Pack(6372);
                     account.SocketManager.Send(pack.Writer.Content);
                 }
             }
             if (m_ProtocolID != null)
             {
                 treatment.Treat(m_ProtocolID.Value, m_Data);
             }
             m_Header     = null;
             m_Length     = null;
             m_Data       = null;
             m_LenghtType = null;
             m_ProtocolID = null;
         }
         else
         {
             break;
         }
     }
 }
Ejemplo n.º 2
0
 public void ParseBuffer(byte[] data)
 {
     m_Reader.Add(data, 0, data.Length);
     if (m_Reader.BytesAvailable <= 0)
         return;
     while (m_Reader.BytesAvailable != 0)
     {
         if (Build())
         {
             if ((account.IsMITM) && (!ForbiddenHeaders.Contains((int)m_ProtocolID)))
             {
                 using (BigEndianWriter writer = new BigEndianWriter())
                 {
                     writer.WriteBytes(m_Data);
                     MessagePackaging pack = new MessagePackaging(writer);
                     pack.Pack((int)m_ProtocolID);
                     account.SocketManager.SendToDofusClient(pack.Writer.Content);
                     account.Log(new BotTextInformation("SND (-> Dof) " + m_ProtocolID), 0);
                 }
             }
             //using (
             // StreamWriter fileWriter =
             // new StreamWriter(
             // Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
             // @"\BlueSheep\Packets.txt", true))
             // fileWriter.WriteLine("[" + DateTime.Now.ToShortTimeString() + "] Paquet reçu : " + m_ProtocolID);
             Treatment.Treatment treatment = new Treatment.Treatment(account);
             if (m_ProtocolID == 6372)
             {
                 using (BigEndianWriter writer = new BigEndianWriter())
                 {
                     writer.WriteBytes(m_Data);
                     MessagePackaging pack = new MessagePackaging(writer);
                     pack.Pack(6372);
                     account.SocketManager.Send(pack.Writer.Content);
                 }
             }
             if (m_ProtocolID != null)
                 treatment.Treat(m_ProtocolID.Value, m_Data);
             m_Header = null;
             m_Length = null;
             m_Data = null;
             m_LenghtType = null;
             m_ProtocolID = null;
         }
         else
             break;
     }
 }
Ejemplo n.º 3
0
 public void ParseBuffer(byte[] data)
 {
     m_Reader.Add(data, 0, data.Length);
     if (m_Reader.BytesAvailable <= 0)
     {
         return;
     }
     while (m_Reader.BytesAvailable != 0)
     {
         if (Build())
         {
             if ((account.IsMITM) && (!ForbiddenHeaders.Contains((int)m_ProtocolID)))
             {
                 using (BigEndianWriter writer = new BigEndianWriter())
                 {
                     writer.WriteBytes(m_Data);
                     MessagePackaging pack = new MessagePackaging(writer);
                     pack.Pack((int)m_ProtocolID);
                     account.SocketManager.SendToDofusClient(pack.Writer.Content);
                     account.Log(new BotTextInformation("SND (-> Dof) " + m_ProtocolID), 0);
                 }
             }
             Treatment.Treatment treatment = new Treatment.Treatment(account);
             if (m_ProtocolID == 6372)
             {
                 using (BigEndianWriter writer = new BigEndianWriter())
                 {
                     writer.WriteBytes(m_Data);
                     MessagePackaging pack = new MessagePackaging(writer);
                     pack.Pack(6372);
                     account.SocketManager.Send(pack.Writer.Content);
                 }
             }
             if (m_ProtocolID != null)
             {
                 treatment.Treat(m_ProtocolID.Value, m_Data);
             }
             m_Header     = null;
             m_Length     = null;
             m_Data       = null;
             m_LenghtType = null;
             m_ProtocolID = null;
         }
         else
         {
             break;
         }
     }
 }