{"id":"aloroid/cheapnet","name":"cheapnet","scope":"aloroid","platform":"roblox","description":"A cheap networking library designed for safety.","version":"0.4.3","latest":"0.4.3","versions":["0.0.0","0.1.0","0.2.0-rc1","0.2.0-rc2","0.2.0-rc3","0.2.0-rc4","0.2.0-rc5","0.2.0-rc6","0.2.0-rc7","0.2.0-rc8","0.2.0","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4","0.3.5","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4-rc1","0.5.0-rc1","0.5.0-rc2","0.5.0-rc3","0.5.0-rc4","0.5.0-rc5","0.5.0-rc6","0.5.0-rc7"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":false,"dependencies":{"sleitnick/signal":{"version":"^1.3.0","alias":"Signal"},"aloroid/t":{"version":"^3.1.1","alias":"t"}},"integrity":"64446993055daecae93b27e5c3713bac4b74093203557895997460fd3f5de64b","likes":0,"downloads":0,"install":"forest install aloroid/cheapnet","url":"https://forest.dev/p/roblox/aloroid/cheapnet","files":"https://api.forest.dev/ai/package/roblox/aloroid/cheapnet/files","readme":"# CheapNet\n\nCheapNet is a lazy alternative to BridgeNet which is semi-actively maintained?\nIt should be pretty similar qua api and easy to understand as it comes with Luau types.\n\n## Setting Up\n\nInstall CheapNet through Wally using `wally.toml` by adding `CheapNet = aloroid/cheapnet@0.1.0`\n\nYou should probably create a file inside a shared space that both server and clients can access which creates the bridges that need to be accessed.\n\n```lua\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\n\nlocal Packages = ReplicatedStorage.Packages\n\nlocal CheapNet = require(Packages.CheapNet)\n\nreturn {\n\t\n\tremote_1 = CheapNet.new(\"remote/1\"),\n\tremote_2 = CheapNet.new(\"remote/2\")\n\t\n}\n```\n\nYou can even add in a runtime typechecking test using the second argument which will check the types that are given to a remote, which can be handy to preventing exploiters.\n\nPlease note that the typechecking test runs after the middleware, as I really just made it like this to get types on the remotes and stuff that I write.\n\nYou can do it like this:\n\n```lua\nreturn {\n\t\n\tremote_1 = CheapNet.new(\"remote/1\", function(value: string)\n\t\treturn type(value) == \"string\"\n\tend), -- This will now fail if the value passed into it is not a string.\n\tremote_2 = CheapNet.new(\"remote/2\")\n\t\n}\n```\n\nIt's recommended to install a library like [`t`](https://github.com/roblox/t) to do this for you so it won't look as cluttered.\n(You should use my fork of [`t`](https://github.com/aloroid/t) which comes with some nice Luau typechecking)\n\n## Basic Usage\nCheapNet is pretty easy to use and doesn't have a big API.\n\nDocumentation is non-existent because I am lazy.<br>\nInstead, have a example!\n```lua\n-- Shared\nlocal Bridge = CheapNet.new(\"luanoid_shoot\", t.CFrame)\n\n-- Client\nBridge.OnClientEvent:Connect(function(cframe: CFrame)\n\tprint(\"he pew at\", cframe.Position)\nend)\n\n-- Server\nBridge:FireToClients(cframe):include(initialized_players):exclude(owner)\n\n```\n \n---\n\n## Why create another networking library?\n.\n## Why should I use this over BridgeNet?\n\nOther than the fact that this uses less bandwidth by using a very nice and better system to pack remote calls, no idea! BridgeNet offers identifiers which CheapNet doesn't have, so I just made this out of selfish reasons and boredom.\n\n## Why did you name it CheapNet?\nIt's made cheaply. It's a little bit slower than BridgeNet because of the superior bandwidth usage but other than that it should be fine.\n","readmeBorrowedFrom":{"version":"0.1.0","source":"wally"},"readmeTruncated":false}