/* cmd_global_setbot.c - NeonServ v5.3
- * Copyright (C) 2011 Philipp Kreil (pk910)
+ * Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
reply(getTextBot(), user, "NS_SETBOT_SETTING", argv[1]);
}
if(log_event) {
+ if(!stricmp(argv[1], "serverpass") && value) { //censor server password
+ char cmd_args[MAXLEN];
+ sprintf(cmd_args, "%d SERVERPASS ***", botid);
+ free(event->arguments);
+ event->arguments = strdup(cmd_args);
+ }
logEvent(event);
}
} else {
char *val = bot[4];
int ret = 0;
if(value) {
+ if(!strcmp(value, "*"))
+ value = "";
struct ClientSocket *client;
for(client = getBots(0, NULL); client; client = getBots(0, client)) {
if(client->clientid == atoi(bot[15])) {
if(client->pass)
free(client->pass);
- client->pass = strdup(value);
+ client->pass = (value ? strdup(value) : NULL);
if(client->flags & SOCKET_FLAG_READY)
reply(getTextBot(), user, "NS_SETBOT_NEED_RESTART");
break;
break;
}
}
- printf_mysql_query("UPDATE `bots` SET `queue` = '%d' WHERE `id` = '%s'", val, bot[15]);
+ printf_mysql_query("UPDATE `bots` SET `prefered` = '%d' WHERE `id` = '%s'", val, bot[15]);
ret = 1;
}
reply(getTextBot(), user, "\002PREFERED \002 %s", get_language_string(user, (val ? "NS_SET_ON" : "NS_SET_OFF")));