Jump to content

Bug Open File Zip on Lua App Crash.


Yue
 Share

Go to solution Solved by Josh,

Recommended Posts

Strange.

I just uploaded a new update that removes the folder part of the path and uses ChangeDir() before loading the package. Only the editor is updated.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Let's get lower level with this. Please copy your ultra.zip file to your desktop and run this code:

#include "UltraEngine.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    WString path = GetPath(PATH_DESKTOP) + "/ultra.zip";

    int errorp = 0;
    auto zipper = zip_open(path.c_str(), ZIP_RDONLY, &errorp);
    if (not zipper)
    {
        Print("Error: Failed to load zip file. Error " + String(errorp));
    }
    else
    {
        Print("OK");
    }

    return 0;
}

 

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

14 minutes ago, Josh said:

Let's get lower level with this. Please copy your ultra.zip file to your desktop and run this code:

#include "UltraEngine.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    WString path = GetPath(PATH_DESKTOP) + "/ultra.zip";

    int errorp = 0;
    auto zipper = zip_open(path.c_str(), ZIP_RDONLY, &errorp);
    if (not zipper)
    {
        Print("Error: Failed to load zip file. Error " + String(errorp));
    }
    else
    {
        Print("OK");
    }

    return 0;
}

image.thumb.png.9f3536721b6ee1284e5f3932ae158f69.png

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

Please try this:

#include "UltraEngine.h"

using namespace UltraEngine;

ZIP_EXTERN zip_int64_t
zip_source_make_command_bitmap2(zip_source_cmd_t cmd0, ...) {
    zip_int64_t bitmap;
    va_list ap;

    bitmap = ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd0);
    
    va_start(ap, cmd0);
    for (;;) {
        int cmd = va_arg(ap, int);
        if (cmd < 0) {
            break;
        }
        bitmap |= ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd);
    }
    va_end(ap);

    return bitmap;
}

int main(int argc, const char* argv[])
{
    /*WString path = GetPath(PATH_DESKTOP) + "/ultra.zip";
    int errorp = 0;
    auto zipper = zip_open(path.c_str(), ZIP_RDONLY, &errorp);
    if (not zipper)
    {
        Print("Error: Failed to load zip file. Error " + String(errorp));
    }
    else
    {
        Print("OK");
    }*/

    Print("1");

    zip_source_make_command_bitmap2(ZIP_SOURCE_SUPPORTS, ZIP_SOURCE_TELL, ZIP_SOURCE_SUPPORTS_REOPEN, -1);
    Print("2");

    zip_source_make_command_bitmap(ZIP_SOURCE_SUPPORTS, ZIP_SOURCE_TELL, ZIP_SOURCE_SUPPORTS_REOPEN, -1);
    Print("3");

    return 0;
}

 

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Okay, those two functions are the exact same code. I suspect there is some preprocessor define that doesn't match in the main project and in the static lib. I will try compiling libzip straight into the Ultra source code instead of as a separate static lib.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

In the current build, libzip was compiled into the engine from source, not as a static lib. @Yue Please let me know the result when you use the editor with a project that contains a zip file.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...