Changeset 729 for trunk/Modules/Export
- Timestamp:
- Jan 8, 2014, 12:17:23 AM (11 years ago)
- Location:
- trunk/Modules/Export
- Files:
-
- 1 deleted
- 3 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Export.php
r727 r729 557 557 } 558 558 559 function GetReadme() { 560 $_GET['ExportId'] = $this->Id; 561 $PageExport = new PageExport($this->System); 562 $this->LoadFilters(); 563 $Output = ''; 564 //generation readme 565 $Output .= '<?xml version="1.0" encoding="utf-8"?\>'. 566 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'. 567 '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs">'. 568 '<head>'. 569 '<STYLE type="text/css">'. 570 '.BaseTable {margin: 2px auto 2px auto;border-width: 1px;border-color: black;border-style: solid;border-collapse: collapse;}'. 571 572 '.BaseTable tr td{ border-width: 1px; border-color: black; border-style: solid; padding: 2px; text-align: center;}'. 573 574 '.BaseTable tr th{ border-width: 1px; border-color: black; border-style: solid; padding: 2px; background-color: #F0F0F0; text-align: center;}'. 575 '</STYLE>'. 576 '<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />'. 577 '<title>Čeština pro WoW</title>'. 578 '</head><body>'. 579 '<h1>České WoW - čestina pro klienta hry World of Warcraft</h1>'. 580 581 '<table cellspacing="10"><tr><td valign="top">'. 582 583 '<p>Texty přebírány z projektu <a href="http://wowpreklad.zdechov.net/">wowpreklad.zdechov.net</a><br>'. 584 '<a href="http://wowpreklad.zdechov.net/export/?Action=View&ExportId='.$this->Id.'&Tab=0">Export '.$this->Id.'</a></p><br>'. 585 586 587 '<p><strong>Vlastnosti</strong>'. 588 '<ul>'. 589 '<li>Požadovaná verze klienta: '.$this->ClientVersion['Version'].'</li>'. 590 '<li>Datum uvolnění: '.date('d.m.Y h:m',time()).'</li>'. 591 '<li>Sestaveno automaticky překladovým systémem <a href="http://wowpreklad.zdechov.net/">WoW překlad</a></li>'. 592 //'<li>Tento soubor se generuje každý den. Pokud se zapojíte do překladu, zítra můžete stáhnout tento soubor znovu včetně svých překladů</li>'. 593 //'<li>Sestavil: Maron</li>'. 594 '</ul>'. 595 '</p>'. 596 '<br>'. 597 598 '<h2>Nejčastější otázky</h2>'. 599 '<p><strong>Jak mám hru spustit?</strong><br>'. 600 'Hru musíte spustit přes soubor WowLua.exe v kořenovém adresáři hry.</p>'. 601 602 '<p><strong>Mohu použít tuto češtinu na oficiálních serverech?</strong><br>'. 603 'Ne úplně, protože se vystavujete riziku zablokování vašeho účtu z důvodu použití upravené hry. Na oficiálním serveru lze využít pouze Addon s češtinou CzWoW.</p>'. 604 605 '<p><strong>Mám nainstalovánu češtinu a nejde mi spustit Wow.exe.</strong><br>'. 606 'Pokud chcete opět spouštět hru přes původní Wow.exe v angličtině, musíte češtinu nejprve odinstalovat ze systému. Především se jedná o soubor Data/enGB/patch-enGB-5.MPQ či Data/enUS/patch-enUS-5.MPQ, který je nutno smazat.</p>'. 607 608 '<p><strong>Nedaří se mi provést aktualizaci klienta s nainstalovanou češtinou.</strong><br>'. 609 'Před aktualizací na novější verzi klienta musíte nejprve češtinu odinstalovat. Čeština totiž mění v rámci patch MPQ souboru některé soubory hry, což oficiální instalátory vyhodnotí jako poškození hry.</p>'. 610 611 '</td><td>'; 612 613 $Output .= $PageExport->ExportViewStat(' WHERE `DBCFileName` !=\'\' OR `LuaFileName` !=\'\' OR `Group`.`Id` = 1 OR `Group`.`Id` = 2 OR `Group`.`Id` = 3 OR `Group`.`Id` = 16'); 614 615 $Output .= '</td></tr></table>'. 616 617 618 '</body></html>'; 619 return $Output; 620 } 621 559 622 function ExportToXML() 560 623 { -
trunk/Modules/Export/ExportOutput.php
r690 r729 258 258 { 259 259 $System->Database->query('INSERT INTO ExportTask (`Export` ,`TimeStart` ) VALUES ('.$ExportId.', NOW())'); 260 $ this->System->ModuleManager->Modules['Log']->WriteLog('Zadání úlohy pro vygenerování dbc souboru', LOG_TYPE_DOWNLOAD);260 $System->ModuleManager->Modules['Log']->WriteLog('Zadání úlohy pro vygenerování dbc souboru', LOG_TYPE_DOWNLOAD); 261 261 } 262 262 -
trunk/Modules/Export/ProcessTask.php
r708 r729 2 2 3 3 ini_set('memory_limit', '100M'); 4 5 $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; 6 $_SERVER['REQUEST_URI'] = __FILE__; 4 7 5 8 include_once(dirname(__FILE__).'/../../includes/global.php'); … … 24 27 $File->CreateFile(dirname(__FILE__).'/../../'.$System->Config['Web']['TempFolder'].'ProcessTask'); 25 28 $File->WriteLine(1); 29 } 30 31 function DeleteOldFiles($deldir) 32 { 33 if(file_exists($deldir.'/')) 34 { 35 $Dir = opendir($deldir.'/') ; 36 while(($File = readdir($Dir)) !== false) 37 { 38 if(($File != '..') and ($File != '.') and (!is_dir("$File"))) unlink($deldir.'/'.$File); 39 } 40 closedir($Dir); 41 } 42 43 } 44 45 function rcopy($src, $dst) { 46 // echo $src.' '.$dst."\n"; 47 if (file_exists($dst)) DeleteOldFiles($dst); 48 if (is_dir($src)) { 49 if (!file_exists($dst)) mkdir($dst); 50 $files = scandir($src); 51 foreach ($files as $file) 52 if ($file != "." && $file != ".." and (!is_dir("$src/$file"))) rcopy("$src/$file", "$dst/$file"); 53 } 54 else if (file_exists($src)) copy($src, $dst); 55 } 56 57 function GetWinZPatch($patch) { 58 //TMP="Z:\\a\\www\\wowpreklad\\tmp\\Export\\${EXPORTID}\\" 59 $patch = str_replace(DIRECTORY_SEPARATOR,'\\',$patch); 60 $patch = 'Z:'.$patch; 61 return $patch; 62 } 63 64 function MPQPack($packdir) { 65 66 if(file_exists($packdir.DIRECTORY_SEPARATOR)) 67 { 68 $Dir = opendir($packdir.DIRECTORY_SEPARATOR) ; 69 while(($File = readdir($Dir)) !== false) 70 { 71 if(($File != '..') and ($File != '.')) { 72 $File = str_replace('/',DIRECTORY_SEPARATOR,$File); 73 $InDir = ''; 74 if (strpos($packdir,'dbc') !== false) { 75 $InDir = 'DBFilesClient\\'; 76 if (DIRECTORY_SEPARATOR == '/') // linux 77 $InDir = 'DBFilesClient\\\\'; 78 } 79 if (strpos($packdir.$File,'luaGlobal') !== false) { 80 $InDir = 'Interface\\FrameXML\\'; 81 if (DIRECTORY_SEPARATOR == '/') // linux 82 $InDir = 'Interface\\\\FrameXML\\\\'; 83 } 84 if (strpos($packdir.$File,'luaGlue') !== false) { 85 $InDir = 'Interface\\GlueXML\\'; 86 if (DIRECTORY_SEPARATOR == '/') // linux 87 $InDir = 'Interface\\\\GlueXML\\\\'; 88 } 89 90 if (DIRECTORY_SEPARATOR == '/') // linux 91 echo exec('wine cmd /C mpq.exe "'.GetWinZPatch($packdir.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR).'patch-5.MPQ" '.$InDir.basename($File).' "'.GetWinZPatch($packdir.DIRECTORY_SEPARATOR).$File.'" '); 92 93 if (DIRECTORY_SEPARATOR == '\\') // windows 94 echo exec('mpq.exe "'.$packdir.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'patch-5.MPQ" '.$InDir.basename($File).' "'.$packdir.DIRECTORY_SEPARATOR.$File.'" '); 95 96 echo "\n"; 97 } 98 } 99 closedir($Dir); 100 } 26 101 } 27 102 … … 49 124 50 125 // Delete old files 51 if(file_exists($Export->TempDir.'dbc/')) 52 { 53 $Dir = opendir($Export->TempDir.'dbc/') ; 54 while(($File = readdir($Dir)) !== false) 55 { 56 if(($File != '..') and ($File != '.')) unlink($Export->TempDir.'dbc/'.$File); 57 } 58 closedir($Dir); 59 } 126 DeleteOldFiles($Export->TempDir.'dbc'); 60 127 if(file_exists($Export->TempDir.'CzWoW_DBC.zip')) unlink($Export->TempDir.'CzWoW_DBC.zip'); 61 128 … … 90 157 if($DbRow['ExportId'] != '') 91 158 { 92 echo shell_exec('"'.dirname(__FILE__).'./client_cz_export.sh" '.$DbRow['ExportId'].''); 93 $System->Database->query('UPDATE `ExportTask` SET `TimeFinish`=NOW() WHERE `Export`='.$DbRow['Export']); 159 // echo shell_exec('"'.dirname(__FILE__).'./client_cz_export.sh" '.$DbRow['ExportId'].''); 160 161 162 $Export = new ExportAddon($System); 163 $Export->Id = $DbRow['ExportId']; 164 $Export->Init(); 165 $Export->LoadFilters(); 166 167 $nsifile = 'install.nsi'; 168 169 // Delete old files 170 SetProgres($Export,5); 171 echo('Delete old files...'."\n"); 172 DeleteOldFiles($Export->TempDir.'dbc'); 173 DeleteOldFiles($Export->TempDir.'lua'); 174 DeleteOldFiles($Export->TempDir.'CzWoW'); 175 176 //copy need files 177 SetProgres($Export,10); 178 echo('Copy files...'."\n"); 179 rcopy('files/'.$Export->ClientVersion['Version'].'/patch-5.MPQ', $Export->TempDir.'patch-5.MPQ'); 180 rcopy('files/'.$Export->ClientVersion['Version'].'/'.$nsifile, $Export->TempDir.$nsifile); 181 rcopy('files/'.$Export->ClientVersion['Version'].'/WowLua.exe', $Export->TempDir.'WowLua.exe'); 182 rcopy('files/'.$Export->ClientVersion['Version'].'/CzWoW/', $Export->TempDir.'CzWoW/'); 183 rcopy('files/WoW.ico', $Export->TempDir.'WoW.ico'); 184 rcopy('files/Fonts/', $Export->TempDir.'Fonts/'); 185 186 SetProgres($Export,15); 187 echo('Export lua...'."\n"); 188 $Export->ExportToLua(); 189 SetProgres($Export,20); 190 echo('Export CzWoW...'."\n"); 191 $Export->MakeAddon(); 192 SetProgres($Export,30); 193 echo('Export dbc...'."\n"); 194 $Export->ExportToDBC(); 195 196 echo('Create readme...'."\n"); 197 SetProgres($Export,60); 198 $File = new FileStream(); 199 $File->CreateFile($Export->TempDir.'ReadMe.htm'); 200 $File->WriteLine($Export->GetReadme()); 201 $File->CloseFile(); 202 203 echo('Packing files...'."\n"); 204 SetProgres($Export,70); 205 $workdir = str_replace('/',DIRECTORY_SEPARATOR,$Export->TempDir); 206 MPQPack($workdir.'lua'); 207 SetProgres($Export,80); 208 MPQPack($workdir.'dbc'); 209 210 SetProgres($Export,90); 211 echo('Creating instalator...'."\n"); 212 if (DIRECTORY_SEPARATOR == '/') // linux 213 echo exec('makensis '.$workdir.$nsifile); 214 215 if (DIRECTORY_SEPARATOR == '\\') // windows 216 echo exec('"'.$workdir.$nsifile.'" '); //"c:\Program Files (x86)\NSIS\makensisw.exe" /Xscriptcmd 217 218 SetProgres($Export,100); 219 echo ("\n"."Hotovo"."\n") 220 $System->Database->query('UPDATE `ExportTask` SET `TimeFinish`=NOW() WHERE `Export`='.$DbRow['Export']); 94 221 } else 95 222 { -
trunk/Modules/Export/files/1.12.1/install.nsi
r728 r729 14 14 !define FULL_TITLE "Èeský pøeklad WoW" 15 15 !define CREATOR "Autor" 16 !define README " CzechWoW.htm"16 !define README "ReadMe.htm" 17 17 !define LOCALE "czCZ" 18 18 … … 90 90 91 91 ;ADD YOUR OWN FILES HERE... 92 File "Wow Cz.exe"92 File "WowLua.exe" 93 93 File "${README}" 94 94 … … 137 137 SetOutPath "$INSTDIR" 138 138 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" 139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Èeské WoW.lnk" "$INSTDIR\Wow Cz.exe"139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Èeské WoW.lnk" "$INSTDIR\WowLua.exe" 140 140 141 141 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápovìda.lnk" "$INSTDIR\${README}" … … 149 149 SetDetailsPrint listonly 150 150 151 CreateShortCut "$DESKTOP\Èeské WoW.lnk" "$INSTDIR\Wow Cz.exe"151 CreateShortCut "$DESKTOP\Èeské WoW.lnk" "$INSTDIR\WowLua.exe" 152 152 153 153 SectionEnd … … 211 211 212 212 RMDir /r "$SMPROGRAMS\${FULL_TITLE}" 213 Delete "$INSTDIR\Wow Cz.exe"213 Delete "$INSTDIR\WowLua.exe" 214 214 215 215 IfFileExists "$INSTDIR\Data\enGB\*.*" 0 +3 -
trunk/Modules/Export/files/2.4.3/install.nsi
r720 r729 14 14 !define FULL_TITLE "Èeský pøeklad WoW" 15 15 !define CREATOR "Autor" 16 !define README " CzechWoW.htm"16 !define README "ReadMe.htm" 17 17 !define LOCALE "czCZ" 18 18 … … 90 90 91 91 ;ADD YOUR OWN FILES HERE... 92 File "Wow Cz.exe"92 File "WowLua.exe" 93 93 File "${README}" 94 94 … … 137 137 SetOutPath "$INSTDIR" 138 138 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" 139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Èeské WoW.lnk" "$INSTDIR\Wow Cz.exe"139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Èeské WoW.lnk" "$INSTDIR\WowLua.exe" 140 140 141 141 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápovìda.lnk" "$INSTDIR\${README}" … … 149 149 SetDetailsPrint listonly 150 150 151 CreateShortCut "$DESKTOP\Èeské WoW.lnk" "$INSTDIR\Wow Cz.exe"151 CreateShortCut "$DESKTOP\Èeské WoW.lnk" "$INSTDIR\WowLua.exe" 152 152 153 153 SectionEnd … … 211 211 212 212 RMDir /r "$SMPROGRAMS\${FULL_TITLE}" 213 Delete "$INSTDIR\Wow Cz.exe"213 Delete "$INSTDIR\WowLua.exe" 214 214 215 215 IfFileExists "$INSTDIR\Data\enGB\*.*" 0 +3 -
trunk/Modules/Export/files/3.3.5a/install.nsi
r720 r729 14 14 !define FULL_TITLE "Èeský pøeklad WoW" 15 15 !define CREATOR "Autor" 16 !define README " CzechWoW.htm"16 !define README "ReadMe.htm" 17 17 !define LOCALE "czCZ" 18 18 … … 90 90 91 91 ;ADD YOUR OWN FILES HERE... 92 File "Wow Cz.exe"92 File "WowLua.exe" 93 93 File "${README}" 94 94 … … 137 137 SetOutPath "$INSTDIR" 138 138 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" 139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Èeské WoW.lnk" "$INSTDIR\Wow Cz.exe"139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Èeské WoW.lnk" "$INSTDIR\WowLua.exe" 140 140 141 141 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápovìda.lnk" "$INSTDIR\${README}" … … 149 149 SetDetailsPrint listonly 150 150 151 CreateShortCut "$DESKTOP\Èeské WoW.lnk" "$INSTDIR\Wow Cz.exe"151 CreateShortCut "$DESKTOP\Èeské WoW.lnk" "$INSTDIR\WowLua.exe" 152 152 153 153 SectionEnd … … 211 211 212 212 RMDir /r "$SMPROGRAMS\${FULL_TITLE}" 213 Delete "$INSTDIR\Wow Cz.exe"213 Delete "$INSTDIR\WowLua.exe" 214 214 215 215 IfFileExists "$INSTDIR\Data\enGB\*.*" 0 +3 -
trunk/Modules/Export/files/4.3.4/install.nsi
r720 r729 14 14 !define FULL_TITLE "Èeský pøeklad WoW" 15 15 !define CREATOR "Autor" 16 !define README " CzechWoW.htm"16 !define README "ReadMe.htm" 17 17 !define LOCALE "czCZ" 18 18 … … 90 90 91 91 ;ADD YOUR OWN FILES HERE... 92 File "Wow Cz.exe"92 File "WowLua.exe" 93 93 File "${README}" 94 94 … … 138 138 SetOutPath "$INSTDIR" 139 139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" 140 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Èeské WoW.lnk" "$INSTDIR\Wow Cz.exe"140 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Èeské WoW.lnk" "$INSTDIR\WowLua.exe" 141 141 142 142 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápovìda.lnk" "$INSTDIR\${README}" … … 150 150 SetDetailsPrint listonly 151 151 152 CreateShortCut "$DESKTOP\Èeské WoW.lnk" "$INSTDIR\Wow Cz.exe"152 CreateShortCut "$DESKTOP\Èeské WoW.lnk" "$INSTDIR\WowLua.exe" 153 153 154 154 SectionEnd … … 212 212 213 213 RMDir /r "$SMPROGRAMS\${FULL_TITLE}" 214 Delete "$INSTDIR\Wow Cz.exe"214 Delete "$INSTDIR\WowLua.exe" 215 215 216 216 IfFileExists "$INSTDIR\Data\enGB\*.*" 0 +3 -
trunk/Modules/Export/files/5.4.0/install.nsi
r720 r729 14 14 !define FULL_TITLE "Èeský pøeklad WoW" 15 15 !define CREATOR "Autor" 16 !define README " CzechWoW.htm"16 !define README "ReadMe.htm" 17 17 !define LOCALE "czCZ" 18 18
Note:
See TracChangeset
for help on using the changeset viewer.