VATSIM-UK / web-squawk-gen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimise duplication

A-Lawrence opened this issue · comments

To minimise the duplicate of squawks, it'd be useful to ensure that squawk codes aren't allocated within a set period of one another.

Achieving this can be as simple as storing the last time the squawk was generated and then coming up some logic to avoid showing squawks that have recently been generated, too.

How would we prevent abuse of this?
There needs to be something in place to ensure that a user/users can't just spam the button and block off a range (or more) of squawks.

The way I see it, we have 3 options:

  1. Add another button saying "Squawk Code Assigned". Controllers click this after they have issued it to an aircraft. The button's action then proceeds to perform the necessary logic to block of that squawk. Requires more effort from the controller as they need to remember to click it.
  2. Some kind of cooldown is implemented, but this could be a bit unreliable; do we watch for too many button clicks in a space of time? etc.
  3. Combination of both?

Thoughts?