summaryrefslogtreecommitdiff
path: root/dbdkiosk.lua
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-07-26 10:33:26 -0500
committercheapie <cheapiephp@gmail.com>2026-07-26 10:33:26 -0500
commit924fbc78f755bcd2917334bd28519bb614babac0 (patch)
treebea203b215ba673813cccb648a90439656986237 /dbdkiosk.lua
parent37f50a76b7c8697d2766bdcfee71e019c20fa7c8 (diff)
downloadcelevator-924fbc78f755bcd2917334bd28519bb614babac0.tar
celevator-924fbc78f755bcd2917334bd28519bb614babac0.tar.gz
celevator-924fbc78f755bcd2917334bd28519bb614babac0.tar.bz2
celevator-924fbc78f755bcd2917334bd28519bb614babac0.tar.xz
celevator-924fbc78f755bcd2917334bd28519bb614babac0.zip
Check controller/dispatcher protection when connecting call buttons/kiosks
This prevents players from reaching locked floors by connecting their own call buttons
Diffstat (limited to 'dbdkiosk.lua')
-rw-r--r--dbdkiosk.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/dbdkiosk.lua b/dbdkiosk.lua
index 4d15403..4193cbf 100644
--- a/dbdkiosk.lua
+++ b/dbdkiosk.lua
@@ -77,6 +77,11 @@ function celevator.dbdkiosk.handlefields(pos,_,fields,player)
local carinfo = core.deserialize(celevator.storage:get_string(string.format("car%d",fields.carid)))
if not carinfo then return end
if not (carinfo.dispatcherpos and celevator.dispatcher.isdispatcher(carinfo.dispatcherpos)) then return end
+ if core.is_protected(carinfo.dispatcherpos,name) and not core.check_player_privs(name,{protection_bypass=true}) then
+ core.record_protection_violation(carinfo.dispatcherpos,name)
+ core.chat_send_player(name,S("Can't connect to a dispatcher you don't have access to."))
+ return
+ end
local dmem = core.deserialize(core.get_meta(carinfo.dispatcherpos):get_string("mem"))
if not dmem then return end
local floornames = dmem.params.floornames