mirror of
https://github.com/imezx/Warp.git
synced 2025-04-24 15:10:03 +00:00
oops
This commit is contained in:
parent
925df47d4c
commit
d065bc2e50
3 changed files with 5 additions and 7 deletions
BIN
Warp.rbxm
BIN
Warp.rbxm
Binary file not shown.
|
@ -232,12 +232,11 @@ function ClientProcess.start()
|
||||||
end)
|
end)
|
||||||
local function onClientNetworkReceive(Identifier: buffer | string, data: buffer, ref: { any }?)
|
local function onClientNetworkReceive(Identifier: buffer | string, data: buffer, ref: { any }?)
|
||||||
if not Identifier or typeof(Identifier) ~= "buffer" or not data or typeof(data) ~= "buffer" then return end
|
if not Identifier or typeof(Identifier) ~= "buffer" or not data or typeof(data) ~= "buffer" then return end
|
||||||
Identifier = Buffer.convert(Identifier :: buffer)
|
Identifier = Buffer.convert(Identifier)
|
||||||
local idx: string = registeredIdentifier[Identifier]
|
if not registeredIdentifier[Identifier :: string] then return end
|
||||||
if not idx then return end
|
|
||||||
local read = Buffer.read(data, ref)
|
local read = Buffer.read(data, ref)
|
||||||
if not read then return end
|
if not read then return end
|
||||||
local callback = clientCallback[idx]
|
local callback = clientCallback[Identifier :: string]
|
||||||
if not callback then return end
|
if not callback then return end
|
||||||
for _, fn: any in callback do
|
for _, fn: any in callback do
|
||||||
Spawn(fn, table.unpack(read))
|
Spawn(fn, table.unpack(read))
|
||||||
|
|
|
@ -306,11 +306,10 @@ function ServerProcess.start()
|
||||||
local function onServerNetworkReceive(player: Player, Identifier: buffer | string, data: buffer, ref: { any }?)
|
local function onServerNetworkReceive(player: Player, Identifier: buffer | string, data: buffer, ref: { any }?)
|
||||||
if not Identifier or typeof(Identifier) ~= "buffer" or not data or typeof(data) ~= "buffer" then return end
|
if not Identifier or typeof(Identifier) ~= "buffer" or not data or typeof(data) ~= "buffer" then return end
|
||||||
Identifier = Buffer.convert(Identifier :: buffer)
|
Identifier = Buffer.convert(Identifier :: buffer)
|
||||||
local idx: string = registeredIdentifier[Identifier]
|
if not registeredIdentifier[Identifier :: string] then return end
|
||||||
if not idx then return end
|
|
||||||
local read = Buffer.read(data, ref)
|
local read = Buffer.read(data, ref)
|
||||||
if not read then return end
|
if not read then return end
|
||||||
local callback = serverCallback[idx]
|
local callback = serverCallback[Identifier :: string]
|
||||||
if not callback then return end
|
if not callback then return end
|
||||||
for _, fn: any in callback do
|
for _, fn: any in callback do
|
||||||
Spawn(fn, player, table.unpack(read))
|
Spawn(fn, player, table.unpack(read))
|
||||||
|
|
Loading…
Reference in a new issue