Esempio n. 1
0
int main(int argc, char* arg[])
{
    printf("Map & DBC Extractor\n");
    printf("===================\n\n");

    HandleArgs(argc, arg);

    // Open MPQs
    LoadCommonMPQFiles();

    // Extract dbc
    if (CONF_extract & EXTRACT_DBC)
        ExtractDBCFiles();

    if (CONF_extract & EXTRACT_CAMERA)
        ExtractCameraFiles();

    // Extract maps
    if (CONF_extract & EXTRACT_MAP)
        ExtractMapsFromMpq();

    // Close MPQs
    CloseMPQFiles();

    return 0;
}
Esempio n. 2
0
int main(int argc, char * arg[])
{
    printf("Map & DBC Extractor\n");
    printf("===================\n\n");

    HandleArgs(argc, arg);

    uint32 build = 0;

    // Open MPQs
    LoadCommonMPQFiles();

    if (CONF_extract & EXTRACT_DBC)
    {
        // Extract DBC Files.
        ExtractDBCFiles();
    }

    if (CONF_extract & EXTRACT_MAP)
    {
        printf("Loading files.. \n");

        // Extract maps
        ExtractMapsFromMpq(build);
    }

    // Close MPQs
    CloseMPQFiles();

    return 0;
}
Esempio n. 3
0
/**
 * @brief
 *
 * @param argc
 * @param argv
 * @return int
 */
