{"id":"elitriare/bytenet-max","name":"bytenet-max","scope":"elitriare","platform":"roblox","description":"Mirrored from the Wally registry.","version":"1.0.0","latest":"1.0.0","versions":["0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.2.0","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.2.7","1.0.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{},"integrity":"f920b18d6deafbdae7e774a666eaa82c6dbab85ba2d379689a0e1f76d7ef83fa","likes":0,"downloads":0,"install":"forest install elitriare/bytenet-max","url":"https://forest.dev/p/roblox/elitriare/bytenet-max","files":"https://api.forest.dev/ai/package/roblox/elitriare/bytenet-max/files","readme":"<div align=\"center\"><h1><b>ByteNet Max</b></h1></div>\n<div align=\"center\"><h2><b>An upgraded buffer-based networking system</b></h2></div>\n\nByteNet Max is an upgraded version of @ffrostfall's [ByteNet](https://devforum.roblox.com/t/bytenet-advanced-networking-library-w-buffer-serialization-strict-luau-absurd-optimization-and-rbxts-support-043/2733365) 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!\n\n<h3><b>Installation</b></h3> \n\nGet [ByteNet Max](https://create.roblox.com/store/asset/81428213632345/ByteNet-Max) on the Roblox Creator Store!\n\n<h3><b>Performance</b></h3> \n\nByteNet 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.\n\n<h3><b>Documentation</b></h3> \n\nByteNet Max follows the same architecture as ByteNet, hence the documentation for RemoteEvents (packets) is the exact same and can be found here: [Documentation](https://ffrostfall.github.io/ByteNet/api/functions/definePacket/).\n\nHowever, 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:\n```luau\nlocal ByteNetMax = require(path.to.ByteNetMax)\n\nreturn ByteNetMax.defineNamespace(\"PlayerData\", function()\n    return {\n       packets = {}, -- not necessary to include this table if there's no values in it.\n       queries = {\n\t\tGetCoins = ByteNetMax.defineQuery({\n\t\t\trequest = ByteNetMax.struct({\n\t\t\t\tmessage = ByteNetMax.string\n\t\t\t}),\n\t\t\tresponse = ByteNetMax.struct({\n\t\t\t\tcoins = ByteNetMax.uint8\n\t\t\t})\n\t\t})\n\t},\t\t\n    }\nend)\n```\n\nThen, in a local script, you can invoke the query like so:\n```luau\nlocal QueryModule = require(path.to.QueryModule)\n\nlocal Coins = QueryModule.queries.GetCoins.invoke({\n\tmessage = \"Can I please get the coins value?\"\n})\n\nprint(Coins)\n```\n\nIn a server script, you can receive the query and return the appropriate information, like so:\n```luau\nlocal QueryModule = require(path.to.QueryModule)\n\nQueryModule.queries.GetCoins.listen(function(data, player)\t\n\tprint(data.message) -- prints \"Can I please get the coins value?\"\n\treturn player.leaderstats.Coins.Value\nend)\n```\n\nIt's that simple!\n\nPackets & Queries can co-exist under the same namespace, just make sure you define the packets and queries table in defineNamespace. If you don't require packets, you can leave it out and just define the queries table, and vice versa.\n\n<b>IMPORTANT:</b> You must require the ModuleScript you created on both the server and client! This is to initialise server side & client side dependencies for a secure network.\n\n<h3><b>Contact</b></h3> \n\nContact me on [Twitter](https://x.com/Elitriare) 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!\n\nThis project is open-source.\n","readmeTruncated":false}