Through chaining of interrupts, it is easy to flood the server with
interrupts. For instance, in trap city, interrupts piled up on an info
system, since each interrupt launched a new one. This should be
mitigated by adding a kind of interrupt that makes sure it is the only
interrupt of its kind.
Also, this is a security risk that is trivially exploitable: just have a
luaatc component launch two interrupts on itself, which should quickly
grind the server to a halt.
A safe alternative is the schedule() call provided by advtrains_lines.
It currently only allows a single interrupt to be issued.
Quick poll: It would be reasonable to also restrict interrupt() to one
interrupt at a time. If there is any setup that would break when
implementing this, please answer.
> Quick poll: It would be reasonable to also restrict interrupt() to one
> interrupt at a time. If there is any setup that would break when
> implementing this, please answer.
Probably a cancel_interrupts() call would be better for dead-end code
branches, or also safe_interrupt() which only runs if there is no other
interrupt at the position.
Implemented as per proposal as interrupt_safe() and cancel_interrupts().