Skip to content

Instantly share code, notes, and snippets.

@Billiam

Billiam/main.lua Secret

Last active April 18, 2020 17:50
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Billiam/2d827cd944fffbdfc7fa to your computer and use it in GitHub Desktop.
Save Billiam/2d827cd944fffbdfc7fa to your computer and use it in GitHub Desktop.
local request = require('vendor.luajit-request')
function love.load(args)
local config = require('launcher_config')
if not love.filesystem.exists('app.love') then
local request = require("vendor.luajit-request")
local response = request.send(config.URL)
love.filesystem.write('app.love', response.body)
if response.code ~= '200' then
print('Response code was: ', response.code)
error('Could not find game')
end
end
love.filesystem.mount('app.love', "")
local blacklist = {'main', 'conf'}
for i,v in ipairs(blacklist) do
package.loaded[v] = nil
end
-- unload love.conf, reloaded by love.init
love.conf = nil
love.handlers = nil
love.init()
love.load(args)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment