Page 3 of 4

Re: Updater

Posted: Sun Mar 07, 2010 8:20 am
by Robin
Jasoco wrote:I get the same error as above with the current version.
D'oh

Didn't see I had to replace updater.result by result twice. :ehem:
Updater.love
erm...
(2.43 KiB) Downloaded 109 times
If this version doesn't work, I'll eat my own hat, sir.

Re: Updater

Posted: Sun Mar 07, 2010 10:12 pm
by Jasoco
Well.... Do you want ketchup?

Line 67: Bad argument #1 to "setfenv" (Number expected, got nil)

Is this my fault? It's in 0.6.2.

Re: Updater

Posted: Mon Mar 08, 2010 6:44 am
by bartbes
Jasoco wrote:Is this my fault? It's in 0.6.2.
Of course it isn't. So, Robin, I believe you owe us a youtube video of you eating your own hat.

Re: Updater

Posted: Mon Mar 08, 2010 4:43 pm
by Robin
bartbes wrote:
Jasoco wrote:Is this my fault? It's in 0.6.2.
Of course it isn't. So, Robin, I believe you owe us a youtube video of you eating your own hat.
I think we can skip that step, and go straight to me shooting myself.

Actually, that is not my fault, neither Jasoco's. ;) It is just means the retrieved Updater config file is not valid Lua. So, it doesn't work with the standard server, because it is just an example. ;)

Nevertheless, this version provides a (slightly) clearer error message.
Updater.love
Yay! Errors!
(2.46 KiB) Downloaded 122 times

Re: Updater

Posted: Thu Mar 18, 2010 2:45 am
by ljdp
I think I know whats wrong.
You have to use LTN12 to get binary data.

Code: Select all

ltn12 = require("ltn12")

function download( server, file )
    local nfile = love.filesystem.newFile( file )
    nfile:open('w')
    local lsink = ltn12.sink.file(nfile)
    local f, e = http.request{
		url = 'http://'..server..'/'..file,
		sink = lsink
    }
    nfile:close()
end
EDIT:
Here's an example I've made. It downloads my cards game from a remote server and you can launch it without restarting.

Re: Updater

Posted: Thu Mar 18, 2010 6:53 am
by bartbes
You don't have to.

Re: Updater

Posted: Thu Mar 18, 2010 7:00 am
by ljdp
Oh...
Well I haven't figured out how to without it.
Plus you can do stuff while it's downloading using the ltn12.pump functions, which seems simpler than coroutines.

Re: Updater

Posted: Thu Mar 18, 2010 2:49 pm
by bartbes
Well, good thing there's a new version then (I haven't released it yet, it is currently being tested.)

Re: Updater

Posted: Tue Mar 30, 2010 9:02 pm
by bartbes
Finally releasing the new version, under a new name: DILDo Is a Library for Downloading, also known as DILDo.
File is in the OP.

Re: Updater

Posted: Tue Mar 30, 2010 9:02 pm
by Jasoco
Okay. Now we're just trying to make these library names NSFW. lol