ByteNet | Advanced networking library w/ buffer serialization, strict Luau, absurd optimization, and rbxts support. | 0.4.3

I know its just typo. But my main point is if I want it without datatype, how? Because i wanna send number but also can be string or maybe a whole table?

Edit: Let’s say I want it to be like

local ByteNet = require(path.to.ByteNet)
local Packets = require(path.toPackets)

local data = {
	whateber1: 8,
	whatever2: 10
}
Packets.testingPacket:send({
	name = "whatever",
	value = data
})

Then how to define the packet?

I don’t think you’re even reading the example at all.
image

I’ve even checked the DataType module, that’s why I ask if we are able to define data types without any type… because even like in example TextField: data types string, what if sometimes i want text field to be number or anything else?
Like packets.samepacket.send({ TextField: 1 }) but maybe sometimes I want it to be packets.samepacket.send({ TextField: “a”}), how then? Explain it to me.

Define another packet then or another variable. You shouldn’t be hot-swapping parameters like that.

Oh so ByteNet works kinda different than BridgeNet right? So it’s like stricter, because you have to define packets before.

I made a private framework (deciding if I should make it public) that does dynamic data type conversion (at cost for a slightly more buffer size) and tables.

However, yeah, with ByteNet and probably other types of buffer-based networking system, tables and dynamic datatypes are not (?) supported.

Well how would I go about making a event that doesn’t have any parameters? Do I just add a filler variable?

If I have a server player loader that tells the client codebase to load after the data is loaded, do I just make a regular remote event?
TBH I think this feature should be added in.

1 Like

You can do a trial and error and see if just setting the parameter to nil works.

1 Like

Great library, saves me from doing it myself

Minor doc issue: tutorial has definePacket arguments the other way around
Tutorial:


Studio:
image

1 Like

I think that’s the older version docs.

1 Like

Idk, I don’t use github :sweat_smile: I just clicked the docs link, it’s a screenshot from the Tutorial section

1 Like

Hi! I’m interested in using this module but I see that there is no rbxm file download link provided. Could one be given? Thanks!

1 Like

This seems good. Do you plan to add typed arrays? eg.

local obj1 = {“hello world”, 4, 2.343, 0}
local obj2 = {“hello world (again)”, 4, 0.3423, 3643}
local obj3 = {“example3”, 1, 0.263, 2436}

local objX = {“exampleX”, 5, 5.353, 574}
local example_typed_array = {obj1, obj2, obj3, …, objX}

And “example_typed_array” is object to be send. (X is eg. players amount in server)
This would be very useful as compression is needed even more with a lot of values.

3 Likes

version 0.3.0

Added

  • Types: Vector2, CFrame, Array, Optional, Map

Improvements

  • Rewrote client/server processing. Should drastically improve stability and performance.
  • Completely re-did how serialization happens to be a lot more stable, and to allow a lot of room for improvement.
  • Many type improvements
  • Removed only dependency
3 Likes

Oops. Forgot to add links to the post.

updated post w/ links to project

1 Like

version 0.3.1

Improvements

  • Rewrote serialization to use an allocator w/ resizing instead of using “deferred write” functions. Should be an incredibly large performance boost.
4 Likes

Thank you for including .rbxm files by the way, looking forward to using this.

3 Likes

is this how i define 2 packets:

local rgbsend = byte.definePacket('rgb')
local screensend = byte.definePacket('screen')
--them both are ment to handle strings

and recive it on the client:

screen:listen(function(screenshot_size: Vector2)  

and the other one:

rgb:listen(function(updatedRGBValues: string)
1 Like

Per the example on the docs:

local ByteNet = require(path.to.bytenet)

return {
    printSomething = ByteNet.definePacket({
        -- This structure field is very important!
        structure = {
            message = ByteNet.string,
        }
    })
}
-- Sending to server
packets.printSomething:send({
    message = "Hello, world!"
})
packets.printSomething:listen(function(data, player)
    print(`{player.UserId} says { data.message }`)
end)
1 Like

ok ill have a look at the documentation

1 Like