Here's my networking library named LUBE, this post is now used for project status.
Current version: 1.0
Version 1.0 (press 'raw' for download, or check out the repo and use the 'LUBE-1.0' tag)
Version 1.0 docs
Development version
Development version docs
Old releases:
Lag-o-meter 3000 -> page 12
TechnoCat's awesome introductory writeup
LUBE (Networking Library)
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
LUBE (Networking Library)
Last edited by bartbes on Tue Jul 21, 2009 10:04 am, edited 55 times in total.
Re: Networking Library
Maybe UdpClient ?bartbes wrote:Any suggestions for a name?
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Networking Library
Thanks! I'll look at other suggestions (if any) before going with this name though.
Last edited by bartbes on Thu Oct 23, 2008 1:51 pm, edited 1 time in total.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Networking Library
Moved changelog to first post, added host.
Re: Networking Library
Hi, i'm new here, so not really sure if this is applicable what i'm saying, if you are making a network library for LOVE, you should stick to LOVEs naming convention, i.e. function names start with lower case letters.
Personally i prefer starting with a capital letter, but I think maintaining a standard is much better then everyone going in his own direction.
/u9
Personally i prefer starting with a capital letter, but I think maintaining a standard is much better then everyone going in his own direction.
/u9
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Networking Library
You're right
Added to list.
Added to list.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Networking Library
Suggestion for binary packing:
this is basically
So? Do you agree? Or do you have other ideas about packing? Post!
Code: Select all
1 byte identifier (S=string, N=number, etc)
byte with value 1
name
byte with value 1
value
byte with value 0
Code: Select all
id-1-name-1-value-0
Re: Networking Library
Let's see my new network tcp client lib version.
Sample of code
Sample of code
Code: Select all
function j2h_parseline(line)
[...]
if cmd == "ping" then
log("receive ping sending pong...n-i-y");
network:execCmd("pong", line);
return 0;
end
if cmd == "pong" then
local lag = os.difftime (os.time(), line);
log("pong reply(" .. tostring(line) .. ") lag = " .. tostring(lag) .. " s");
return 0;
end
[...]
return 1;
end
function j2h_db_update(datafound)
if datafound then
log("data found ... here you can show number of updated lines ..."
--else
-- you can also do something here, when data found but nothing require update
end
end
function load()
love.filesystem.require( "network.lua" );
config.host = "myhost.domain.com";
config.port = 1234;
socket = require("socket");
network = Network:New("tcp-client");
network:setLogHandler(
function(...)
print("network: " .. ...);
end
);
network:Setup(config.host, config.port);
network:setParseHandler(j2h_parseline); -- execute for each line received
network:setEndHandler(j2h_db_update); -- execute after parse all line
network:addCmd("getall",
function(self)
local lines = "GET *";
self:Send(lines);
j2h_log("send getall request");
end
);
network:addCmd("ping",
function(nw)
local time = os.time();
local lines = "ping " .. tostring(time) .. "\n"
nw:Send(lines);
j2h_log("ping " .. tostring(time));
end
);
network:addCmd("pong",
function(nw, data)
nw:Send("pong", data);
end
);
network:Setup(config.host, config.port);
network:Enable()
network:execCmd("getall");
end
function j2h_quit()
network:Disable();
love.system.exit();
end
function update(dt)
network:Update(dt);
end
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
Re: Networking Library
Hey, I had an idea for a name, but it is generic. "LÖVE CÖNNECTION"
Anyways I also a had another proposition. If you can actually get this project off the ground with a working example in a game, I would be happy to contribute a web site. If I had the free time. I do web design.
Anyways I also a had another proposition. If you can actually get this project off the ground with a working example in a game, I would be happy to contribute a web site. If I had the free time. I do web design.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Networking Library
Yeah, this topic actually started at http://love2d.org/forum/viewtopic.php?f=3&t=225, I was talking about a game there too.
And as I said there, I'm not going to code an entire game myself (as I just plain suck at graphics), however I would help as much as possible when (NOT IF!) someone starts a project.
And this will actually help this lib <insert name here>, because the best way to create a library is by actually using it.
So.. volunteers?
@funcoot: noted the name suggestion, I'll wait for a little longer and start a poll
And as I said there, I'm not going to code an entire game myself (as I just plain suck at graphics), however I would help as much as possible when (NOT IF!) someone starts a project.
And this will actually help this lib <insert name here>, because the best way to create a library is by actually using it.
So.. volunteers?
@funcoot: noted the name suggestion, I'll wait for a little longer and start a poll
Who is online
Users browsing this forum: No registered users and 9 guests