LUBE (Networking Library)

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library) v0.01.1

Post by bartbes »

I'm seeing HUGE download counts of.. 3?!
Are there only 3 users, or does the rest use older versions?

So, I'll ask for feedback once more:
[obsessed]If you miss anything just post
If you use the lib, please post
If you have any comment whatsoever, POST!
[/obsessed]
Ripe
Prole
Posts: 11
Joined: Wed Nov 19, 2008 3:28 pm
Location: Australia

Re: LUBE (Networking Library) v0.01.1

Post by Ripe »

I used it to create client/server! I did modify your code a little bit so I could run more than 1 client with same IP. I've just been playing around with this thing I picked up from using torque game engine. I created a function called commandToServer on client side and commandToClient on server side, I think it's actually an easy way to send packets and makes it easy to expand. The example just show players moving around. Beware! The movement isn't 100% sync'd, once I move it to grid based movement, that will make it more accurate.

EDIT: Oh and players aren't removed if they leave, I'll wait till love get an exit event :D
Attachments
server.zip
(4.56 KiB) Downloaded 235 times
client.zip
(4.57 KiB) Downloaded 235 times
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library) v0.01.1

Post by bartbes »

Ripe wrote:EDIT: Oh and players aren't removed if they leave, I'll wait till love get an exit event :D
I couldn't help but notice that you've removed every thing that helps with disconnection.
You can already implement something to temporarily fill the void of the exit event:
Just put the disconnection callback etc back in, and already do a 'clean' disconnect when using a key to close the game.
This makes it easier to implement the exit event when it is implemented.

OR you could use the old game of ping-pong.
FEATURE REQUEST (wait? I'm requesting myself to do something?): Create a ping system.

ACTION TAKEN: Added poll

EDIT: No removed it again, somehow the forum kept putting in answers from the previous poll.
User avatar
Tabasco
Citizen
Posts: 72
Joined: Tue Dec 02, 2008 5:04 pm

Re: LUBE (Networking Library) v0.01.1

Post by Tabasco »

I intend to tinker around with it for a sort of server browser and I also want to try some UDP NAT traversal techniques with it once I get time.
For a feature request, I'd definitely like to index clients by something more unique than the IP.

Thanks!
Ripe
Prole
Posts: 11
Joined: Wed Nov 19, 2008 3:28 pm
Location: Australia

Re: LUBE (Networking Library) v0.01.1

Post by Ripe »

The reason I removed the disconnect callback is because it was only running if a person with the same IP was already logged on. Also returning a failed sendto doesn't seem to give a different result to when it succeeds.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library) v0.01.1

Post by bartbes »

I'll start working on the ping system.

@Ripe: Failed sendto? Well, it indeed doesn't fail when there is nothing on the receiving end.
LuaSocket Docs wrote:Note: In UDP, the send method never blocks and the only way it can fail is if the underlying transport layer refuses to send a message to the specified address (i.e. no interface accepts the address).
However I was refering to using the shutdown method, as it sends a closing handshake, which would then tell the server the client disconnected. Second of all, using ports to index client may cause unexpected behaviour. What about 2 clients with the same port? As those are mostly chosen random, you don't know when a problem will occur, just that it will occur. Looking at your code, it currently doesn't cause any real problems, as the only thing happening now is that the first client is locked out.
BTW I do have to mention that when the server closes/crashes it's nice to see the clients just stop instead of crashing.

@Tabasco: I'll check the lua docs once again, but to do that there has to be a fast way to get info from a table, the fastest way for now is already having an index.
Though if you know some other way, just tell me.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library) v0.01.1

Post by bartbes »

OK.. finished, however before releasing it I want the release to be tested, so:
Request for beta testers
PM if you want to sign up


On a second note, I've come up with an idea for the Clients table: (pseudo-code)

Code: Select all

Clients[id] = connected
id = ip .. "/" .. port     --> example: "127.0.0.1/2345"
connected = true/false     --> meaning: if connected
And I need beta testers for that too, so:
Sign up for beta testing
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library) v0.01.1

Post by bartbes »

Minor update 0.01.2:
  • Fixed an error on line 101 of Server.lua
0.01.2 doesn't include the ping system, or the revised Clients table, beta testers are still required for that.
NOTE: beta testers would have made this update unnecessary as the error would have been found before release.

Ping system and revised Clients table are planned for 0.02
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library) v0.01.2

Post by bartbes »

Just to make sure you all know how much reactions I've got so far:

22 December: 0 :cry:

I hope this is just because everybody is doing other stuff right now.
User avatar
mikembley
Citizen
Posts: 72
Joined: Wed Dec 17, 2008 5:30 pm
Location: Blackburn, UK
Contact:

Re: LUBE (Networking Library) v0.01.2

Post by mikembley »

Im on this soon, I would like to LUBE my LÖVE and see what it can offer me :) Haha

Have you made any demos or anything with it?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests