mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-08-29 04:01:32 +00:00
734f4651cb
Co-authored-by: DerEchteAlec <alec.schitzkat@luwan.io>
26 lines
838 B
Lua
26 lines
838 B
Lua
local provider_name = "rtx"
|
|
local resource_name = "rtx_housing"
|
|
|
|
Bridge.Housing.RegisterClientProvider(provider_name, {
|
|
execute = function(action, data)
|
|
if action ~= "toggle_lock" then
|
|
return false, "capability_unavailable"
|
|
end
|
|
if GetResourceState(resource_name) ~= "started" then
|
|
return false, "provider_unavailable"
|
|
end
|
|
if type(data) ~= "table" or type(data.providerId) ~= "string" then
|
|
return false, "invalid_request"
|
|
end
|
|
|
|
local result = Bridge.Callbacks.Trigger("sky_phone:housing:rtx:execute", {
|
|
action = action,
|
|
providerId = data.providerId,
|
|
})
|
|
if result and result.success then
|
|
return true
|
|
end
|
|
return false, result and result.error or "provider_rejected"
|
|
end,
|
|
})
|