LUBE networking not working

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Blobles
Prole
Posts: 1
Joined: Wed Feb 22, 2017 1:14 am

LUBE networking not working

Post by Blobles »

Pretty new to networking and wanted to do some testing with LUBE. Getting no errors at all just nothing is appearing.
It's pretty simple, followed a tutorial and changed a few things to get it working (as the code was wrong on the tutorial - lol) fixed the errors yet no luck on getting it to actually print anything.
Client

Code: Select all

Class = require "libs.class"
require "libs.LUBE"

function onReceive(data)
  
end


function load()
    lube.client:Init() --initialize
    lube.client:setHandshake("Hi!")
    lube.client:setCallback(onRecieve)
    lube.client:connect("127.0.0.1", 25000)
end

function update(dt)
    lube.client:update()
end

function draw()

end

function love.draw()
	local version = 0.1
    love.graphics.print("CLIENT - v"..version, 1, 1)
end
Server

Code: Select all

Class = require "libs.class"
require "libs.LUBE"

function onConnect(ip, port)
	print("Connection from "..ip)
	love.graphics.print("Connection from "..ip)
end

function onReceive(data, ip, port)
  
end

function onDisconnect(ip, port)
  
end

function load()
    lube.server:Init(25000)
    lube.server:setCallback(onReceive, onConnect, onDisconnect)
    lube.server:setHandshake("Hi!")
end

function update(dt)
  lube.server:update(dt)
end

function love.draw()

end
server conf has t.console = true, yet nothing is printing to console!
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: LUBE networking not working

Post by Positive07 »

Are you on windows? Try using the lovec.exe executable, if that doesnt work try adding this line to the top of your conf.lua or main.lua

Code: Select all

io.out:setvbuf('no')
Also there has been some updates to LUBE and it's now called Grease so I recommend you update

If that doesn't work maybe you should check the category about Networking in Awesome LÖVE or directly use LuaSocket or Lua-ENet
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 221 guests