LUBE (Networking Library)

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

Re: LUBE (Networking Library)

Post by bartbes »

Ehm, what client list are you talking about? The current love release doesn't have a numerically indexed one. Is this about a 3rd party library on top of LUBE? Or about your own code? This pretty much tells me nothing.
User avatar
zipperipper
Prole
Posts: 45
Joined: Thu Jan 14, 2010 7:59 pm
Location: UK

Re: LUBE (Networking Library)

Post by zipperipper »

In LUBE, Server.clients
Once a player disconnects, its removed from the list, but then the client next in the list disconnects after (I think) the ping builds up.
Its an issue with LUBE itself disconnecting clients, has nothing to do with my code.
Im using LUBE version 0.7. if that helps.
edit:
if I disconnect client 1, client 2 and client 3 (and i assume all other clients next in line) will timeout shortly after.
Error 404, consciousness not found.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library)

Post by bartbes »

I have to wonder why you're using an old version like that, though.
Anyway, the fix seems to be changing ipairs to pairs on line 530.
User avatar
zipperipper
Prole
Posts: 45
Joined: Thu Jan 14, 2010 7:59 pm
Location: UK

Re: LUBE (Networking Library)

Post by zipperipper »

I've looked for updated versions but all links I've tried have been 404'd :/

Also yes, that fixed it, thanks :3
Last edited by zipperipper on Sat Feb 18, 2012 4:51 pm, edited 1 time in total.
Error 404, consciousness not found.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library)

Post by bartbes »

The first post has links to 1.0 on github.
larios
Prole
Posts: 7
Joined: Wed Apr 18, 2012 4:50 pm

Re: LUBE (Networking Library)

Post by larios »

Hi

im trying to use LUBE 0.7.1 and Löve 0.8

i was putting togheter this simple example, it seems the connection happen, but callback functions dont seem to respond :brows:

is there any obvious mistake here?

Code: Select all

require "LUBE"

mServer = {}
mClient = {}

function love.load()
	port=1234
	ip="127.0.0.1"
	mServer=lube.server(port)
	mServer:setCallback(ServerRcvCallback, ServerConnCallback, ServerDisconnCallback) 
	mServer:setHandshake("Hi!") 
	
	mClient = lube.client() 
	mClient:setHandshake("Hi!") 
	mClient:setCallback(ClientRcvCallback) 
	mClient:connect(ip, port,nil)
	
	mClient:send("test!");
	mServer:send("test!");
	
	print("ok");
end	

function ServerConnCallback(ip, port) 
	print("connected")
	print("Ip: " .. ip)
	print("Port: " .. port)	
end

function ServerRcvCallback(data, ip, port)
	print("Data: " .. data .. " from " .. ip)
end

function ServerDisconnCallback(ip, port)
	print("Ip: " .. ip)
	print("Port: " .. port)	
end

function ClientRcvCallback(data)
	print(data)
end
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library)

Post by bartbes »

Yes, you're not calling their update functions.
I also wonder why you're using on old version.
larios
Prole
Posts: 7
Joined: Wed Apr 18, 2012 4:50 pm

Re: LUBE (Networking Library)

Post by larios »

thanks

adding this now works

Code: Select all

function love.update(dt)
	mClient:update(dt)
	mServer:update(dt)
end
was just making some test because i noticed the 1.0 wanted a common class implementation, but ill switch to it
User avatar
schme16
Party member
Posts: 127
Joined: Thu Oct 02, 2008 2:46 am

Re: LUBE (Networking Library)

Post by schme16 »

I pretty new to using the class libs, as such I'm finding the 1.0 version a little hard to get my head around...

Anyone able to show my how to make a tcp server and a client that connects to it?

(Cheers! in advance)
My Development Diary - http://shanegadsby.info
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LUBE (Networking Library)

Post by bartbes »

You could take a look at this function here: https://github.com/Nevon/cardboard/blob ... n.lua#L181. That code uses hump.class, btw, so you might have to change the class instantiation syntax.
Post Reply

Who is online

Users browsing this forum: No registered users and 145 guests