{"id":"vq9o/knightremotes","name":"knightremotes","scope":"vq9o","platform":"roblox","description":"Mirrored from the Wally registry.","version":"2.0.2","latest":"2.0.2","versions":["2.0.0","2.0.1","2.0.2"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"raphtalia/class":{"version":"^1.0.2","alias":"class"},"csqrl/sift":{"version":"^0.0.11","alias":"sift"}},"integrity":"1e22aeb7a4951c1142acc65c9a63c4438de27f853a66da2842a3b1782514afa0","likes":0,"downloads":0,"install":"forest install vq9o/knightremotes","url":"https://forest.dev/p/roblox/vq9o/knightremotes","files":"https://api.forest.dev/ai/package/roblox/vq9o/knightremotes/files","readme":"# knightremotes\r\n\r\nA high-performance, type-safe networking library for Roblox using binary buffers for efficient data transmission.\r\n\r\n## Features\r\n\r\n✨ **High Performance** - Binary buffer protocol with automatic batching  \r\n🔒 **Type Safe** - Full strict mode support with comprehensive type annotations  \r\n🛡️ **Middleware System** - Intercept and modify packets for validation, logging, and rate limiting  \r\n⚡ **Reliable & Unreliable** - Choose the right transmission method for your use case  \r\n🔄 **Two-Way Communication** - Request/response pattern for client-server interactions  \r\n📦 **Efficient Serialization** - Optimized encoding for all Roblox data types  \r\n\r\n## Quick Start\r\n\r\n```lua\r\nlocal KnightRemotes = require(ReplicatedStorage.Packages.knightremotes)\r\nKnightRemotes:init()\r\n\r\n-- Create a remote\r\nKnightRemotes:new(\"PlayerDamaged\", true, false)\r\n\r\n-- Server: Listen for events\r\nKnightRemotes:Connect(\"PlayerDamaged\", function(player, damage)\r\n    player.Character.Humanoid.Health -= damage\r\nend)\r\n\r\n-- Client: Fire events\r\nKnightRemotes:Fire(\"PlayerDamaged\", 25)\r\n```\r\n\r\n## Documentation\r\n\r\n* 📖 [API Documentation](docs/API.md) - Complete API reference with examples\r\n* 🔧 [Migration Guide](docs/API.md#migration-from-standard-remoteevents) - Coming from RemoteEvents?\r\n\r\n## Installation\r\n\r\n### Wally\r\n\r\n```toml\r\n[dependencies]\r\nknightremotes = \"vq9o/knightremotes@2.0.0\"\r\n```\r\n\r\nThen run: `wally install`\r\n\r\n## Why KnightRemotes?\r\n\r\nTraditional RemoteEvents and RemoteFunctions are simple but inefficient. KnightRemotes provides:\r\n\r\n- **60% smaller packets** through optimized binary serialization\r\n- **Automatic batching** of multiple calls in a single frame\r\n- **Middleware system** for centralized validation and rate limiting\r\n- **Type safety** with full Luau type annotations\r\n- **Flexible reliability** - choose reliable or unreliable per remote\r\n\r\n## Example: Two-Way Communication (Server -> Client / Client -> Server)\r\n\r\n```lua\r\n-- Server\r\nKnightRemotes:new(\"GetPlayerData\", {\r\n    Reliable = true;\r\n    TwoWay = true;\r\n}, function(player, dataType)\r\n    return true, player.Data[dataType]\r\nend)\r\n\r\n-- Client\r\nlocal success, data = KnightRemotes:Fire(\"GetPlayerData\", \"inventory\")\r\nif success then\r\n    print(\"Inventory:\", data)\r\nend\r\n```\r\n\r\n## Example: Middleware\r\n\r\n```lua\r\n-- Rate limiting middleware\r\nKnightRemotes:UseMiddleware(function(player, eventName, args)\r\n    if isRateLimited(player) then\r\n        return false -- Block the request\r\n    end\r\n    return true\r\nend)\r\n```\r\n\r\n## Links\r\n* The Knight framework (**not required**): https://github.com/RAMPAGELLC/knight/tree/main\r\n* Documentation: https://knight.metatable.dev/luau-api/knight-remotes-api\r\n* Legacy (V1): https://github.com/RAMPAGELLC/KnightRemotes\r\n\r\n# License\r\n```\r\nMIT License\r\n\r\nCopyright (c) 2025 Meta Games, LLC.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n```\r\n","readmeTruncated":false}