Changeset 612 for tools


Ignore:
Timestamp:
Nov 27, 2013, 12:25:17 AM (10 years ago)
Author:
maron
Message:
  • Fixed: some bugs
Location:
tools/WoWHeadLoader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tools/WoWHeadLoader/WoWHeadLoader.lpi

    r606 r612  
    6060  </CompilerOptions>
    6161  <Debugging>
    62     <Exceptions Count="4">
     62    <Exceptions Count="5">
    6363      <Item1>
    6464        <Name Value="EAbort"/>
     
    7373        <Name Value="EIdHTTPProtocolException"/>
    7474      </Item4>
     75      <Item5>
     76        <Name Value="EIdSocketError"/>
     77      </Item5>
    7578    </Exceptions>
    7679  </Debugging>
  • tools/WoWHeadLoader/WoWHeadLoader.lpr

    r606 r612  
    8181  if HasOption('u', 'user') then begin
    8282    Database.UserName := GetOptionValue('u', 'user');
    83   end else Database.UserName := 'wowpreklad';
     83  end else Database.UserName := 'import';
    8484  if HasOption('p', 'password') then begin
    8585    Database.Password := GetOptionValue('p', 'password');
    86   end else Database.Password := 'hezkycesky';
     86  end else Database.Password := 'test';
    8787  if HasOption('t', 'host') then begin
    8888    Database.Hostname := GetOptionValue('t', 'host');
     
    9393
    9494  Database.Connect;
    95   WriteLn('Nez zacnete aktualizujte udaje v tabulce ClientVersion. Texty se budou importovat jako nejpozdejsi pojmenovana verze!');
     95  WriteLn('Nez zacnete, aktualizujte udaje v tabulce ClientVersion. Texty se budou importovat jako nejpozdejsi pojmenovana verze!');
    9696 // ReadLn;
    9797
     
    226226       part := Copy(data,0,Pos('</td>',data)-1);
    227227
     228       if (Copy(part,0,Length(part)-1) = 'Suggested players: ') then Continue;
     229
    228230       if ((Pos('item',part) > 0)) then begin
    229231         itemfound:=true;
    230232         textend:='';
    231233       end;
    232        if ((Pos('<',part) = 0)) then begin
    233           textend:=DelHtmlTags(part);
     234       if ((Pos('<',part) = 0) and (Pos('&nbsp;',part) = 0)) then begin
     235         // part := Copy(part,0,Pos('&nbsp;',part)-1);
     236          textend:=TextStringReplace(DelHtmlTags(part));
    234237       end;
    235238       if ((Pos('object=',part) > 0) or (Pos('javascript',part) > 0) or ((itemfound = false) and (Pos('<',part) = 0))) then begin
    236          part := DelHtmlTags(part); //todo
     239         part := Copy(part,0,Pos('&nbsp;',part)-1);
     240         part := TextStringReplace(DelHtmlTags(part)); //todo
    237241         if (textobjective1 = '') then textobjective1:=part else
    238242         if (textobjective2 = '') then textobjective2:=part else
     
    250254       end;
    251255
    252   except
    253      on E: EIdHTTPProtocolException do
    254      begin
    255        if E.ErrorCode = 404 then
    256          foundtext := false;
    257      end;
    258    //  on E: EIdSocketError do then
    259   //       foundtext := false;
    260   //   end;
    261   end;
    262256
    263257
    264258  If foundtext then begin
    265259    DBRows := Database.Query('SELECT * FROM  `TextQuest` WHERE  `Entry` ='+IntToStr(Id)+' AND  `Language` =0 ORDER BY  `TextQuest`.`VersionEnd` DESC ');
    266     {
    267     if not (CompareStrings(DBRows.Data[0].Values['Title'],textname)) then
    268       WriteLn('"'+DBRows.Data[0].Values['Title']+'" XXXXX "'+textname+'"');
    269     if not (CompareStrings(DBRows.Data[0].Values['Objectives'],textobject)) then
    270       WriteLn('"'+DBRows.Data[0].Values['Objectives']+'" XXXXX "'+textobject+'"');
    271     if not (CompareStrings(DBRows.Data[0].Values['Details'],textdescription)) then
    272       WriteLn('"'+DBRows.Data[0].Values['Details']+'" XXXXX "'+textdescription+'"');
    273     if not (CompareStrings(DBRows.Data[0].Values['OfferRewardText'],textcomplection)) then
    274       WriteLn('"'+DBRows.Data[0].Values['OfferRewardText']+'" XXXXX "'+textcomplection+'"');
    275     if not (CompareStrings(DBRows.Data[0].Values['RequestItemsText'],textprogress)) then
    276       WriteLn('"'+DBRows.Data[0].Values['RequestItemsText']+'" XXXXX "'+textprogress+'"');
    277     if not (CompareStrings(DBRows.Data[0].Values['EndText'],textend)) then
    278       WriteLn('"'+DBRows.Data[0].Values['EndText']+'" XXXXX "'+textend+'"');
    279     if not (CompareStrings(DBRows.Data[0].Values['ObjectiveText1'],textobjective1)) then
    280       WriteLn('"'+DBRows.Data[0].Values['ObjectiveText1']+'" XXXXX "'+textobjective1+'"');
    281     if not (CompareStrings(DBRows.Data[0].Values['ObjectiveText2'],textobjective2)) then
    282       WriteLn('"'+DBRows.Data[0].Values['ObjectiveText2']+'" XXXXX "'+textobjective2+'"');
    283     if not (CompareStrings(DBRows.Data[0].Values['ObjectiveText3'],textobjective3)) then
    284       WriteLn('"'+DBRows.Data[0].Values['ObjectiveText3']+'" XXXXX "'+textobjective3+'"');
    285     if not (CompareStrings(DBRows.Data[0].Values['ObjectiveText4'],textobjective4)) then
    286       WriteLn('"'+DBRows.Data[0].Values['ObjectiveText4']+'" XXXXX "'+textobjective4+'"');
    287     }
    288260    if (DBRows.Count > 0) then
    289261    if (
     
    381353  end;
    382354//  else   WriteLn('guest='+IntToStr(Id)+' Nenalezen');
     355
     356  except
     357     on E: EIdHTTPProtocolException do
     358     begin
     359       if E.ErrorCode = 404 then
     360         foundtext := false;
     361
     362     end;
     363      on E:Exception do
     364        GetTextQuest(Id);
     365   //  on E: EIdSocketError do then
     366  //       foundtext := false;
     367  //   end;
     368  end;
    383369end;
    384370
     
    388374  i:integer;
    389375begin
    390   GetTextQuest(3721);
    391   GetTextQuest(4970);
    392   GetTextQuest(5501);
    393 
    394 
    395 
    396 
    397   for i := 6032 to GetMaxIDQuest do begin
     376  GetTextQuest(12996);
     377  GetTextQuest(13105);
     378
     379  GetTextQuest(13164);
     380
     381  GetTextQuest(13358);
     382
     383  GetTextQuest(13375);
     384
     385  GetTextQuest(13369);
     386
     387  GetTextQuest(13425);
     388
     389  GetTextQuest(13675);
     390
     391  GetTextQuest(13426);
     392
     393
     394
     395
     396  for i := 12865 to GetMaxIDQuest do begin
    398397    GetTextQuest(i);
    399398    write('.');
     
    471470       text := StringReplace(text,part+'&gt;',part2,[rfReplaceAll, rfIgnoreCase]);
    472471     end;
     472     text := StringReplace(text,'&lt;','<',[rfIgnoreCase]);
     473     text := StringReplace(text,'&gt;','>',[rfIgnoreCase]);
    473474   end;
    474   until not (Pos('/',part) > 0);
     475  until not (Pos('&lt;',text) > 0);
    475476
    476477
     
    526527  if ((textdb = textimport) or ( (textdb <> '') and (textimport = '') )) then Result := true
    527528  else begin
     529    //TODO: smazat celé $g pro porovnání
    528530    Result:=false;
    529531    WriteLn(textdb);
Note: See TracChangeset for help on using the changeset viewer.