/* Direct Query Server module for srvx 1.x
* Copyright 2006 Michael Poole <mdpoole@troilus.org>
*
- * This is PROPRIETARY, UNPUBLISHED code.
+ * This file is part of srvx.
*
- * This file is not part of srvx. The only logical reason for you to have
- * this file is to be working for GameSurge.
+ * srvx is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * If this is not the case, you should delete this copy and inform
- * Michael Poole <mdpoole@troilus.org> where you acquired it.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * The copyright notice above is not evidence that this code is, has been,
- * or ever will be publicly licensed.
+ * You should have received a copy of the GNU General Public License
+ * along with srvx; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "conf.h"
tmpline[--len] = '\0';
argc = split_line(tmpline, false, ArrayLength(argv), argv);
if (argc < 3) {
- ioset_printf(fd, "MISSING_ARGS");
+ ioset_printf(fd, "MISSING_ARGS\n");
return;
}
if (!strcmp(argv[1], "PASS")
client = calloc(1, sizeof(*client));
fd->data = client;
- fd->wants_reads = 1;
fd->line_reads = 1;
fd->readable_cb = qserver_readable;
fd->destroy_cb = qserver_destroy_fd;
if (getnameinfo((struct sockaddr*)&ss, sa_len, host, sizeof(host), NULL, 0, 0) != 0)
safestrncpy(host, ip, sizeof(host));
}
- client->user = AddLocalUser(nick, nick+1, host, "qserver dummy user", "*+i");
+ client->user = AddLocalUser(nick, nick+1, host, "qserver dummy user", "*+oi");
irc_pton(&client->user->ip, NULL, ip);
dict_insert(qserver_dict, client->user->nick, client);
node = conf_get_data("modules/qserver", RECDB_OBJECT);
if (!node)
return;
- str1 = database_get_data(node, "address", RECDB_QSTRING);
+ str1 = database_get_data(node, "bind_address", RECDB_QSTRING);
+ if (!str1)
+ str1 = database_get_data(node, "address", RECDB_QSTRING);
str2 = database_get_data(node, "port", RECDB_QSTRING);
if (!str2)
return;
{
unsigned int ii;
+ ioset_close(qserver_listener, 1);
for (ii = 0; ii < qserver_nbots; ++ii)
if (qserver_clients[ii])
DelUser(qserver_clients[ii]->user, NULL, 0, "module finalizing");