Page 3 of 4

Re: UDP Networking

Posted: Mon Nov 11, 2013 8:13 pm
by antivapor
Quick question regarding versions of Lua and LuaSocket and it being bundled with Love. Running `lua server.lua` of course returns an error because I haven't installed LuaSocket yet. Since LuaSocket is bundled with Love, am I able to just link to that? And which version is it? I'm currently browsing about my filesystem but can't find the Linux-path to bundled components.

I've got both Lua5.1 and 5.2. LuaSocket 2.0.2 says it is compatible with Lua 5.1 (Src Mirror), and whatever bundled version is compatible with 5.2. Also, has anyone used LuaSocket 3.0? I'm going to try with that first.

Looking forward to playing the KarmaExchange example, I read through it and just need to get the server going :3.

Re: UDP Networking

Posted: Mon Nov 11, 2013 9:31 pm
by bartbes
It's completely built into the engine, starting from 0.9.0 you could probably get it by loading liblove.

Re: UDP Networking

Posted: Mon Nov 11, 2013 11:30 pm
by spynaz
bartbes wrote:It's completely built into the engine, starting from 0.9.0 you could probably get it by loading liblove.
Ok, so how would you run server.lua that doesn't use the LOVE framework?

[]

Posted: Tue Nov 12, 2013 4:07 pm
by bekey
-snip-

Re: UDP Networking

Posted: Wed Nov 13, 2013 2:48 am
by spynaz
bekey wrote:Is this a viable solution? http://www.exitgames.com/
I'm not hosting an online server. I just need to know how I would run the server.lua if it doesn't use the LOVE framework.

Re: UDP Networking

Posted: Wed Nov 13, 2013 2:59 am
by josefnpat
mH38GZl.png
mH38GZl.png (9.7 KiB) Viewed 669 times
So long as you have luasocket2 installed, you can write a server in pure Lua.

Re: UDP Networking

Posted: Wed Nov 13, 2013 3:34 am
by spynaz
josefnpat wrote:Image

So long as you have luasocket2 installed, you can write a server in pure Lua.
Ok. But what if I want the user to create the server with a click of a button. How would you run the file from LOVE? Just require it?

Re: UDP Networking

Posted: Thu Nov 14, 2013 1:03 am
by antivapor
spynaz wrote:
josefnpat wrote:Image

So long as you have luasocket2 installed, you can write a server in pure Lua.
Ok. But what if I want the user to create the server with a click of a button. How would you run the file from LOVE? Just require it?
For a push of a button, I think you only have to put a `require("server") in your main.lua, comment out `serverSetup()` at the bottom of server.lua, and make a button call to `serverSetup()`.

And related to my question, at the moment, I've got LuaSocket3.0 running with Lua5.1, and'll post my solution when I get it working with 5.2. :)
bartbes wrote:It's completely built into the engine, starting from 0.9.0 you could probably get it by loading liblove.
How is liblove called, or where is it located? Is it just a folder when I upgrade from 0.8.0 to 0.9.0?

Also, thanks Germanunkol for the Karma example, it was really helpful.

Re: UDP Networking

Posted: Thu Nov 14, 2013 4:03 am
by spynaz
antivapor wrote:
spynaz wrote:
josefnpat wrote:Image

So long as you have luasocket2 installed, you can write a server in pure Lua.
Ok. But what if I want the user to create the server with a click of a button. How would you run the file from LOVE? Just require it?
For a push of a button, I think you only have to put a `require("server") in your main.lua, comment out `serverSetup()` at the bottom of server.lua, and make a button call to `serverSetup()`.

And related to my question, at the moment, I've got LuaSocket3.0 running with Lua5.1, and'll post my solution when I get it working with 5.2. :)
bartbes wrote:It's completely built into the engine, starting from 0.9.0 you could probably get it by loading liblove.
How is liblove called, or where is it located? Is it just a folder when I upgrade from 0.8.0 to 0.9.0?

Also, thanks Germanunkol for the Karma example, it was really helpful.
Ok, I see now. Thanks for you help.

Re: UDP Networking

Posted: Thu Nov 14, 2013 9:07 am
by bartbes
antivapor wrote: How is liblove called, or where is it located?
Linux: $libdir/liblove.so, defaulting to $prefix/lib/liblove.so defaulting to /usr/lib/liblove.so for packages and /usr/local/lib/liblove.so for source builds.
Windows: love.dll (or liblove.dll, I always forget)
OSX: .. wherever you put libraries..

I'd like to mention that, considering your use case, it might be interesting to, instead of running your server separately, running it inside of a thread. That way you do have access to love's luasocket, the server will quit when the game quits, and it's still isolated.

@spynaz: Could you please stop quoting entire posts? It's in violation of the etiquette.