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"
version = "1.1.0-pre4"
version = "1.1.0-pre7"
description = "A rapidly-fast & powerful networking library."
authors = ["eternitydev"]
repository = "https://github.com/imezx/Warp"

View file

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

View file

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

View file

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