mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
@@ -47,10 +47,10 @@ local function triggerServerCallback(_, event, delay, cb, ...)
|
|||||||
events[key] = nil
|
events[key] = nil
|
||||||
|
|
||||||
if promise then
|
if promise then
|
||||||
return promise:resolve(response or {})
|
return promise:resolve(response and { msgpack.unpack(response) } or {})
|
||||||
end
|
end
|
||||||
|
|
||||||
return cb and cb(table.unpack(response or {}))
|
return cb and cb(msgpack.unpack(response))
|
||||||
end
|
end
|
||||||
|
|
||||||
if promise then
|
if promise then
|
||||||
@@ -79,7 +79,7 @@ local function callbackResponse(success, result, ...)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return { result, ... }
|
return msgpack.pack(result, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
local pcall = pcall
|
local pcall = pcall
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ local function triggerClientCallback(_, event, playerId, cb, ...)
|
|||||||
events[key] = nil
|
events[key] = nil
|
||||||
|
|
||||||
if promise then
|
if promise then
|
||||||
return promise:resolve(response or {})
|
return promise:resolve(response and { msgpack.unpack(response) } or {})
|
||||||
end
|
end
|
||||||
|
|
||||||
return cb and cb(table.unpack(response or {}))
|
return cb and cb(msgpack.unpack(response))
|
||||||
end
|
end
|
||||||
|
|
||||||
if promise then
|
if promise then
|
||||||
@@ -60,7 +60,7 @@ local function callbackResponse(success, result, ...)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return { result, ... }
|
return msgpack.pack(result, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
local pcall = pcall
|
local pcall = pcall
|
||||||
|
|||||||
Reference in New Issue
Block a user