Would someone please fix the lube docs?

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
User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Would someone please fix the lube docs?

Post by zac352 »

http://love2d.org/wiki/ClientObject

Connect to server is the description of ClientObject:send and downward. And all of those pages have the same content as ClientObject:Init...

(Also, I know I said I quit, but that does not mean I quit using love... Just the forums. And I'm coming back now because I'm stuck. >_<)

(And I had to ask someone with a faster computer to find the snow script so I could block it. It crashed the tab. T_T)
Hello, I am not dead.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Would someone please fix the lube docs?

Post by kikito »

Also, I know I said I quit, but that does not mean I quit using love... Just the forums.
You said you quit? I thought it was your cousin.

I think the snowflake javascript that you have to block is http://uapps.org/snowstorm-min.js

I don't use lube, good luck on that one.
When I write def I mean function.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Would someone please fix the lube docs?

Post by TechnoCat »

zac352 wrote:http://love2d.org/wiki/ClientObject

Connect to server is the description of ClientObject:send and downward. And all of those pages have the same content as ClientObject:Init...
Well, whoever was transcribing it to the wiki either stopped early, or missed those functions. Regardless they can be found in the docs found with LUBE. Which I will possibly illegally post here:

Code: Select all

lube.server (...) 	Creates a server object
lube.server.tcp:acceptAll () 	Accepts connecting clients (TCP only)
lube.server:Init (port, socktype) 	Initializes the server
lube.server:checkPing (dt) 	Check for ping messages If clients are timed out, disconnect them
lube.server:receive () 	Receive data from clients
lube.server:respondToServBrowser (active, info) 	Sets if the server should respond to Server Browser requests
lube.server:send (data, rcpt) 	Send data to clients
lube.server:setCallback (recv, connect, disconnect) 	Sets the callbacks
lube.server:setHandshake (hshake) 	Sets a handshake
lube.server:setPing (enabled, time, msg) 	Set ping
lube.server:startserver (port) 	Start the server Sets the server, is normally called by init
lube.server:update (dt) 	Update the server Checks for incoming messages, and classifies as ping, connect, disconnect and raw data Also checks ping (since 0.6) 

Code: Select all

lube.server:Init (port, socktype)
    Initializes the server
    Parameters

        port: Which port to listen on
        socktype: Type of socket, can be udp/tcp/user-created, default is udp

lube.server:checkPing (dt)
    Check for ping messages If clients are timed out, disconnect them
    Parameters

        dt: Delta-time as passed to update

lube.server:receive ()
    Receive data from clients 
lube.server:respondToServBrowser (active, info)
    Sets if the server should respond to Server Browser requests
    Parameters

        active: Should the server respond
        info: A table containing the server name and version as named keys

lube.server:send (data, rcpt)
    Send data to clients
    Parameters

        data:
        rcpt: Recipient, if nil then sends to all clients

lube.server:setCallback (recv, connect, disconnect)
    Sets the callbacks
    Parameters

        recv: Callback called on incoming data (filtered): function(data, id)
        connect: Callback called when client connects: function(id)
        disconnect: Callback called when client disconnects (also called by ping): function(id)

lube.server:setHandshake (hshake)
    Sets a handshake
    Parameters

        hshake: A unqiue string, shared by client and server to identify connecting and disconnecting users

    See also:

        lube.client:setHandshake 

lube.server:setPing (enabled, time, msg)
    Set ping
    Parameters

        enabled:
        time:
        msg:

    See also:

        lube.client:setPing 

lube.server:startserver (port)
    Start the server Sets the server, is normally called by init
    Parameters

        port:

    See also:

        lube.server:Init 

lube.server:update (dt)
    Update the server Checks for incoming messages, and classifies as ping, connect, disconnect and raw data Also checks ping (since 0.6)
    Parameters

        dt: Delta-time

User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Re: Would someone please fix the lube docs?

Post by zac352 »

kikito wrote:
Also, I know I said I quit, but that does not mean I quit using love... Just the forums.
You said you quit? I thought it was your cousin.

I think the snowflake javascript that you have to block is http://uapps.org/snowstorm-min.js

I don't use lube, good luck on that one.
Yeah. I started getting weird errors.
Then I used LuaSocket directly, and got REALLY weird errors.
How do you receive data from the buffer, and not block the script until new data is received? :/

My script is weird: If you print data out every frame, it will work, but otherwise it doesn't. I think data isn't getting through the message queue system in threads. :/
Hello, I am not dead.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Would someone please fix the lube docs?

Post by TechnoCat »

zac352 wrote:Yeah. I started getting weird errors.
Then I used LuaSocket directly, and got REALLY weird errors.
How do you receive data from the buffer, and not block the script until new data is received? :/
Try doing luasocket in a love.thread and passing it back and forward to your application. I'm just guessing here. LUBE could probably do with a big love-thread overhaul.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Would someone please fix the lube docs?

Post by bartbes »

As to non-blocking receive, LUBE does that out-of-the-box, doesn't it? Anyway, there's the receive callback as well.

If using LuaSocket you can use socket:settimeout(0).
Post Reply

Who is online

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