Skip to content

v0.3.0

Latest
Compare
Choose a tag to compare
@jiwonz jiwonz released this 28 Oct 15:33
· 2 commits to main since this release
  • Change math.sqrt into ^.5 (Slightly faster)
  • Simplify the defineNamespace (Breaking change)
-- before
return HandyNet.defineNamespace("example", function()
	return {
		hello = HandyNet.definePacket(
			"client->server",
			HandyNet.struct({
				message = HandyNet.string(HandyNet.u8), -- Customizable string size (defaults to u16)
				cf = HandyNet.CFrame, -- Uses quaternion to compress!
				enum = HandyNet.Enum.KeyCode :: Enum.KeyCode -- Weird type error with enums..
			})
			-- default: "reliable"
		),
		countUp = HandyNet.defineEvent("unreliable")
	}
end)

-- after
return HandyNet.defineNamespace("example", {
	hello = HandyNet.definePacket(
		"client->server",
		HandyNet.struct({
			message = HandyNet.string(HandyNet.u8), -- Customizable string size (defaults to u16)
			cf = HandyNet.CFrame, -- Uses quaternion to compress!
			enum = HandyNet.Enum.KeyCode :: Enum.KeyCode -- Weird type error with enums..
		})
		-- default: "reliable"
	),
	countUp = HandyNet.defineEvent("unreliable")
})