LUBE (Networking Library)
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: LUBE (Networking Library)
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.
- zipperipper
- Prole
- Posts: 45
- Joined: Thu Jan 14, 2010 7:59 pm
- Location: UK
Re: LUBE (Networking Library)
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.
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.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: LUBE (Networking Library)
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.
Anyway, the fix seems to be changing ipairs to pairs on line 530.
- zipperipper
- Prole
- Posts: 45
- Joined: Thu Jan 14, 2010 7:59 pm
- Location: UK
Re: LUBE (Networking Library)
I've looked for updated versions but all links I've tried have been 404'd :/
Also yes, that fixed it, thanks
Also yes, that fixed it, thanks
Last edited by zipperipper on Sat Feb 18, 2012 4:51 pm, edited 1 time in total.
Error 404, consciousness not found.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: LUBE (Networking Library)
The first post has links to 1.0 on github.
Re: LUBE (Networking Library)
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
is there any obvious mistake here?
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
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
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: LUBE (Networking Library)
Yes, you're not calling their update functions.
I also wonder why you're using on old version.
I also wonder why you're using on old version.
Re: LUBE (Networking Library)
thanks
adding this now works
was just making some test because i noticed the 1.0 wanted a common class implementation, but ill switch to it
adding this now works
Code: Select all
function love.update(dt)
mClient:update(dt)
mServer:update(dt)
end
Re: LUBE (Networking Library)
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)
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
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: LUBE (Networking Library)
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.
Who is online
Users browsing this forum: No registered users and 4 guests