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 »

Do you have a handshake set?
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: LUBE (Networking Library)

Post by ArchAngel075 »

I did not, derp. Thanks for pointing that out! - perhaps you should add to the .doc that the handshakes are absolutely necessary?
lots of thanks!

-end-
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: LUBE (Networking Library)

Post by ArchAngel075 »

So after learning alot from my first attempt at a network based game i am now working on a concept-demo of another game...

Though one issue i struggle with is informing the client what id he is (clientid upon joining) - is there any way to get this id client side without having to send the id to the client upon connection?

Its not all that important, but it does clean up some code...
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 clientid is completely server-side, and is not guaranteed to have any structure, it's just unique from any other clientid belonging to connected clients. Why do you need this? Maybe you could just have a counter and increment it every connect?
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: LUBE (Networking Library)

Post by ArchAngel075 »

I track what clients have connected before by taking the IP (string sub out the port) of the client-id and storing it, also ALL the data regarding the client server side is stored in a table using the client-id as a key, this way i can rapidly track clients.

If i simply increment a id, then somewhere i need to track who this integer id represents, ofc i could use the integer as my key (from above table)
But seeing as its easier to prevent the same ip from connection twice this way i prefer the client id....

Also i need the client id as its what i use all over to reference the table that the server uses to store client data... such as any entities created belonging to that client, thus should i do a for loop and json encode a table containing each clients entity data using their clientid as keys and broadcast each client is quickly provided each others, and their own, entity data...

I only wished for a client side way as i atm need to send a message saying ("$AllocatedID$" .. json.encode(clientid)")
EVERYTHING client side, and then eventually server side, breaks should the client fail to get its id...

Its not too big a issue, but if connections are slow than i need to think of a few systems to prevent this or hope of a way for client-side id getting...
--i suppose a hacky method would to have the client create its own temp server, join it and then log the id -- deleting the server and continue ?
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 »

Once again, client ids are not guaranteed or specified to have any structure, and indeed they do not consist (at all) of ip:port pairs when using anything other than udp. The local server thing will most likely fail, too. Honestly, I can't see a reason why the client needs to know its specific clientid in the first place. (And why it can't use a value representing it.)
User avatar
jag_e_nummer_ett
Citizen
Posts: 52
Joined: Thu May 16, 2013 6:31 pm
Location: Stockholm, Sweden

Re: LUBE (Networking Library)

Post by jag_e_nummer_ett »

LUBE is only for LÖVE to LÖVE conncetions right? :?
bekey
Party member
Posts: 255
Joined: Tue Sep 03, 2013 6:27 pm

[]

Post by bekey »

-snip-
Last edited by bekey on Fri Jan 24, 2014 1:40 am, edited 2 times in total.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: LUBE (Networking Library)

Post by Davidobot »

Is there a limit to how big a string can be when sending over the network?
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
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 don't think there is one for tcp, and there probably isn't one for enet, but for udp it's 64k.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests