diff --git a/Warp.rbxm b/Warp.rbxm index ba989eb..07a28e8 100644 Binary files a/Warp.rbxm and b/Warp.rbxm differ diff --git a/pesde.toml b/pesde.toml index b6b797b..934b63a 100644 --- a/pesde.toml +++ b/pesde.toml @@ -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" diff --git a/src/Client/init.luau b/src/Client/init.luau index 2090a56..201ad75 100644 --- a/src/Client/init.luau +++ b/src/Client/init.luau @@ -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 diff --git a/src/Replication/init.luau b/src/Replication/init.luau index 1b3fb68..8b41201 100644 --- a/src/Replication/init.luau +++ b/src/Replication/init.luau @@ -14,7 +14,7 @@ local warp_identifier_registry = shared.__warp_identifier_registry if RunService:IsClient() or RunService:IsRunMode() then local pending_id_yields, pending_name_yields, ready_yields = {}, {}, {} local is_ready = false - + if RunService:IsClient() then _repl.OnClientEvent:Connect(function(b: buffer) 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] warp_identifier_registry.cache[remote] = id warp_identifier_registry.name[id] = remote - + if pending_id_yields[remote] then for _, thread in pending_id_yields[remote] do 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 Replication.wait_for_ready = function() if is_ready then return end - local thread = coroutine.running() table.insert(ready_yields, thread) coroutine.yield() diff --git a/src/Server/init.luau b/src/Server/init.luau index 903e460..6e8fb15 100644 --- a/src/Server/init.luau +++ b/src/Server/init.luau @@ -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 diff --git a/wally.toml b/wally.toml index 1762f23..77786f6 100644 --- a/wally.toml +++ b/wally.toml @@ -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"