Middlewares are ran before the event is fired which makes it a great tool for validation, data manipulation and debugging.
_Io_RegisterMiddleware($sEventName, $fCallback)
| True if middleware registrered with success. |
Set $sEventName to * to trigger the middleware on every event. The $fCallback must be a valid function and the function MUST have these params (const $socket, ByRef $params, const $sEventName, ByRef $fCallbackName) and return true or false. False prevents the event from being fired.