Check plugin API version in UCMD plugin.

This commit is contained in:
Blair Bonnett 2012-08-14 11:48:08 +12:00
parent a95e703b36
commit a12e79c7ce

View File

@ -483,6 +483,13 @@ int parse_config(struct plugin_handle* plugin, const char* config)
int plugin_register(struct plugin_handle *plugin, const char *config){
PLUGIN_INITIALIZE(plugin, "User command plugin", "0.1", "Provide custom commands to users.");
/* Need version 2 or later of the plugin API. */
if(plugin->plugin_api_version < 2)
{
plugin->error_msg = "UCMD support requires version 2 or later of the plugin API";
return -1;
}
/* Attempt to parse the config we were given. */
if(parse_config(plugin, config) == -1) return -1;