Skip to main content

Other Setups

You can integrate YetAnotherNet into whatever game architecture you want by creating a Hook using Net.createHook({ Route }) which is identical to the Net.start(loop, { Route }) function. This function will return another function which you can call whenever you want to process your Routes' queues and send/receive your Packets on the Server or Client.

Below is a simple example of creating custom scheduling behavior using Net.createHook({ Route }),

local RunService = game:GetService("RunService")

local Net = require("Net.luau")
local routes = require("routes.luau")

local hook = Net.createHook(routes)
RunService.Heartbeat:Connect(hook)