Page 1 of 1
Thin client
Posted: Sun Jan 08, 2017 9:29 pm
by Zeex00
Would it be feasible to create a sort of "Thin client" using love2ds current setup?
Re: Thin client
Posted: Sun Jan 08, 2017 10:03 pm
by Nixola
What would a "thin client" be?
Re: Thin client
Posted: Sun Jan 08, 2017 11:16 pm
by peterrust
Zeex00,
Do you mean something like a browser that downloads and executes assets and code Just-In-Time from various addresses via HTTP? One problem would be sandboxing -- you would want to add guards to love2d to keep downloaded code from reading/writing arbitrary files on your hard drive, etc. I'm not sure if love2d provides much sandboxing, but if it does, I doubt that it provides as much as browsers do.
Re: Thin client
Posted: Mon Jan 09, 2017 12:52 pm
by Germanunkol
peterrust wrote:Zeex00,
Do you mean something like a browser that downloads and executes assets and code Just-In-Time from various addresses via HTTP? One problem would be sandboxing -- you would want to add guards to love2d to keep downloaded code from reading/writing arbitrary files on your hard drive, etc. I'm not sure if love2d provides much sandboxing, but if it does, I doubt that it provides as much as browsers do.
I don't know what a thin client is, either, but just wanted to add that sandboxing is quite a thing in Lua, and thus, in Löve.
One of Lua's original purposes was to provide scripting extensions to programs (modding etc.) and such extensions should always be sandboxed, so it was engineered into Lua from the beginning (AFAIK).
I used it quite a lot for trAInsported as well, since users run their own Lua code within my game, so I needed to make sure that the code can't read files etc.
Re: Thin client
Posted: Mon Jan 09, 2017 5:03 pm
by peterrust
Germanunkol wrote:sandboxing is quite a thing in Lua, and thus, in Löve.
One of Lua's original purposes was to provide scripting extensions to programs (modding etc.) and such extensions should always be sandboxed, so it was engineered into Lua from the beginning (AFAIK).
I used it quite a lot for trAInsported as well, since users run their own Lua code within my game, so I needed to make sure that the code can't read files etc.
Thanks for the correction Germanunkol! I come from a Javascript background & was guessing (wrongly, it seems) about Lua's sandboxing capabilities in comparison to JS. Looks like it's actually fairly easy to set the environment that you run the untrusted code in via `setfenv()` (see
http://stackoverflow.com/questions/1224 ... ua-sandbox).
Re: Thin client
Posted: Tue Jan 10, 2017 1:29 am
by Zeex00
I was referring to a client/server relationship where the client just sends key presses,and basic vars across the network to the server.While the server handles all gamelogic
Re: Thin client
Posted: Tue Jan 10, 2017 1:51 am
by zorg
It's completely possible to implement an authoritative server model, and that's what it's called.
It is a bit involved though, if you want to do it right, see this very nice article about it:
http://gabrielgambetta.com/fpm1.html
This is also neat, as a supplementary for the above:
http://gafferongames.com/networking-for ... etworking/