feat: add float32 precision option for vector2 & vector3 type

This commit is contained in:
khtsly 2026-05-04 08:17:09 +07:00
commit a21a1e964b
6 changed files with 15 additions and 16 deletions

BIN
Warp.rbxm

Binary file not shown.

View file

@ -1,5 +1,5 @@
name = "eternitydev/warp" name = "eternitydev/warp"
version = "1.1.0-pre4" version = "1.1.0-pre7"
description = "A rapidly-fast & powerful networking library." description = "A rapidly-fast & powerful networking library."
authors = ["eternitydev"] authors = ["eternitydev"]
repository = "https://github.com/imezx/Warp" repository = "https://github.com/imezx/Warp"

View file

@ -9,8 +9,8 @@ local Replication = require("./Replication")
local Xor = require("./Util/Xor") local Xor = require("./Util/Xor")
local RunService = game:GetService("RunService") local RunService = game:GetService("RunService")
local Event: RemoteEvent = script.Parent:WaitForChild("Event") local Event: RemoteEvent = script.Parent:WaitForChild("Event") :: RemoteEvent
local UnreliableEvent: UnreliableRemoteEvent = script.Parent:WaitForChild("UnreliableEvent") local UnreliableEvent: UnreliableRemoteEvent = script.Parent:WaitForChild("UnreliableEvent") :: UnreliableRemoteEvent
local deltaT: number, cycle: number = 0, 1 / 61 local deltaT: number, cycle: number = 0, 1 / 61
local writer: Buffer.Writer = Buffer.createWriter() local writer: Buffer.Writer = Buffer.createWriter()
@ -176,8 +176,8 @@ if RunService:IsClient() then
local args = content[2] local args = content[2]
if handleInvokes then if handleInvokes then
if remote == 0 then if remote == 0 then
local id = content[1] local id = args[1]
local results = content[2] local results = args[2]
local pending = pendingInvokes[id] local pending = pendingInvokes[id]
if pending then if pending then
task.spawn(pending :: any, table.unpack(results)) task.spawn(pending :: any, table.unpack(results))
@ -200,7 +200,7 @@ if RunService:IsClient() then
local connections = eventListeners[remote] local connections = eventListeners[remote]
if connections then if connections then
for _, connection in connections do for _, connection in connections do
Thread(connection.c, table.unpack(args)) Thread(connection.c :: any, table.unpack(args))
end end
end end
end end

View file

@ -55,7 +55,6 @@ if RunService:IsClient() or RunService:IsRunMode() then
-- wait for the identifiers to be replicated from the server -- wait for the identifiers to be replicated from the server
Replication.wait_for_ready = function() Replication.wait_for_ready = function()
if is_ready then return end if is_ready then return end
local thread = coroutine.running() local thread = coroutine.running()
table.insert(ready_yields, thread) table.insert(ready_yields, thread)
coroutine.yield() coroutine.yield()

View file

@ -11,9 +11,9 @@ local Xor = require("./Util/Xor")
local Players = game:GetService("Players") local Players = game:GetService("Players")
local RunService = game:GetService("RunService") local RunService = game:GetService("RunService")
local Event: RemoteEvent = script.Parent:WaitForChild("Event") local Event: RemoteEvent = script.Parent:WaitForChild("Event") :: RemoteEvent
local _repl: RemoteEvent = script.Parent:WaitForChild("_repl") local _repl: RemoteEvent = script.Parent:WaitForChild("_repl") :: RemoteEvent
local UnreliableEvent: UnreliableRemoteEvent = script.Parent:WaitForChild("UnreliableEvent") local UnreliableEvent: UnreliableRemoteEvent = script.Parent:WaitForChild("UnreliableEvent") :: UnreliableRemoteEvent
local deltaT: number, cycle: number = 0, 1 / 61 local deltaT: number, cycle: number = 0, 1 / 61
local writer: Buffer.Writer = Buffer.createWriter() local writer: Buffer.Writer = Buffer.createWriter()
@ -182,7 +182,7 @@ Server.Invoke = function(remoteName: string, player: Player, timeout: number?, .
end end
table.insert(queueEvent[player], { table.insert(queueEvent[player], {
0, 0,
{ Identifier.get_id(remoteName), reqId :: any, { ... } :: any } :: any, { reqId :: any, { ... } :: any } :: any,
}) })
return coroutine.yield() return coroutine.yield()
end end
@ -217,7 +217,7 @@ if RunService:IsServer() then
continue continue
end end
if remote == 0 then if remote == 0 then
if #eventListeners == 0 then if not next(eventListeners) then
continue continue
end end
local remoteName = d[1] local remoteName = d[1]
@ -242,7 +242,7 @@ if RunService:IsServer() then
local connections = eventListeners[remote] local connections = eventListeners[remote]
if connections then if connections then
for _, connection in connections do for _, connection in connections do
Thread(connection.c, player, table.unpack(d)) Thread(connection.c :: any, player, table.unpack(d))
end end
end end
end end

View file

@ -1,6 +1,6 @@
[package] [package]
name = "imezx/warp" name = "imezx/warp"
version = "1.1.0-pre4" version = "1.1.0-pre7"
registry = "https://github.com/UpliftGames/wally-index" registry = "https://github.com/UpliftGames/wally-index"
realm = "shared" realm = "shared"
license = "MIT" license = "MIT"