and a theoretical (AKA I actually do this) is I join players to classes that overwrite default functions, pass the callstack to a DB NPC that removes the player from that class and does intended behavior and re-joins them.
This scheme is a house of cards just waiting to collapse
Other solutions are a sort of nightmare scenario like monitoring the accounts folder for file modification times (there are hundreds of thousands of account files on UN) and require far too many resources for far too little benefit