ALTER TABLE `fundata` ADD INDEX ( `name` );
-- version: 7
+
+ALTER TABLE `bot_binds` ADD `botid` INT( 11 ) NOT NULL AFTER `botclass`;
+ALTER TABLE `bot_binds` ADD INDEX ( `botclass` );
+
+-- version: 8
\ No newline at end of file
}
}
-static void dummyserv_trigger_callback(struct ChanNode *chan, char *trigger) {
+static void dummyserv_trigger_callback(int clientid, struct ChanNode *chan, char *trigger) {
//this bot doesn't have a trigger
strcpy(trigger, "");
}
}
}
-static void neonhelp_trigger_callback(struct ChanNode *chan, char *trigger) {
+static void neonhelp_trigger_callback(int clientid, struct ChanNode *chan, char *trigger) {
MYSQL_RES *res;
MYSQL_ROW row;
loadChannelSettings(chan);
}
}
-static void neonserv_trigger_callback(struct ChanNode *chan, char *trigger) {
+static void neonserv_trigger_callback(int clientid, struct ChanNode *chan, char *trigger) {
MYSQL_RES *res;
MYSQL_ROW row;
loadChannelSettings(chan);
}
}
-static void neonspam_trigger_callback(struct ChanNode *chan, char *trigger) {
+static void neonspam_trigger_callback(int clientid, struct ChanNode *chan, char *trigger) {
MYSQL_RES *res;
MYSQL_ROW row;
loadChannelSettings(chan);
#include "ChanNode.h"
#include "ChanUser.h"
#include "version.h"
+#include "modcmd.h"
+#include "DBHelper.h"
#include "bot_NeonServ.h"
#include "bot_NeonSpam.h"
static struct cmd_bot_alias *bot_aliases = NULL;
+static void start_zero_bots() {
+ struct ClientSocket *client;
+ MYSQL_RES *res, *res2;
+ MYSQL_ROW row;
+
+ printf_mysql_query("SELECT `nick`, `ident`, `realname`, `server`, `port`, `pass`, `textbot`, `id`, `queue`, `ssl`, `bind` FROM `bots` WHERE `botclass` = '0' AND `active` = '1'");
+ res = mysql_use();
+
+ while ((row = mysql_fetch_row(res)) != NULL) {
+ client = create_socket(row[3], atoi(row[4]), row[10], row[5], row[0], row[1], row[2]);
+ client->flags |= (strcmp(row[6], "0") ? SOCKET_FLAG_PREFERRED : 0);
+ client->flags |= (strcmp(row[8], "0") ? SOCKET_FLAG_USE_QUEUE : 0);
+ client->flags |= (strcmp(row[9], "0") ? SOCKET_FLAG_SSL : 0);
+ client->botid = 0;
+ client->clientid = atoi(row[7]);
+ connect_socket(client);
+
+ printf_mysql_query("SELECT `command`, `function`, `parameters`, `global_access`, `chan_access` FROM `bot_binds` WHERE `botclass` = '0' AND `botid` = '%d'", client->clientid);
+ res2 = mysql_use();
+ while ((row = mysql_fetch_row(res2)) != NULL) {
+ if(bind_botwise_cmd_to_command(0, client->clientid, row[0], row[1])) {
+ if(row[2] && strcmp(row[2], "")) {
+ bind_botwise_set_parameters(0, client->clientid, row[0], row[2]);
+ }
+ if(row[3]) {
+ bind_botwise_set_global_access(0, client->clientid, row[0], atoi(row[3]));
+ }
+ if(row[4]) {
+ bind_botwise_set_channel_access(0, client->clientid, row[0], row[4]);
+ }
+ }
+ }
+ bind_botwise_unbound_required_functions(0, client->clientid);
+ }
+}
+
+static void zero_bots_trigger_callback(int clientid, struct ChanNode *chan, char *trigger) {
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ loadChannelSettings(chan);
+ if(!(chan->flags & CHANFLAG_CHAN_REGISTERED)) {
+ strcpy(trigger, "+");
+ return;
+ }
+ printf_mysql_query("SELECT `trigger` FROM `bot_channels` LEFT JOIN `bots` ON `botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '0' AND `botid` = '%d'", chan->channel_id, clientid);
+ res = mysql_use();
+ row = mysql_fetch_row(res);
+ strcpy(trigger, (strlen(row[0]) ? row[0] : "+"));
+}
+
void init_bots() {
init_NeonServ();
init_NeonSpam();
init_DummyServ();
init_NeonHelp();
+ start_zero_bots();
+ set_trigger_callback(0, zero_bots_trigger_callback);
+
MYSQL_RES *res;
MYSQL_ROW row;
//load all timed bans
CMD_BIND(global_cmd_bind) {
MYSQL_RES *res;
MYSQL_ROW row;
- printf_mysql_query("SELECT `function` FROM `bot_binds` WHERE `botclass` = '%d' AND `command` = '%s'", client->botid, escape_string(argv[0]));
+ if(client->botid == 0)
+ printf_mysql_query("SELECT `function` FROM `bot_binds` WHERE `botclass` = '%d' AND `botid` = '%d' AND `command` = '%s'", client->botid, client->clientid, escape_string(argv[0]));
+ else
+ printf_mysql_query("SELECT `function` FROM `bot_binds` WHERE `botclass` = '%d' AND `command` = '%s'", client->botid, escape_string(argv[0]));
res = mysql_use();
if ((row = mysql_fetch_row(res)) != NULL) {
reply(getTextBot(), user, "NS_BIND_ALREADY", argv[0], row[0]);
reply(getTextBot(), user, "NS_BIND_UNKNOWN", argv[1]);
return;
}
- bind_cmd_to_function(client->botid, argv[0], function);
- printf_mysql_query("INSERT INTO `bot_binds` (`botclass`, `command`, `function`, `parameters`) VALUES ('%d', '%s', '%s', '%s')", client->botid, escape_string(argv[0]), escape_string(argv[1]), params);
+ bind_botwise_cmd_to_function(client->botid, client->clientid, argv[0], function);
+ printf_mysql_query("INSERT INTO `bot_binds` (`botclass`, `botid`, `command`, `function`, `parameters`) VALUES ('%d', '%d', '%s', '%s', '%s')", client->botid, (client->botid == 0 ? client->clientid : 0), escape_string(argv[0]), escape_string(argv[1]), params);
if(*params)
- bind_set_parameters(client->botid, argv[0], params);
+ bind_botwise_set_parameters(client->botid, client->clientid, argv[0], params);
reply(getTextBot(), user, "NS_BIND_DONE", argv[0], function->name);
logEvent(event);
}
char *ident;
MYSQL_RES *res;
MYSQL_ROW row;
- struct cmd_binding *cbind = find_cmd_binding(client->botid, argv[0]);
+ struct cmd_binding *cbind = find_botwise_cmd_binding(client->botid, client->clientid, argv[0]);
if (!cbind) {
reply(getTextBot(), user, "NS_UNBIND_NOT_FOUND", argv[0]);
return;
struct cmd_binding *cbind;
int bindcount = 0;
for(cbind = getAllBinds(NULL); cbind; cbind = getAllBinds(cbind)) {
- if(cbind->botid == client->botid && !(cbind->func->flags & CMDFLAG_FUNCMD))
+ if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && !(cbind->func->flags & CMDFLAG_FUNCMD))
bindcount++;
}
struct cmd_binding *binds[bindcount];
bindcount = 0;
for(cbind = getAllBinds(NULL); cbind; cbind = getAllBinds(cbind)) {
- if(cbind->botid == client->botid && !(cbind->func->flags & CMDFLAG_FUNCMD))
+ if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && !(cbind->func->flags & CMDFLAG_FUNCMD))
binds[bindcount++] = cbind;
}
qsort(binds, bindcount, sizeof(struct cmd_binding *), global_cmd_commands_sort);
CMD_BIND(global_cmd_unbind) {
MYSQL_RES *res;
MYSQL_ROW row;
- struct cmd_binding *cbind = find_cmd_binding(client->botid, argv[0]);
- printf_mysql_query("SELECT `id`, `function` FROM `bot_binds` WHERE `botclass` = '%d' AND `command` = '%s'", client->botid, escape_string(argv[0]));
+ struct cmd_binding *cbind = find_botwise_cmd_binding(client->botid, client->clientid, argv[0]);
+ if(client->botid == 0)
+ printf_mysql_query("SELECT `id`, `function` FROM `bot_binds` WHERE `botclass` = '0' AND `botid` = '%d' AND `command` = '%s'", client->clientid, escape_string(argv[0]));
+ else
+ printf_mysql_query("SELECT `id`, `function` FROM `bot_binds` WHERE `botclass` = '%d' AND `command` = '%s'", client->botid, escape_string(argv[0]));
res = mysql_use();
if ((row = mysql_fetch_row(res)) == NULL && (!cbind || !(cbind->flags & CMDFLAG_TEMPONARY_BIND))) {
reply(getTextBot(), user, "NS_UNBIND_NOT_FOUND", argv[0]);
}
struct cmd_function *function = find_cmd_function(client->botid, row[1]);
if(function && (function->flags & CMDFLAG_REQUIRED)) {
- printf_mysql_query("SELECT `id` FROM `bot_binds` WHERE `botclass` = '%d' AND `function` = '%s'", client->botid, escape_string(function->name));
+ if(client->botid == 0)
+ printf_mysql_query("SELECT `id` FROM `bot_binds` WHERE `botclass` = '0' AND `botid` = '%d' AND `function` = '%s'", client->clientid, escape_string(function->name));
+ else
+ printf_mysql_query("SELECT `id` FROM `bot_binds` WHERE `botclass` = '%d' AND `function` = '%s'", client->botid, escape_string(function->name));
res = mysql_use();
if (mysql_num_rows(res) <= 1) {
reply(getTextBot(), user, "NS_UNBIND_REQUIRED", function->name);
return;
}
}
- unbind_cmd(client->botid, argv[0]);
+ unbind_botwise_cmd(client->botid, client->clientid, argv[0]);
if(!cbind || !(cbind->flags & CMDFLAG_TEMPONARY_BIND))
printf_mysql_query("DELETE FROM `bot_binds` WHERE `id` = '%s'", row[0]);
reply(getTextBot(), user, "NS_UNBIND_DONE", argv[0]);
return 26;
}
-struct ClientSocket* get_prefered_bot(int botid) {
+struct ClientSocket* get_botwise_prefered_bot(int botid, int clientid) {
struct ClientSocket *client, *lowbot = NULL;
for(client = getBots(SOCKET_FLAG_READY, NULL); client; client = getBots(SOCKET_FLAG_READY, client)) {
- if(client->botid == botid) {
+ if(client->botid == botid && (botid || clientid == client->clientid)) {
if((client->flags & SOCKET_FLAG_PREFERRED))
return client;
else
return lowbot;
}
-static char* get_channel_trigger(int botid, struct ChanNode *chan) {
+static char* get_channel_trigger(int botid, int clientid, struct ChanNode *chan) {
struct trigger_cache *trigger;
for(trigger = chan->trigger; trigger; trigger = trigger->next) {
- if(trigger->botid == botid)
+ if(trigger->botid == botid && (botid || trigger->clientid == clientid))
return trigger->trigger;
}
struct trigger_callback *cb;
}
char triggerStr[TRIGGERLEN];
if(cb)
- cb->func(chan, triggerStr);
+ cb->func(clientid, chan, triggerStr);
else
- strcpy(triggerStr, "+");
+ triggerStr[0] = '\0';
trigger = malloc(sizeof(*trigger));
if (!trigger) {
perror("malloc() failed");
return 0;
}
trigger->botid = botid;
+ trigger->clientid = clientid;
trigger->trigger = (triggerStr[0] ? strdup(triggerStr) : NULL);
trigger->next = chan->trigger;
chan->trigger = trigger;
}
struct cmd_binding *cbind;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == client->botid && stricmp(cbind->cmd, message) == 0) {
+ if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && stricmp(cbind->cmd, message) == 0) {
if(cbind->func->func == modcmd_linker) {
//links subcommands
char command[MAXLEN];
}
sprintf(command, "%s %s", parent_bind->cmd, subcmd);
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == client->botid && stricmp(cbind->cmd, command) == 0)
+ if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && stricmp(cbind->cmd, command) == 0)
break;
}
if(!cbind)
char subcommands[MAXLEN];
int subcompos = 0;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == client->botid && stricmplen(cbind->cmd, command, commandlen) == 0) {
+ if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && stricmplen(cbind->cmd, command, commandlen) == 0) {
subcompos += sprintf(subcommands + subcompos, (subcompos ? ", %s" : "%s"), cbind->cmd + commandlen);
}
}
chan = sent_chan;
}
//get a text bot
- tmp_text_client = get_prefered_bot(client->botid);
+ tmp_text_client = get_botwise_prefered_bot(client->botid, (client->botid == 0 ? client->clientid : 0));
//parse the arguments...
char *arga[MAXNUMPARAMS];
char **argv;
}
static void got_chanmsg(struct UserNode *user, struct ChanNode *chan, char *message) {
- fd_set fds;
+ fd_set fds, fds2;
char *trigger;
struct ClientSocket *client;
FD_ZERO(&fds);
+ FD_ZERO(&fds2);
for(client = getBots(SOCKET_FLAG_READY, NULL); client; client = getBots(SOCKET_FLAG_READY, client)) {
- if(isUserOnChan(client->user, chan) && (client->flags & SOCKET_FLAG_PREFERRED) && !FD_ISSET(client->botid, &fds)) {
- FD_SET(client->botid, &fds);
- trigger = get_channel_trigger(client->botid, chan);
+ if(isUserOnChan(client->user, chan) && (client->flags & SOCKET_FLAG_PREFERRED) && ((client->botid == 0 && !FD_ISSET(client->clientid, &fds)) || (client->botid && !FD_ISSET(client->botid, &fds2)))) {
+ FD_SET(client->clientid, &fds);
+ FD_SET(client->botid, &fds2);
+ trigger = get_channel_trigger(client->botid, client->clientid, chan);
if(trigger && stricmplen(message, trigger, strlen(trigger)) == 0) {
handle_command(client, user, chan, message + strlen(trigger));
}
}
}
for(client = getBots(SOCKET_FLAG_READY, NULL); client; client = getBots(SOCKET_FLAG_READY, client)) {
- if(isUserOnChan(client->user, chan) && !FD_ISSET(client->botid, &fds)) {
+ if(isUserOnChan(client->user, chan) && ((client->botid == 0 && !FD_ISSET(client->clientid, &fds)) || (client->botid && !FD_ISSET(client->botid, &fds2)))) {
FD_SET(client->botid, &fds);
- trigger = get_channel_trigger(client->botid, chan);
+ FD_SET(client->botid, &fds2);
+ trigger = get_channel_trigger(client->botid, client->clientid, chan);
if(trigger && stricmplen(message, trigger, strlen(trigger)) == 0) {
handle_command(client, user, chan, message + strlen(trigger));
}
return 1;
}
-int changeChannelTrigger(int botid, struct ChanNode *chan, char *new_trigger) {
+int changeBotwiseChannelTrigger(int botid, int clientid, struct ChanNode *chan, char *new_trigger) {
struct trigger_cache *trigger;
for(trigger = chan->trigger; trigger; trigger = trigger->next) {
- if(trigger->botid == botid) {
+ if(trigger->botid == botid && (botid || trigger->clientid == clientid)) {
free(trigger->trigger);
trigger->trigger = strdup(new_trigger);
return 1;
return 0;
}
-int bind_cmd_to_function(int botid, char *cmd, struct cmd_function *func) {
+int bind_botwise_cmd_to_function(int botid, int clientid, char *cmd, struct cmd_function *func) {
int bind_index = get_binds_index(cmd[0]);
struct cmd_binding *cbind;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == botid && strcmp(cbind->cmd, cmd) == 0)
+ if(((botid && cbind->botid == botid) || (botid == 0 && clientid == cbind->clientid)) && strcmp(cbind->cmd, cmd) == 0)
return 0;
}
cbind = malloc(sizeof(*cbind));
return 0;
}
cbind->botid = botid;
+ cbind->clientid = clientid;
cbind->cmd = strdup(cmd);
cbind->func = func;
cbind->paramcount = 0;
return 1;
}
-int bind_cmd_to_command(int botid, char *cmd, char *func) {
+int bind_botwise_cmd_to_command(int botid, int clientid, char *cmd, char *func) {
struct cmd_function *cmdfunc;
int fbotid = botid;
char *c;
int bind_index = get_binds_index(cmd[0]);
struct cmd_binding *cbind;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == botid && strcmp(cbind->cmd, cmd) == 0)
+ if(((botid && cbind->botid == botid) || (botid == 0 && clientid == cbind->clientid)) && strcmp(cbind->cmd, cmd) == 0)
return 0;
}
cbind = malloc(sizeof(*cbind));
return 0;
}
cbind->botid = botid;
+ cbind->clientid = clientid;
cbind->cmd = strdup(cmd);
cbind->func = cmdfunc;
cbind->next = cmd_binds[bind_index];
return 1;
}
-int unbind_cmd(int botid, char *cmd) {
+int unbind_botwise_cmd(int botid, int clientid, char *cmd) {
int bind_index = get_binds_index(cmd[0]);
struct cmd_binding *cbind, *last = NULL;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == botid && strcmp(cbind->cmd, cmd) == 0) {
+ if(cbind->botid == botid && (botid || clientid == cbind->clientid) && strcmp(cbind->cmd, cmd) == 0) {
if(last)
last->next = cbind->next;
else
bot_aliases = NULL;
}
-void bind_set_parameters(int botid, char *cmd, char *parameters) {
+void bind_botwise_set_parameters(int botid, int clientid, char *cmd, char *parameters) {
int bind_index = get_binds_index(cmd[0]);
struct cmd_binding *cbind;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == botid && strcmp(cbind->cmd, cmd) == 0) {
+ if(cbind->botid == botid && (botid || clientid == cbind->clientid) && strcmp(cbind->cmd, cmd) == 0) {
if(cbind->paramcount) {
int i;
for(i = 0; i < cbind->paramcount; i++)
}
}
-void bind_set_global_access(int botid, char *cmd, int gaccess) {
+void bind_botwise_set_global_access(int botid, int clientid, char *cmd, int gaccess) {
int bind_index = get_binds_index(cmd[0]);
struct cmd_binding *cbind;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == botid && strcmp(cbind->cmd, cmd) == 0) {
+ if(cbind->botid == botid && (botid || clientid == cbind->clientid) && strcmp(cbind->cmd, cmd) == 0) {
if(gaccess > -1) {
cbind->global_access = gaccess;
cbind->flags |= CMDFLAG_OVERRIDE_GLOBAL_ACCESS;
}
}
-void bind_set_channel_access(int botid, char *cmd, char *chanaccess) {
+void bind_botwise_set_channel_access(int botid, int clientid, char *cmd, char *chanaccess) {
int bind_index = get_binds_index(cmd[0]);
struct cmd_binding *cbind;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == botid && strcmp(cbind->cmd, cmd) == 0) {
+ if(cbind->botid == botid && (botid || clientid == cbind->clientid) && strcmp(cbind->cmd, cmd) == 0) {
if(cbind->channel_access)
free(cbind->channel_access);
if(chanaccess) {
}
}
-struct cmd_binding *find_cmd_binding(int botid, char *cmd) {
+struct cmd_binding *find_botwise_cmd_binding(int botid, int clientid, char *cmd) {
int bind_index = get_binds_index(cmd[0]);
struct cmd_binding *cbind;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
- if(cbind->botid == botid && strcmp(cbind->cmd, cmd) == 0) {
+ if(cbind->botid == botid && (botid || clientid == cbind->clientid) && strcmp(cbind->cmd, cmd) == 0) {
return cbind;
}
}
return NULL;
}
-void bind_unbound_required_functions(int botid) {
+void bind_botwise_unbound_required_functions(int botid, int clientid) {
struct cmd_function *cmdfunc;
int i, found;
struct cmd_binding *cbind;
found = 0;
for(i = 0; i < 27; i++) {
for(cbind = cmd_binds[i]; cbind; cbind = cbind->next) {
- if(cbind->botid == botid && cbind->func == cmdfunc) {
+ if(cbind->botid == botid && (botid || clientid == cbind->clientid) && cbind->func == cmdfunc) {
found = 1;
break;
}
if(found)
break;
}
- if(!found && bind_cmd_to_function(botid, cmdfunc->name, cmdfunc)) {
- cbind = find_cmd_binding(botid, cmdfunc->name);
+ if(!found && bind_botwise_cmd_to_function(botid, clientid, cmdfunc->name, cmdfunc)) {
+ cbind = find_botwise_cmd_binding(botid, clientid, cmdfunc->name);
cbind->flags |= CMDFLAG_TEMPONARY_BIND;
}
}
#define CMD_BIND(NAME) void NAME(UNUSED_ARG(struct ClientSocket *client), UNUSED_ARG(struct UserNode *user), UNUSED_ARG(struct ChanNode *chan), UNUSED_ARG(char **argv), UNUSED_ARG(char argc), UNUSED_ARG(struct Event *event))
typedef void cmd_bind_t(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, char **argv, char argc, struct Event *event);
-typedef void trigger_callback_t(struct ChanNode *chan, char *trigger);
+typedef void trigger_callback_t(int clientid, struct ChanNode *chan, char *trigger);
struct cmd_function {
char *name;
struct cmd_binding {
char *cmd;
int botid;
+ int clientid;
struct cmd_function *func;
unsigned int flags;
char *parameters[MAXPARAMETERS];
struct trigger_cache {
int botid;
+ int clientid;
char *trigger;
struct trigger_cache *next;
void init_modcmd();
void free_modcmd();
-struct ClientSocket* get_prefered_bot(int botid);
+
+#define get_prefered_bot(BOTID) get_botwise_prefered_bot(BOTID, 0)
+struct ClientSocket* get_botwise_prefered_bot(int botid, int clientid);
+
int register_command(int botid, char *name, cmd_bind_t *func, int paramcount, char *channel_access, int global_access, unsigned int flags);
int set_trigger_callback(int botid, trigger_callback_t *func);
-int changeChannelTrigger(int botid, struct ChanNode *chan, char *new_trigger);
-int bind_cmd_to_function(int botid, char *cmd, struct cmd_function *func);
-int bind_cmd_to_command(int botid, char *cmd, char *func);
-int unbind_cmd(int botid, char *cmd);
+
+#define changeChannelTrigger(BOTID,CHAN,NEW) changeBotwiseChannelTrigger(BOTID, 0, CHAN, NEW)
+int changeBotwiseChannelTrigger(int botid, int clientid, struct ChanNode *chan, char *new_trigger);
+
+#define bind_cmd_to_function(BOTID,CMD,FUNC) bind_botwise_cmd_to_function(BOTID, 0, CMD, FUNC)
+int bind_botwise_cmd_to_function(int botid, int clientid, char *cmd, struct cmd_function *func);
+
+#define bind_cmd_to_command(BOTID,CMD,FUNC) bind_botwise_cmd_to_command(BOTID, 0, CMD, FUNC)
+int bind_botwise_cmd_to_command(int botid, int clientid, char *cmd, char *func);
+
+#define unbind_cmd(BOTID,CMD) unbind_botwise_cmd(BOTID, 0, CMD)
+int unbind_botwise_cmd(int botid, int clientid, char *cmd);
+
+#define bind_set_parameters(BOTID,CMD,PARAMETERS) bind_botwise_set_parameters(BOTID, 0, CMD, PARAMETERS)
+void bind_botwise_set_parameters(int botid, int clientid, char *cmd, char *parameters);
+
+#define bind_set_global_access(BOTID,CMD,GACCESS) bind_botwise_set_global_access(BOTID, 0, CMD, GACCESS)
+void bind_botwise_set_global_access(int botid, int clientid, char *cmd, int gaccess);
+
+#define bind_set_channel_access(BOTID,CMD,CACCESS) bind_botwise_set_channel_access(BOTID, 0, CMD, CACCESS)
+void bind_botwise_set_channel_access(int botid, int clientid, char *cmd, char *chanaccess);
+
+#define find_cmd_binding(BOTID,CMD) find_botwise_cmd_binding(BOTID, 0, CMD)
+struct cmd_binding *find_botwise_cmd_binding(int botid, int clientid, char *cmd);
+
+#define bind_unbound_required_functions(BOTID) bind_botwise_unbound_required_functions(BOTID, 0)
+void bind_botwise_unbound_required_functions(int botid, int clientid);
+
struct cmd_function *find_cmd_function(int botid, char *name);
struct ClientSocket *getTextBot();
-void bind_set_parameters(int botid, char *cmd, char *parameters);
-void bind_set_global_access(int botid, char *cmd, int gaccess);
-void bind_set_channel_access(int botid, char *cmd, char *chanaccess);
-struct cmd_binding *find_cmd_binding(int botid, char *cmd);
-void bind_unbound_required_functions(int botid);
-
void register_command_alias(int botid, char *alias);
struct cmd_binding *getAllBinds(struct cmd_binding *last);
*/
#include "mysqlConn.h"
-#define DATABASE_VERSION "7"
+#define DATABASE_VERSION "8"
struct used_result {
MYSQL_RES *result;