ByteNet Max
An upgraded buffer-based networking system
ByteNet Max is an upgraded version of @ffrostfall’s ByteNet which relies on strict type-checking to serialise your data into buffers before deserialising it on the other end, feeding it back to your Luau code. But what makes ByteNet Max different from ByteNet? ByteNet Max supports queries (RemoteFunctions) which are client to server requests for data. This brings you an extremely optimised experience for RemoteFunctions, using minimal data to increase send & receive speeds. ByteNet Max lives up to ByteNet’s idea of making networking simple, easy and quick. The API is simple an minimalistic, helping you grasp the concepts of ByteNet Max pretty quickly!
Installation
Get ByteNet Max on the Roblox Creator Store!
Performance
ByteNet Max lives up to the standards of ByteNet, performing incredibly well compared to other networking libraries such as BridgeNet2. The conversion to a buffer reduces memory usage significantly, helping optimise and speed up data transfer.
Documentation
ByteNet Max follows the same architecture as ByteNet, hence the documentation for RemoteEvents (packets) is the exact same and can be found here: Documentation.
However, it adds a new system named queries. This is the ByteNet equivalent of a RemoteFunction. To begin, you can create a ModuleScript to define a namespace under which your packets and queries will be held:
local ByteNetMax = require(path.to.ByteNetMax)
return ByteNetMax.defineNamespace("PlayerData", function()
return {
GetCoins = ByteNetMax.defineQuery({
--[[The request & response parameters are EXTREMELY IMPORTANT!
if you do not want a request, just leave ByteNet.struct({}) blank.]]--
request = ByteNet.struct({
message = ByteNet.string
}),
response = ByteNet.struct({
coins = ByteNet.int16
})
})
}
end)
Then, in a local script, you can invoke the query like so:
local QueryModule = require(path.to.QueryModule)
local Coins = QueryModule.GetCoins.invoke({
message = "Can I please get the coins value?"
})
print(Coins)
In a server script, you can receive the query and return the appropriate information, like so:
local QueryModule = require(path.to.QueryModule)
QueryModule.GetCoins.listen(function(data, player)
print(data.message) -- prints "Can I please get the coins value?"
return player.leaderstats.Coins.Value
end)
It’s that simple!
Contact
Contact me on Twitter or Discord (username: elitriare), or just in this thread to report bugs or request features. I haven’t fully tested this across different types of experiences, so your feedback is extremely useful!
This project is open-source.