I wrote a gadget that lets authenticated users (so far only me, I haven't made a password option yet) kill all units on the map, kill all units belonging to a specific team, kill themselves if they are a player and kill all of a particular type of unit and prevent more from being created for the rest of the game (this is currently the most useful control).
Anyone, not just the host (even spectators!) can use the gadget if they know the password or can come up with a password that hashes to the same value. (I got a pure Lua version of CRC32 from the Internet, so the hash function isn't very secure

. Their version didn't work, so I modified it, but now the hash function isn't even a correct version of CRC32. It does, however, give different hashes for different passwords). As an example of what you can do with the gadget (if it is integrated into a map), suppose that the players are lagging because there are too many fighters on the screen. You could fix this using the following sequence of commands:
Code: Select all
/luarules ctrl_authenticate [password]
/luarules ctrl_genocide armap
/luarules ctrl_genocide armaap
/luarules ctrl_genocide corap
/luarules ctrl_genocide coraap
/luarules ctrl_genocide armfig
/luarules ctrl_genocide armhawk
/luarules ctrl_genocide corveng
/luarules ctrl_genocide corvamp
Lines 2 through 5 are not strictly necessary, but you don't want teams to build other air units when fighters are disabled.
I plan to add:
- A way to authenticate other users without giving them the password
- Forced unit transfer
- And more
EDIT: fixed gadget (before, I left ctrl_authenticate as _authenticate)