Changeset 612 for tools/WoWHeadLoader/WoWHeadLoader.lpr
- Timestamp:
- Nov 27, 2013, 12:25:17 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/WoWHeadLoader/WoWHeadLoader.lpr
r606 r612 81 81 if HasOption('u', 'user') then begin 82 82 Database.UserName := GetOptionValue('u', 'user'); 83 end else Database.UserName := ' wowpreklad';83 end else Database.UserName := 'import'; 84 84 if HasOption('p', 'password') then begin 85 85 Database.Password := GetOptionValue('p', 'password'); 86 end else Database.Password := ' hezkycesky';86 end else Database.Password := 'test'; 87 87 if HasOption('t', 'host') then begin 88 88 Database.Hostname := GetOptionValue('t', 'host'); … … 93 93 94 94 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!'); 96 96 // ReadLn; 97 97 … … 226 226 part := Copy(data,0,Pos('</td>',data)-1); 227 227 228 if (Copy(part,0,Length(part)-1) = 'Suggested players: ') then Continue; 229 228 230 if ((Pos('item',part) > 0)) then begin 229 231 itemfound:=true; 230 232 textend:=''; 231 233 end; 232 if ((Pos('<',part) = 0)) then begin 233 textend:=DelHtmlTags(part); 234 if ((Pos('<',part) = 0) and (Pos(' ',part) = 0)) then begin 235 // part := Copy(part,0,Pos(' ',part)-1); 236 textend:=TextStringReplace(DelHtmlTags(part)); 234 237 end; 235 238 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(' ',part)-1); 240 part := TextStringReplace(DelHtmlTags(part)); //todo 237 241 if (textobjective1 = '') then textobjective1:=part else 238 242 if (textobjective2 = '') then textobjective2:=part else … … 250 254 end; 251 255 252 except253 on E: EIdHTTPProtocolException do254 begin255 if E.ErrorCode = 404 then256 foundtext := false;257 end;258 // on E: EIdSocketError do then259 // foundtext := false;260 // end;261 end;262 256 263 257 264 258 If foundtext then begin 265 259 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)) then268 WriteLn('"'+DBRows.Data[0].Values['Title']+'" XXXXX "'+textname+'"');269 if not (CompareStrings(DBRows.Data[0].Values['Objectives'],textobject)) then270 WriteLn('"'+DBRows.Data[0].Values['Objectives']+'" XXXXX "'+textobject+'"');271 if not (CompareStrings(DBRows.Data[0].Values['Details'],textdescription)) then272 WriteLn('"'+DBRows.Data[0].Values['Details']+'" XXXXX "'+textdescription+'"');273 if not (CompareStrings(DBRows.Data[0].Values['OfferRewardText'],textcomplection)) then274 WriteLn('"'+DBRows.Data[0].Values['OfferRewardText']+'" XXXXX "'+textcomplection+'"');275 if not (CompareStrings(DBRows.Data[0].Values['RequestItemsText'],textprogress)) then276 WriteLn('"'+DBRows.Data[0].Values['RequestItemsText']+'" XXXXX "'+textprogress+'"');277 if not (CompareStrings(DBRows.Data[0].Values['EndText'],textend)) then278 WriteLn('"'+DBRows.Data[0].Values['EndText']+'" XXXXX "'+textend+'"');279 if not (CompareStrings(DBRows.Data[0].Values['ObjectiveText1'],textobjective1)) then280 WriteLn('"'+DBRows.Data[0].Values['ObjectiveText1']+'" XXXXX "'+textobjective1+'"');281 if not (CompareStrings(DBRows.Data[0].Values['ObjectiveText2'],textobjective2)) then282 WriteLn('"'+DBRows.Data[0].Values['ObjectiveText2']+'" XXXXX "'+textobjective2+'"');283 if not (CompareStrings(DBRows.Data[0].Values['ObjectiveText3'],textobjective3)) then284 WriteLn('"'+DBRows.Data[0].Values['ObjectiveText3']+'" XXXXX "'+textobjective3+'"');285 if not (CompareStrings(DBRows.Data[0].Values['ObjectiveText4'],textobjective4)) then286 WriteLn('"'+DBRows.Data[0].Values['ObjectiveText4']+'" XXXXX "'+textobjective4+'"');287 }288 260 if (DBRows.Count > 0) then 289 261 if ( … … 381 353 end; 382 354 // 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; 383 369 end; 384 370 … … 388 374 i:integer; 389 375 begin 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 398 397 GetTextQuest(i); 399 398 write('.'); … … 471 470 text := StringReplace(text,part+'>',part2,[rfReplaceAll, rfIgnoreCase]); 472 471 end; 472 text := StringReplace(text,'<','<',[rfIgnoreCase]); 473 text := StringReplace(text,'>','>',[rfIgnoreCase]); 473 474 end; 474 until not (Pos(' /',part) > 0);475 until not (Pos('<',text) > 0); 475 476 476 477 … … 526 527 if ((textdb = textimport) or ( (textdb <> '') and (textimport = '') )) then Result := true 527 528 else begin 529 //TODO: smazat celé $g pro porovnání 528 530 Result:=false; 529 531 WriteLn(textdb);
Note:
See TracChangeset
for help on using the changeset viewer.