int main(int argc, char** argv)
{
    printf("mangos-zero DBC & map (version %s) extractor\n\n", MAP_VERSION_MAGIC);

    if (!HandleArgs(argc, argv))
    {
        return 1;
    }

    // Open MPQs
    LoadCommonMPQFiles();

    // Extract dbc
    if (CONF_extract & EXTRACT_DBC)
        { ExtractDBCFiles(); }

    // Extract maps
    if (CONF_extract & EXTRACT_MAP)
        { ExtractMapsFromMpq(); }

    // Close MPQs
    CloseMPQFiles();

    return 0;
}
Esempio n. 4
0
int main(int argc, char * arg[])
{
    printf("DBC/Map Extractor\n");
    printf("===================\n\n");
    
    bool extractDBC = true;
    bool extractMap = true;
    
    for (int i = 0; i < argc; ++i)  
    {
        if (strcmp(arg[i], ARG_MAP) == 0)
            extractMap = true;
        if (strcmp(arg[i], ARG_NOMAP) == 0)
            extractMap = false;
        if (strcmp(arg[i], ARG_DBC) == 0)
            extractDBC = true;
        if (strcmp(arg[i], ARG_NODBC) == 0)
            extractDBC = false;
    }
    
    int FirstLocale = -1;
    int build = 0;
	
    for (int i = 0; i < LANG_COUNT; i++)
    {
        char tmp1[512];
        sprintf(tmp1, "%s/Data/%s/locale-%s.MPQ", input_path, langs[i], langs[i]);
        if (FileExists(tmp1))
        {
            printf("Detected locale: %s\n", langs[i]);
			
            //Open MPQs
            LoadLocaleMPQFiles(i);
			
            //Extract DBC files
            if (FirstLocale < 0)
            {
                FirstLocale = i;
                build = ReadBuild(FirstLocale);
                printf("Detected base client build: %u\n", build);
                if (build != CLIENT_BUILD)
                {
                    printf("ERROR: your client is not up-to-date. Client build should be %u", CLIENT_BUILD);
                    return 0;
                }
                if (extractDBC)
                    ExtractDBCFiles(i, true);
            }
            else if (extractDBC)
                ExtractDBCFiles(i, false);
        }
    }
	
    if (FirstLocale < 0)
    {
        printf("No locales detected\n");
        return 0;
    }
    
    if (extractMap)
        ExtractMapsFromMpq(build);
	
    return 0;
}
Esempio n. 5
0
int main(int argc, char * arg[])
{
    printf("Map & DBC Extractor\n");
    printf("===================\n\n");

    HandleArgs(argc, arg);

    int FirstLocale = -1;
    uint32 build = 0;

    for (int i = 0; i < LOCALES_COUNT; ++i)
    {
        TCHAR tmp1[512];
        _stprintf(tmp1, _T("%s/Data/%s/locale-%s.MPQ"), input_path, Locales[i], Locales[i]);

        //Open MPQs
        if (!LoadLocaleMPQFile(i))
        {
            if (GetLastError() != ERROR_PATH_NOT_FOUND)
                printf("Unable to load %s locale archives!\n", Locales[i]);
            continue;
        }

        printf("Detected locale: %s\n", Locales[i]);
        if ((CONF_extract & EXTRACT_DBC) == 0)
        {
            FirstLocale = i;
            build = ReadBuild(i);
            if (build > CONF_TargetBuild)
            {
                printf("Base locale-%s.MPQ has build higher than target build (%u > %u), nothing extracted!\n", Locales[i], build, CONF_TargetBuild);
                return 0;
            }

            printf("Detected client build: %u\n", build);
            break;
        }

        //Extract DBC files
        uint32 tempBuild = ReadBuild(i);
        printf("Detected client build %u for locale %s\n", tempBuild, Locales[i]);
        if (tempBuild > CONF_TargetBuild)
        {
            printf("Base locale-%s.MPQ has build higher than target build (%u > %u), nothing extracted!\n", Locales[i], tempBuild, CONF_TargetBuild);
            continue;
        }

        ExtractDBCFiles(i, FirstLocale < 0);
        ExtractDB2Files(i, FirstLocale < 0);

        if (FirstLocale < 0)
        {
            FirstLocale = i;
            build = tempBuild;
        }

        //Close MPQs
        SFileCloseArchive(LocaleMpq);
    }

    if (FirstLocale < 0)
    {
        printf("No locales detected\n");
        return 0;
    }

    if (CONF_extract & EXTRACT_MAP)
    {
        printf("Using locale: %s\n", Locales[FirstLocale]);

        // Open MPQs
        LoadLocaleMPQFile(FirstLocale);
        LoadCommonMPQFiles(build);

        // Extract maps
        ExtractMapsFromMpq(build);

        // Close MPQs
        SFileCloseArchive(WorldMpq);
        SFileCloseArchive(LocaleMpq);
    }

    return 0;
}
Esempio n. 6
0
int main(int argc, char * arg[])
{
    printf("Map & DBC Extractor\n");
    printf("===================\n\n");

    HandleArgs(argc, arg);

    int FirstLocale = -1;

    for (int i = 0; i < LANG_COUNT; i++)
    {
        char tmp1[512];
        sprintf(tmp1, "%s/Data/%s/locale-%s.MPQ", input_path, langs[i], langs[i]);
        if (FileExists(tmp1))
        {
            printf("Detected locale: %s\n", langs[i]);

            //Open MPQs
            LoadLocaleMPQFiles(i);

            if((extract & EXTRACT_DBC) == 0)
            {
                FirstLocale = i;
                break;
            }

            //Extract DBC files
            if(FirstLocale < 0)
            {
                ExtractDBCFiles(i, true);
                FirstLocale = i;
            }
            else
                ExtractDBCFiles(i, false);

            //Close MPQs
            CloseMPQFiles();
        }
    }

    if(FirstLocale < 0)
    {
        printf("No locales detected\n");
        return 0;
    }

    if (extract & EXTRACT_MAP)
    {
        printf("Using locale: %s\n", langs[FirstLocale]);

        // Open MPQs
        LoadLocaleMPQFiles(FirstLocale);
        LoadCommonMPQFiles();

        // Extract maps
        ExtractMapsFromMpq();

        // Close MPQs
        CloseMPQFiles();
    }

    return 0;
}
Esempio n. 7
0
int main(int argc, char * arg[])
{
    printf("Map & DBC Extractor\n");
    printf("===================\n\n");

    HandleArgs(argc, arg);

    int FirstLocale = -1;
    uint32 build = 0;

    for (int i = 0; i < LANG_COUNT; i++)
    {
        std::string filename = Trinity::StringFormat("%s/Data/%s/locale-%s.MPQ", input_path, langs[i], langs[i]);
        if (boost::filesystem::exists(filename))
        {
            printf("Detected locale: %s\n", langs[i]);

            //Open MPQs
            LoadLocaleMPQFiles(i);

            if((CONF_extract & EXTRACT_DBC) == 0)
            {
                FirstLocale = i;
                build = ReadBuild(FirstLocale);
                printf("Detected client build: %u\n", build);
                break;
            }

            //Extract DBC files
            if(FirstLocale < 0)
            {
                FirstLocale = i;
                build = ReadBuild(FirstLocale);
                printf("Detected client build: %u\n", build);
                ExtractDBCFiles(i, true);
            }
            else
                ExtractDBCFiles(i, false);

            //Close MPQs
            CloseMPQFiles();
        }
    }

    if(FirstLocale < 0)
    {
        printf("No locales detected\n");
        return 0;
    }

    if (CONF_extract & EXTRACT_CAMERA)
    {
        printf("Using locale: %s\n", langs[FirstLocale]);

        // Open MPQs
        LoadLocaleMPQFiles(FirstLocale);
        LoadCommonMPQFiles();

        ExtractCameraFiles(FirstLocale, true);
        // Close MPQs
        CloseMPQFiles();
    }

    if (CONF_extract & EXTRACT_MAP)
    {
        printf("Using locale: %s\n", langs[FirstLocale]);

        // Open MPQs
        LoadLocaleMPQFiles(FirstLocale);
        LoadCommonMPQFiles();

        // Extract maps
        ExtractMapsFromMpq(build);

        // Close MPQs
        CloseMPQFiles();
    }

    return 0;
}
Esempio n. 8
0
int main(int argc, char* arg[])
{
    printf("Map & DBC Extractor\n");
    printf("===================\n\n");

    HandleArgs(argc, arg);

    int FirstLocale = -1;
    uint32 build = 0;

    for (int i = 0; i < LANG_COUNT; i++)
    {
        char tmp1[512];
        sprintf(tmp1, "%s/Data/%s/locale-%s.MPQ", input_path, langs[i], langs[i]);
        if (FileExists(tmp1))
        {
            printf("Detected locale: %s\n", langs[i]);

            //Open MPQs
            LoadLocaleMPQFiles(i);

            if ((CONF_extract & EXTRACT_DBC) == 0)
            {
                FirstLocale = i;
                build = ReadBuild(FirstLocale);
                if (build==17520)
				{
					build = 18273;
				}
                printf("Detected client build: %u\n", build);
                break;
            }

            //Extract DBC files
            if (FirstLocale < 0)
            {
                FirstLocale = i;
                build = ReadBuild(FirstLocale);
                if (build==17520)
				{
					build = 18273;
				}
                printf("Detected client build: %u\n", build);
                ExtractDBCFiles(i, true);
            }
            else
                ExtractDBCFiles(i, false);

            //Close MPQs
            CloseArchives();
        }
    }

    if (FirstLocale < 0)
    {
        printf("No locales detected\n");
        return 0;
    }

    if (CONF_extract & EXTRACT_MAP)
    {
        printf("Using locale: %s\n", langs[FirstLocale]);

        // Open MPQs
        LoadBaseMPQFiles();
        LoadLocaleMPQFiles(FirstLocale);

        // Extract maps
        ExtractMapsFromMpq(build, FirstLocale);

        // Close MPQs
        CloseArchives();
    }

    return 0;
}