Показать сообщение отдельно
Старый 19.05.2009, 23:05   #631
Участник
 
Аватар для anger
 
Регистрация: 14.04.2009
Сообщений: 26

ICQ: 5492109

Репутация: 18
По умолчанию

Здрасте товарсчи!

Что делает этот код?
Код:
    $1D:  //Volkov Ioann completely rewrited code, that was written by Ok3y
    begin  //here can be two ids, flags and hashes
      tlvLen := GetInt(Pkt, 2);       //TLV's Length
      tlvDat := GetStr(Pkt, tlvLen);  //Getting all TLV data
      lpkt.Len := 0;                  //Creating new packet for analyzing
      PktStr(@lpkt, tlvDat);
      lpkt.Len := 0;
      while not (lpkt.Len = tlvLen) do
        begin
          TheId := GetInt(@lpkt, 2);
          TheFlags := GetInt(@lpkt, 1);
          if TheFlags <> 4 then  //is an avatar, probably
            begin
              AvatarId := TheId;
              AvatarFlags := TheFlags;
              AvatarHash := StrToHexStr(GetLStr(@lpkt));
            end
          else if (TheFlags = 4) and (TheId <> $0D) then  //is a NewXStatusNote, probably
            begin
              tmpStr := GetLStr(@lpkt);  //using NOT as AvatarHash, just as a temporary variable
              if tmpStr <> '' then
                NewXStatusNote := MyUTF8Decode(Copy(tmpStr, 3, Length(tmpStr) - 4));
            end
          else if (TheFlags = 4) and (TheId = $0D) then
            begin
              tmpStr := GetStr(@lpkt, tlvLen - lpkt.Len);
              psicqmood := Pos('icqmood', tmpStr);
              if psicqmood > 0 then
                begin
                  NewXStatusSet := True;
                  NewXStatusMoodNum := StrToInt(Copy(tmpStr, psicqmood + 7, Ord(tmpStr[psicqmood - 1]) - 7));
                end;
            end
          else  //for extraordinary situations
            lpkt.Len := tlvLen;
        end;
    end;
Почему TheFlags = 4 и TheId = $0D должны иметь именно такие значения?
И что делают ф-ии:
GetInt();
GetStr();
GetLStr();
поясните пожалуйста, только без всяких "подколов"
anger вне форума