mirror of
https://github.com/imezx/Warp.git
synced 2026-06-02 12:18:32 +00:00
feat: add float32 precision option for vector2 & vector3 type
This commit is contained in:
commit
a21a1e964b
6 changed files with 15 additions and 16 deletions
BIN
Warp.rbxm
BIN
Warp.rbxm
Binary file not shown.
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ local warp_identifier_registry = shared.__warp_identifier_registry
|
||||||
if RunService:IsClient() or RunService:IsRunMode() then
|
if RunService:IsClient() or RunService:IsRunMode() then
|
||||||
local pending_id_yields, pending_name_yields, ready_yields = {}, {}, {}
|
local pending_id_yields, pending_name_yields, ready_yields = {}, {}, {}
|
||||||
local is_ready = false
|
local is_ready = false
|
||||||
|
|
||||||
if RunService:IsClient() then
|
if RunService:IsClient() then
|
||||||
_repl.OnClientEvent:Connect(function(b: buffer)
|
_repl.OnClientEvent:Connect(function(b: buffer)
|
||||||
if type(b) ~= "buffer" then
|
if type(b) ~= "buffer" then
|
||||||
|
|
@ -26,7 +26,7 @@ if RunService:IsClient() or RunService:IsRunMode() then
|
||||||
local id: number, remote: string = content[1], content[2]
|
local id: number, remote: string = content[1], content[2]
|
||||||
warp_identifier_registry.cache[remote] = id
|
warp_identifier_registry.cache[remote] = id
|
||||||
warp_identifier_registry.name[id] = remote
|
warp_identifier_registry.name[id] = remote
|
||||||
|
|
||||||
if pending_id_yields[remote] then
|
if pending_id_yields[remote] then
|
||||||
for _, thread in pending_id_yields[remote] do
|
for _, thread in pending_id_yields[remote] do
|
||||||
task.spawn(thread, id)
|
task.spawn(thread, id)
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue