sock.lua - A simple networking library for LÖVE

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Ikroth
Citizen
Posts: 79
Joined: Thu Jul 18, 2013 4:44 am

Re: sock.lua - A simple networking library for LÖVE

Post by Ikroth »

Sulunia wrote:So, i just took this awesome library out for a spin.
One thing that i didn't know and took me some time to figure out: the server always receives an event, the data AND the peer that sent it.
So, if you want to send information specifically to a peer, you must use the peer the server receives on event trigger. It is pretty damn obvious now, but complete beginners to networking may have troubles.

I'll see if i can fix the ugly code around my simple "box moving" example with this lib and then share it here if people so wish.

Other than that, i suppose all "security" checks are done by the lib already no? So we only have to determine if the data received is valid or not to prevent cheating and so on...

Not sure if i was clear, say so if not. Otherwise, amazing library! Will definitely use it.
Hi, thanks for your input. I think some of these issues, like figuring out what parameters a callback takes, would be more clear if I wrote a tutorial. I just haven't gotten to it because I'm lazy.

As far as security goes, there isn't too much going on there. It is still up to you to decide if the sent information is valid. However, I wouldn't mind adding a feature to check if an event is valid, but I'm not sure of a method that would be useful to everyone.

My advice would be to accept as little information from the client as possible, and when you do, check it. If you do accept information without checking, make sure it is something that doesn't matter. Ideally, the server should be authoritative in all matters.
Manyrio
Prole
Posts: 29
Joined: Sat Feb 06, 2016 10:12 am

Re: sock.lua - A simple networking library for LÖVE

Post by Manyrio »

Hey,
I'm creating a multiplayer game, I finished it and it's all fine in localhost. But when I want to play with my friends, we try with hamachi and it just doesn't works ...
It give me this error when I start the server :
"Failed to create the host. Is there another server running on :1234?"
I tried with a lot of port but it still doesn't works.
Help plz
function love.load() end
function love.update(dt) end
function love.draw() end
User avatar
Ikroth
Citizen
Posts: 79
Joined: Thu Jul 18, 2013 4:44 am

Re: sock.lua - A simple networking library for LÖVE

Post by Ikroth »

Manyrio wrote:Hey,
I'm creating a multiplayer game, I finished it and it's all fine in localhost. But when I want to play with my friends, we try with hamachi and it just doesn't works ...
It give me this error when I start the server :
"Failed to create the host. Is there another server running on :1234?"
I tried with a lot of port but it still doesn't works.
Help plz
That error can mean almost anything. Make sure there's nothing else running on port 1234, or try a different port. Otherwise, your network is misconfigured in some way that enet can't create a host. Perhaps try port forwarding on your router instead of using Hamachi.
User avatar
LordSeaworth
Prole
Posts: 22
Joined: Tue Jun 07, 2016 10:29 pm

Re: sock.lua - A simple networking library for LÖVE

Post by LordSeaworth »

Is the library still active? Is it working on latest love?
Sorry to ask. Just wondering since i would love to use this library
User avatar
4aiman
Party member
Posts: 262
Joined: Sat Jan 16, 2016 10:30 am

Re: sock.lua - A simple networking library for LÖVE

Post by 4aiman »

LordSeaworth wrote:Just wondering since i would love to use this library
Nothing is dead while someone utilizes it's powers.
So, *do* use the library :)
Maybe you're the one who will lead the development in case the author won't :)
You know, it's not a requirement to be able to code anything to be a good leader :)
User avatar
Sir_Silver
Party member
Posts: 286
Joined: Mon Aug 22, 2016 2:25 pm
Contact:

Re: sock.lua - A simple networking library for LÖVE

Post by Sir_Silver »

I actually just started using Ikroth's sock library and am thoroughly enjoying how easy it is making networking for me. Using the latest version of love too!
User avatar
LordSeaworth
Prole
Posts: 22
Joined: Tue Jun 07, 2016 10:29 pm

Re: sock.lua - A simple networking library for LÖVE

Post by LordSeaworth »

4aiman wrote:
LordSeaworth wrote:Just wondering since i would love to use this library
Nothing is dead while someone utilizes it's powers.
So, *do* use the library :)
Maybe you're the one who will lead the development in case the author won't :)
You know, it's not a requirement to be able to code anything to be a good leader :)
Thanks for replying. and maybe yeah.
Who knows.
Sir_Silver wrote:I actually just started using Ikroth's sock library and am thoroughly enjoying how easy it is making networking for me. Using the latest version of love too!
Good to hear other people still use it in current projects!

Thanks both for the reply
User avatar
Ikroth
Citizen
Posts: 79
Joined: Thu Jul 18, 2013 4:44 am

Re: sock.lua - A simple networking library for LÖVE

Post by Ikroth »

This library is not dead, but it has been a while since I pushed any updates to the master branch. There is a WIP update that adds custom serialization support that is in the "serialization" branch. There may also need to be some naming changes in the next version ("send" or "emit"?).

As far as I know, this will work in the latest version of LÖVE. It doesn't actually depend on LÖVE, it is a pure lua library that depends on enet (and bitser, although I'm trying to change this with custom serialization).
User avatar
LordSeaworth
Prole
Posts: 22
Joined: Tue Jun 07, 2016 10:29 pm

Re: sock.lua - A simple networking library for LÖVE

Post by LordSeaworth »

Ikroth wrote:This library is not dead, but it has been a while since I pushed any updates to the master branch. There is a WIP update that adds custom serialization support that is in the "serialization" branch. There may also need to be some naming changes in the next version ("send" or "emit"?).

As far as I know, this will work in the latest version of LÖVE. It doesn't actually depend on LÖVE, it is a pure lua library that depends on enet (and bitser, although I'm trying to change this with custom serialization).
Good to hear that.
The library will be a valueable asset to my project.
So already a thanks for the work!
User avatar
Ikroth
Citizen
Posts: 79
Joined: Thu Jul 18, 2013 4:44 am

Re: sock.lua - A simple networking library for LÖVE

Post by Ikroth »

I just updated the library to version 0.2.0. It adds custom serialization support and changes "emit" functions to "send". I also updated the documentation styles.

You can check out the changes here https://github.com/camchenry/sock.lua/wiki#020.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest