Jump to content

Publish Game


Josh
 Share

Recommended Posts

This extension adds a self-contained game publishing system. Currently the extension adds all project files into a zip archive named "data.zip", with optional encryption. It's not finished, but I wanted to get it out there as quickly as possible so people can see how it works and how they might want to customize it.

Update 3:

Publisher.lua

Update 2:

Publisher.lua

Original:

Publisher.lua

Ultra 0.9.7 beta is required.

image.thumb.png.0282d30bcc2c038a6c3fa46e6cb78fb5.png

  • Like 5

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

Awesome! I cannot wait for this to be completed. Please make strong encryption (AES256) to protect our assets and work.

Mike

MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 980 GTX with 16gb vram / SSD drives

MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1060 GTX with 8gb vram / SSD drives

Alienware Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1070 Ti with 16gb vram / SSD drives

My Patreon page: https://www.patreon.com/michaelfelkercomposer

My music for sale: https://www.tgcstore.net/category/513?format=all&perpage=30&textures=undefined&price=all&order=default&artists[]=87213

Custom synths and sounds - http://www.supersynths.com

Link to comment
Share on other sites

The updated version above actually scans scene files and finds materials, models, and textures, then scans material and glTF files and finds more textures (those formats are all JSON-based so it's pretty easy to step through them looking for file paths).

Currently scanning of our native model file format is not performed because the model format is a bit complicated to step through. I need to think about the solution to this.

You will want to add something like this in your main.cpp file:

    //Load packages
    const WString password = "xxxxxxxxxxx";
    std::vector<std::shared_ptr<Package> > packages;
    auto dir = LoadDir("");
    for (auto file : dir)
    {
        if (ExtractExt(file).Lower() == "zip")
        {
            auto pak = LoadPackage(file);
            if (pak)
            {
              	pak->SetPassword(password);
            	packages.push_back(pak);
            }
        }
    }

 

  • 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

I am going to pull this out of 0.9.7 for two reasons:

  • It blocks the event loop, which is okay for small projects but not so good for big ones.
  • There is still a question of how the password can be stored securely in the executable.

The first issue is not as serious, but the second could cause problems if people are not aware of it.

The current version is uploaded in the first post (Update 3).

  • Upvote 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

We can make the script generate a bat file that calls tar.exe to generate the zip:

@echo off
setlocal

:: Set variables
set "input_file=path\to\your\file.txt"
set "output_archive=path\to\your\archive.zip"
set "encryption_password=YourSecretPassword"

:: Call tar to create a zip archive with AES-256 encryption
tar -cvf - "%input_file%" | openssl enc -aes-256-cbc -e -pass pass:"%encryption_password%" -out "%output_archive%"

echo Compression completed: %output_archive%
endlocal

 

  • 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

This copy of the script won't perform the zip compression, but will just scan files and print out how long it took:

Publisher.lua

For a new default project on my machine, it takes 0.3 seconds.

  • 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

If the file scanning part is fast enough, I can then make an asynchronous zip packaging function that accepts a list of files, so the GUI thread is not blocked and a progress bar can be displayed.

  • 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

  • 3 months later...

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...