SmartCMD icon indicating copy to clipboard operation
SmartCMD copied to clipboard

new defines for return values of the callbacks

Open YashasSamaga opened this issue 7 years ago • 0 comments

There is CMD_SUCCESS and CMD_FAILURE which are expected to be used as return values in the command functions.

These definitions don't quite make sense for use in the OnPlayerCommandReceived callback. I was considering adding new defines specifically to serve the purpose of the return values in those callbacks because the existing defines are confusing (and returning numbers are bad as always).

My Proposal:

  • OnPlayerCommandReceived CMD_IGNORE - tells the command processor to ignore the command, i.e: command won't be executed and won't be forwarded to other scripts as well

    CMD_PROCESS - tells the command processor to go ahead and execute the command if it is in the current script or otherwise forward it to other scripts

  • OnPlayerCommandPerformed CMD_SUCCESS and CMD_FAILURE make sort of sense for this callback. Hence, I believe dedicated new defines aren't needed for the return values of this callback.

Opinions:

Anyone can come up with their own proposal or offer suggestions/opinions on proposals.

YashasSamaga avatar May 27 '18 13:05 YashasSamaga