files as $k => $v) { $data[$v] = $parser->parseFile($v); } // Write all parse data to mod db foreach ($data as $k => $v) { $db->createTables($k, $v); $db->fillsTables($k, $v); } // Process Files Manually In Sqlite processFilesManuallyInSqlite(); processFilesManuallyInSqliteLinux(); function toPngAll() { $q = realpath("bin\qdc6.exe"); $iPath = $_SESSION['modpath']."\data\global\items"; $oPath = realpath("docs\\{$_SESSION['modname']}\img\\items"); exec("$q --first-frame-only \"$iPath\" -o \"$oPath\""); } if (!is_dir("docs\\{$_SESSION['modname']}")) { mkdir("docs\\{$_SESSION['modname']}"); mkdir("docs\\{$_SESSION['modname']}\\fonts", 0777, TRUE); mkdir("docs\\{$_SESSION['modname']}\\img\items", 0777, TRUE); mkdir("docs\\{$_SESSION['modname']}\\res", 0777, TRUE); } rcopy(realpath('docs/template/fonts'), realpath("docs\\{$_SESSION['modname']}\\fonts")); rcopy(realpath('docs/template/img'), realpath("docs\\{$_SESSION['modname']}\\img")); rcopy(realpath('docs/template/res'), realpath("docs\\{$_SESSION['modname']}\\res")); toPngAll(); /* Process tbl files * * $tbl = $_SESSION['tbl']; // ddump($tbl); /* $string = D2Tbl::getStrings($tbl."string.tbl"); $stringExpansion = D2Tbl::getStrings($tbl."expansionstring.tbl"); $stringPatch = D2Tbl::getStrings($tbl."patchstring.tbl"); $strings = array_merge($stringPatch, $stringExpansion, $string); */ $strs = ["dummy" => "dummy"]; foreach (glob($tbl . "*.tbl") as $filename) { $strings = D2Tbl::getStrings($filename); if (!empty($strings)) $strs = array_merge($strs, $strings); } $db->writeTbl($strs); } else { // if config db does not exist, go to configure page header("Location: /src/D2Config.php"); } // put in html redirect as backup, because // for some odd reason windows gives // an error on header() but linux does not. ?>