DILDo

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Updater

Post 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 96 times
If this version doesn't work, I'll eat my own hat, sir.
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Updater

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Updater

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Updater

Post 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 107 times
Help us help you: attach a .love.
User avatar
ljdp
Party member
Posts: 209
Joined: Sat Jan 03, 2009 1:04 pm
Contact:

Re: Updater

Post 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.
Attachments
gamebrowser.love
Gamebrowser.
(1.55 KiB) Downloaded 103 times
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Updater

Post by bartbes »

You don't have to.
User avatar
ljdp
Party member
Posts: 209
Joined: Sat Jan 03, 2009 1:04 pm
Contact:

Re: Updater

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Updater

Post by bartbes »

Well, good thing there's a new version then (I haven't released it yet, it is currently being tested.)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Updater

Post 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.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Updater

Post by Jasoco »

Okay. Now we're just trying to make these library names NSFW. lol
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 65 guests