Page 1 of 1
Server-Client Networking thing.
Posted: Wed Oct 29, 2014 8:01 am
by nullbear
I'm a little baffled with the wiki here, but it says somewhere or other, that the server is a standalone lua program, and the client is love. What if i wanted to have a love program where you choose to host a game for others to join, or join a hosted game?
How would i go about doing this? Also, When i attempted to make a .love server, it opened the main.lua file within in notepad, and maintained a white unresponsive screen.
Re: Server-Client Networking thing.
Posted: Wed Oct 29, 2014 8:10 am
by zorg
My guess is that you read that the server doesn't necessarily need to be made with löve, since servers usually can work without a GUI.
If you want your game to have hosting capabilities, then you need to write both client and server code into it.
How to write that code depends what you chose to use; ENet, Luasocket (both included in löve), or Lube (a library)
As for your attempt, without a .love, i can not guess what the error might be... other than you actually renaming your main.lua to server.love or something, and it being opened with notepad, a blank file, waiting to be edited.
Re: Server-Client Networking thing.
Posted: Wed Oct 29, 2014 8:18 am
by nullbear
What is Enet? The only one there i haven't heard of.
EDIT: And the notepad file that opened, was the one inside the .love file, main.lua, all the code intact..
Re: Server-Client Networking thing.
Posted: Wed Oct 29, 2014 8:31 am
by zorg
http://leafo.net/lua-enet/
you can
in your code, and use that instead of luasocket, if you choose to.
I still don't see how running your .love opened up notepad, unless i misunderstood something.