mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
25 lines
470 B
Ruby
25 lines
470 B
Ruby
class IMICFPS
|
|
module Scripting
|
|
class SandBox
|
|
include Scripting
|
|
def initialize(entity:, script:)
|
|
@entity = entity
|
|
@script = script.name
|
|
|
|
execute(script.source) if source_safe?(script.source)
|
|
end
|
|
|
|
def source_safe?(source)
|
|
true # TODO: implement whitelisting/safety checks
|
|
end
|
|
|
|
def execute(source)
|
|
instance_eval(source)
|
|
end
|
|
|
|
def entity
|
|
@entity
|
|
end
|
|
end
|
|
end
|
|
end |