Beispiel #1
0
def build_new_paks(context, manifest_path, pak_All=False):
    #todo add variable for a pak name, and add the pak name to the file entry in the manifest
    manifest_path, manifest = _get_path_and_manifest(context, manifest_path)
    updatedContent = _get_updated_local_content(context, manifest_path,
                                                manifest, pak_All)
    pak_file_list = []
    for relative_folder_path, files in updatedContent.iteritems():
        # currently this command is only supported on windows
        archiver = pak_files.PakFileArchiver()
        files_to_pak = []
        pak_folder_path = get_pak_game_folder(context, relative_folder_path)
        for file in files:
            file['pakFile'] = relative_folder_path
            file_pair = (_get_path_for_file_entry(
                context, file, context.config.game_directory_name),
                         _get_game_root_for_file_entry(
                             context, file,
                             context.config.game_directory_name))
            files_to_pak.append(file_pair)
            print file_pair
        archiver.archive_files(files_to_pak, pak_folder_path)
        pak_file_list.append(pak_folder_path)
    _save_content_manifest(context, manifest_path, manifest)

    create_standalone_manifest_pak(context, manifest_path)
Beispiel #2
0
def create_standalone_manifest_pak(context, manifest_path):
    manifest_path, manifest = _get_path_and_manifest(context, manifest_path)
    _update_file_hashes(context, manifest_path, manifest)
    full_path = os.path.join(context.config.root_directory_path,
                             manifest_path).replace('\\', '/')
    archiver = pak_files.PakFileArchiver()
    pak_folder_path = _get_path_for_standalone_manifest_pak(context, full_path)
    files_to_pak = []
    base_content_path = os.path.join(
        context.config.root_directory_path,
        context.config.game_directory_name).replace('\\', '/')
    file_pair = (full_path, base_content_path)
    files_to_pak.append(file_pair)
    archiver.archive_files(files_to_pak, pak_folder_path)