control_pre_command

March 26, 2020 Contributors

Name

control_pre_command — This hook point occurs prior to the execution of a console command

Synopsis

#include "hooks/core/control_pre_command.h"

| int **core_control_pre_command** ( | closure, |   |
|   | cc, |   |
|   | response); |   |

void * <var class="pdparam">closure</var>;
command_construct * <var class="pdparam">cc</var>;
string * <var class="pdparam">response</var>;

Description

Given the command console parameter, hooks registered here can perform tasks prior to the built-in console commands, or even bypass the built-in commands completely. For a complete list of the console commands see Console Commands.

Parameters

closure

A pointer to the closure function.

cc

For a description of this data type see command_construct.

response

This option provides output handed back to the console client. For a description of this data type see string. This parameter is optional.

Return Values

Return 1 to skip the default command behavior; any additional pre_command hooks will also be skipped. Return 0 to allow the default command behavior (and any other pre_command hooks) to continue.

Threading

This hook will be called in the Scheduler thread.

See Also

control_shutdown_ex