This should work but causes one side effect because of how event callback system works, it might be desired outcome or it might not be.
Returning anything that is not nil from event callback will stop processing any further events and returns immediately.
Example:
return true allows player to join, check passed. Any other queueued before_join callback functions will be canceled.
return false disallows player to join, check passed. Any other queueued before_join callback functions will be canceled.
return nil (or just return) proceeds to process next callback registered for before_join, wont affect success value and another callback can make decision.
Whole list of callbacks exhausted, everything that was registered for before_join called and all did return nil. Check succeed and player is allowed to proceed (default behavior).
This probably does not really affect anything (or at least anything important) but might affect possible future things added to chain, should probably document these things properly...
Urelated but if returned thing is string then that string will be sent as chat message to player (actually to first function argument) who executed command.
This should work but causes one side effect because of how event callback system works, it might be desired outcome or it might not be. Returning anything that is not
nil
from event callback will stop processing any further events and returns immediately.Example:
return true
allows player to join, check passed. Any other queueuedbefore_join
callback functions will be canceled.return false
disallows player to join, check passed. Any other queueuedbefore_join
callback functions will be canceled.return nil
(or justreturn
) proceeds to process next callback registered forbefore_join
, wont affect success value and another callback can make decision.before_join
called and all didreturn nil
. Check succeed and player is allowed to proceed (default behavior).This probably does not really affect anything (or at least anything important) but might affect possible future things added to chain, should probably document these things properly...
Urelated but if returned thing is string then that string will be sent as chat message to player (actually to first function argument) who executed command.