Other Setups
- Luau
- Typescript
You can integrate YetAnotherNet into whatever game architecture you want by creating a Hook using YetAnotherNet.createHook({ Route })
which is identical to the YetAnotherNet.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 YetAnotherNet.createHook({ Route })
,
local RunService = game:GetService("RunService")
local YetAnotherNet = require("@packages/YetAnotherNet")
local routes = require("@shared/routes")
local hook = YetAnotherNet.createHook(routes)
RunService.Heartbeat:Connect(hook)
You can integrate YetAnotherNet into whatever game architecture you want by creating a Hook using Net.createHook({ route: Route })
which is identical to the Net.start(loop, { route: 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: Route })
,
import { RunService } from "@rbxts/services";
import Net from "@rbxts/yetanothernet";
import routes from "shared/routes";
const hook = Net.createHook(routes);
RunService.Heartbeat.Connect(hook);