2003-05-26 09:18:31 +00:00
|
|
|
/* NeoStats - IRC Statistical Services
|
2004-01-14 11:36:37 +00:00
|
|
|
** Copyright (c) 1999-2004 Adam Rutter, Justin Hammond
|
2002-09-04 08:40:29 +00:00
|
|
|
** http://www.neostats.net/
|
|
|
|
**
|
|
|
|
** Portions Copyright (c) 2000-2001 ^Enigma^
|
|
|
|
**
|
|
|
|
** 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
|
|
|
|
** the Free Software Foundation; either version 2 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** 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.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with this program; if not, write to the Free Software
|
|
|
|
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
** USA
|
|
|
|
**
|
|
|
|
** NeoStats CVS Identification
|
2003-09-22 15:04:15 +00:00
|
|
|
** $Id$
|
2000-02-03 23:45:51 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stats.h"
|
|
|
|
#include "dotconf.h"
|
2003-04-10 09:32:01 +00:00
|
|
|
#include "conf.h"
|
2000-03-29 13:05:57 +00:00
|
|
|
#include "dl.h"
|
2003-04-11 09:26:31 +00:00
|
|
|
#include "log.h"
|
2003-11-25 21:52:38 +00:00
|
|
|
#include "services.h"
|
The sql code is integrated with the conf file, socket code, and initilization portions so far.
its not yet setup to export any of NeoStats structs, but you can test with this release with the built in tables:
to test:
./configure --enable-sqlsrv
add a line to neostats.cfg:
SQLSRV_AUTH Fish!blah@127.0.0.*
(username Fish, pass blah, host 127.0.0.* (IP only, can use wildcards)
compile and start up NeoStats
Check for any errors about unable to bind to ports etc.... (if you need to run on a diff port, add SQLSRV_PORT <portnum> to the neostats.cfg
now that its running, from php/command line, connect to the BINDTO ip address (if using BINDTO) or 127.0.0.1 port 8888
eg: command line:
psql -U Fish -h localhost -p 8888
it should prompt with a password.
once connected, you can view available tables with:
"select * from rta_tables;"
some examples are:
"select * from pg_user;"
"select * from pg_conn;"
"select * from rta_stat;"
"select * from rta_dbg;"
"select * from rta_columns;"
Remember, only very basic SQL is supported
2003-12-11 15:37:05 +00:00
|
|
|
#ifdef SQLSRV
|
|
|
|
#include "sqlsrv/rta.h"
|
|
|
|
#endif
|
2000-02-03 23:45:51 +00:00
|
|
|
|
2003-07-30 13:58:22 +00:00
|
|
|
static void cb_Server (char *, int);
|
|
|
|
static void cb_Module (char *, int);
|
2003-12-16 14:05:19 +00:00
|
|
|
#ifdef SQLSRV
|
The sql code is integrated with the conf file, socket code, and initilization portions so far.
its not yet setup to export any of NeoStats structs, but you can test with this release with the built in tables:
to test:
./configure --enable-sqlsrv
add a line to neostats.cfg:
SQLSRV_AUTH Fish!blah@127.0.0.*
(username Fish, pass blah, host 127.0.0.* (IP only, can use wildcards)
compile and start up NeoStats
Check for any errors about unable to bind to ports etc.... (if you need to run on a diff port, add SQLSRV_PORT <portnum> to the neostats.cfg
now that its running, from php/command line, connect to the BINDTO ip address (if using BINDTO) or 127.0.0.1 port 8888
eg: command line:
psql -U Fish -h localhost -p 8888
it should prompt with a password.
once connected, you can view available tables with:
"select * from rta_tables;"
some examples are:
"select * from pg_user;"
"select * from pg_conn;"
"select * from rta_stat;"
"select * from rta_dbg;"
"select * from rta_columns;"
Remember, only very basic SQL is supported
2003-12-11 15:37:05 +00:00
|
|
|
static void cb_SqlConf (char *, int);
|
2003-12-16 14:05:19 +00:00
|
|
|
#endif
|
The sql code is integrated with the conf file, socket code, and initilization portions so far.
its not yet setup to export any of NeoStats structs, but you can test with this release with the built in tables:
to test:
./configure --enable-sqlsrv
add a line to neostats.cfg:
SQLSRV_AUTH Fish!blah@127.0.0.*
(username Fish, pass blah, host 127.0.0.* (IP only, can use wildcards)
compile and start up NeoStats
Check for any errors about unable to bind to ports etc.... (if you need to run on a diff port, add SQLSRV_PORT <portnum> to the neostats.cfg
now that its running, from php/command line, connect to the BINDTO ip address (if using BINDTO) or 127.0.0.1 port 8888
eg: command line:
psql -U Fish -h localhost -p 8888
it should prompt with a password.
once connected, you can view available tables with:
"select * from rta_tables;"
some examples are:
"select * from pg_user;"
"select * from pg_conn;"
"select * from rta_stat;"
"select * from rta_dbg;"
"select * from rta_columns;"
Remember, only very basic SQL is supported
2003-12-11 15:37:05 +00:00
|
|
|
|
2002-12-30 12:09:38 +00:00
|
|
|
/** @brief The list of modules to load
|
|
|
|
*/
|
2000-02-04 04:52:45 +00:00
|
|
|
static void *load_mods[NUM_MODULES];
|
2000-02-03 23:45:51 +00:00
|
|
|
|
2002-12-30 12:09:38 +00:00
|
|
|
/** @brief Core Configuration Items
|
|
|
|
*
|
|
|
|
* Contains Configuration Items for the Core NeoStats service
|
|
|
|
*/
|
2003-06-13 13:11:50 +00:00
|
|
|
static config_option options[] = {
|
|
|
|
{"SERVER_NAME", ARG_STR, cb_Server, 0},
|
|
|
|
{"SERVER_PORT", ARG_STR, cb_Server, 1},
|
|
|
|
{"CONNECT_TO", ARG_STR, cb_Server, 2},
|
|
|
|
{"CONNECT_PASS", ARG_STR, cb_Server, 3},
|
|
|
|
{"SERVER_INFOLINE", ARG_STR, cb_Server, 4},
|
|
|
|
{"STATSERV_NETNAME", ARG_STR, cb_Server, 5},
|
|
|
|
{"RECONNECT_TIME", ARG_STR, cb_Server, 6},
|
|
|
|
{"NEOSTAT_HOST", ARG_STR, cb_Server, 7},
|
|
|
|
{"NEOSTAT_USER", ARG_STR, cb_Server, 8},
|
|
|
|
{"WANT_PRIVMSG", ARG_STR, cb_Server, 9},
|
|
|
|
{"SERVICES_CHAN", ARG_STR, cb_Server, 10},
|
|
|
|
{"LOAD_MODULE", ARG_STR, cb_Module, 0},
|
|
|
|
{"ONLY_OPERS", ARG_STR, cb_Server, 11},
|
|
|
|
{"NO_LOAD", ARG_STR, cb_Server, 12},
|
2003-10-06 16:33:42 +00:00
|
|
|
{"BINDTO", ARG_STR, cb_Server, 13},
|
2003-10-13 11:20:40 +00:00
|
|
|
{"LOGFILENAMEFORMAT", ARG_STR, cb_Server, 14},
|
|
|
|
{"SERVER_NUMERIC", ARG_STR, cb_Server, 15},
|
2004-02-03 21:38:06 +00:00
|
|
|
{"SETSERVERTIMES", ARG_STR, cb_Server, 16},
|
The sql code is integrated with the conf file, socket code, and initilization portions so far.
its not yet setup to export any of NeoStats structs, but you can test with this release with the built in tables:
to test:
./configure --enable-sqlsrv
add a line to neostats.cfg:
SQLSRV_AUTH Fish!blah@127.0.0.*
(username Fish, pass blah, host 127.0.0.* (IP only, can use wildcards)
compile and start up NeoStats
Check for any errors about unable to bind to ports etc.... (if you need to run on a diff port, add SQLSRV_PORT <portnum> to the neostats.cfg
now that its running, from php/command line, connect to the BINDTO ip address (if using BINDTO) or 127.0.0.1 port 8888
eg: command line:
psql -U Fish -h localhost -p 8888
it should prompt with a password.
once connected, you can view available tables with:
"select * from rta_tables;"
some examples are:
"select * from pg_user;"
"select * from pg_conn;"
"select * from rta_stat;"
"select * from rta_dbg;"
"select * from rta_columns;"
Remember, only very basic SQL is supported
2003-12-11 15:37:05 +00:00
|
|
|
#ifdef SQLSRV
|
|
|
|
{"SQLSRV_AUTH", ARG_STR, cb_SqlConf, 0},
|
|
|
|
{"SQLSRV_PORT", ARG_STR, cb_SqlConf, 1},
|
|
|
|
#endif
|
2000-02-03 23:45:51 +00:00
|
|
|
};
|
|
|
|
|
2003-10-07 11:08:55 +00:00
|
|
|
/** @brief initialize the configuration parser
|
2002-12-26 15:15:04 +00:00
|
|
|
*
|
|
|
|
* Currently does nothing
|
|
|
|
*
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
|
|
|
|
2003-07-30 13:58:22 +00:00
|
|
|
void
|
|
|
|
init_conf ()
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2002-03-05 12:59:58 +00:00
|
|
|
}
|
2000-02-03 23:45:51 +00:00
|
|
|
|
2002-12-26 15:15:04 +00:00
|
|
|
/** @brief Load the Config file
|
|
|
|
*
|
|
|
|
* Parses the Configuration File and optionally loads the external authentication libary
|
|
|
|
*
|
|
|
|
* @returns Nothing
|
|
|
|
*/
|
|
|
|
|
2003-09-29 12:46:22 +00:00
|
|
|
int
|
2003-07-30 13:58:22 +00:00
|
|
|
ConfLoad ()
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2002-12-26 15:15:04 +00:00
|
|
|
/* Read in the Config File */
|
2003-07-30 13:58:22 +00:00
|
|
|
printf ("Reading the Config File. Please wait.....\n");
|
2003-10-06 16:33:42 +00:00
|
|
|
if (!config_read (CONFIG_NAME, options) == 0) {
|
2003-07-30 13:58:22 +00:00
|
|
|
printf ("***************************************************\n");
|
|
|
|
printf ("* Error! *\n");
|
|
|
|
printf ("* *\n");
|
|
|
|
printf ("* Config File not found, or Unable to Open *\n");
|
|
|
|
printf ("* Please check its Location, and try again *\n");
|
|
|
|
printf ("* *\n");
|
|
|
|
printf ("* NeoStats NOT Started *\n");
|
|
|
|
printf ("***************************************************\n");
|
2003-10-14 15:03:55 +00:00
|
|
|
return NS_FAILURE;
|
2002-12-26 15:15:04 +00:00
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
printf ("Sucessfully Loaded Config File, Now Booting NeoStats\n");
|
2003-04-21 10:30:37 +00:00
|
|
|
|
|
|
|
/* if all bots should join the chan */
|
2003-08-05 13:14:43 +00:00
|
|
|
if (GetConf ((void *) &me.allbots, CFGINT, "AllBotsJoinChan") <= 0) {
|
2003-04-21 10:30:37 +00:00
|
|
|
me.allbots = 0;
|
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
if (GetConf ((void *) &me.pingtime, CFGINT, "PingServerTime") <= 0) {
|
|
|
|
me.pingtime = 120;
|
|
|
|
}
|
2003-10-14 15:03:55 +00:00
|
|
|
return NS_SUCCESS;
|
2000-02-03 23:45:51 +00:00
|
|
|
}
|
2002-02-28 04:49:10 +00:00
|
|
|
|
|
|
|
|
2002-12-26 15:15:04 +00:00
|
|
|
/** @brief prepare Modules defined in the config file
|
|
|
|
*
|
|
|
|
* When the config file encounters directives to Load Modules, it calls this function which prepares to load the modules (but doesn't actually load them)
|
|
|
|
*
|
|
|
|
* @param arg the module name in this case
|
2003-10-07 14:26:21 +00:00
|
|
|
* @param configtype an index of what config item is currently being processed. Ignored
|
2002-12-26 15:15:04 +00:00
|
|
|
* @returns Nothing
|
|
|
|
*/
|
2003-07-30 13:58:22 +00:00
|
|
|
void
|
|
|
|
cb_Module (char *arg, int configtype)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2000-02-04 04:52:45 +00:00
|
|
|
int i;
|
2003-11-03 13:57:11 +00:00
|
|
|
|
2003-09-18 12:21:32 +00:00
|
|
|
SET_SEGV_LOCATION();
|
2003-06-13 13:11:50 +00:00
|
|
|
if (!config.modnoload) {
|
|
|
|
for (i = 1; (i < NUM_MODULES) && (load_mods[i] != 0); i++) {
|
2004-01-27 13:32:54 +00:00
|
|
|
if (!ircstrcasecmp (load_mods[i], arg)) {
|
2003-06-13 13:11:50 +00:00
|
|
|
return;
|
2000-02-04 04:52:45 +00:00
|
|
|
}
|
|
|
|
}
|
2003-07-30 13:58:22 +00:00
|
|
|
load_mods[i] = sstrdup (arg);
|
2003-12-04 15:47:53 +00:00
|
|
|
nlog (LOG_DEBUG1, LOG_CORE, "Added Module %d :%s", i, (char *)load_mods[i]);
|
2003-06-13 13:11:50 +00:00
|
|
|
}
|
2000-02-04 04:52:45 +00:00
|
|
|
}
|
|
|
|
|
The sql code is integrated with the conf file, socket code, and initilization portions so far.
its not yet setup to export any of NeoStats structs, but you can test with this release with the built in tables:
to test:
./configure --enable-sqlsrv
add a line to neostats.cfg:
SQLSRV_AUTH Fish!blah@127.0.0.*
(username Fish, pass blah, host 127.0.0.* (IP only, can use wildcards)
compile and start up NeoStats
Check for any errors about unable to bind to ports etc.... (if you need to run on a diff port, add SQLSRV_PORT <portnum> to the neostats.cfg
now that its running, from php/command line, connect to the BINDTO ip address (if using BINDTO) or 127.0.0.1 port 8888
eg: command line:
psql -U Fish -h localhost -p 8888
it should prompt with a password.
once connected, you can view available tables with:
"select * from rta_tables;"
some examples are:
"select * from pg_user;"
"select * from pg_conn;"
"select * from rta_stat;"
"select * from rta_dbg;"
"select * from rta_columns;"
Remember, only very basic SQL is supported
2003-12-11 15:37:05 +00:00
|
|
|
|
|
|
|
#ifdef SQLSRV
|
|
|
|
/** @brief prepare SqlAuthentication defined in the config file
|
|
|
|
*
|
|
|
|
* load the Sql UserName/Password and Host if we are using SQL Server option
|
|
|
|
*
|
|
|
|
* @param arg the module name in this case
|
|
|
|
* @param configtype an index of what config item is currently being processed. Ignored
|
|
|
|
* @returns Nothing
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
cb_SqlConf (char *arg, int configtype)
|
|
|
|
{
|
|
|
|
char *uname, *pass, *host;
|
|
|
|
SET_SEGV_LOCATION();
|
|
|
|
if (configtype == 0) {
|
|
|
|
if ((uname = strtok(arg, "!")) == NULL) {
|
|
|
|
nlog(LOG_WARNING, LOG_CORE, "Invalid SQLSRV_AUTH syntax in config file (Username)");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((pass = strtok(NULL, "@")) == NULL) {
|
|
|
|
nlog(LOG_WARNING, LOG_CORE, "Invalid SQLSRV_AUTH syntax in config file (Pass)");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((host = strtok(NULL, "")) == NULL) {
|
|
|
|
nlog(LOG_WARNING, LOG_CORE, "Invalid SQLSRV_AUTH syntax in config file (Host)");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
nlog(LOG_DEBUG1, LOG_CORE, "SqlSrv Uname %s Pass %s Host %s", uname, pass, host);
|
|
|
|
rta_change_auth(uname, pass);
|
|
|
|
strncpy(me.sqlhost, host, MAXHOST);
|
|
|
|
} else if (configtype == 1) {
|
|
|
|
me.sqlport = atoi(arg);
|
|
|
|
if (me.sqlport == 0) {
|
|
|
|
nlog(LOG_WARNING, LOG_CORE, "Invalid Port Specified for SQLSRV_PORT, Using Default");
|
|
|
|
me.sqlport = 8888;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
2002-12-26 15:15:04 +00:00
|
|
|
/** @brief Load the modules
|
|
|
|
*
|
|
|
|
* Actually load the modules that were found in the config file
|
|
|
|
*
|
|
|
|
* @returns 1 on success, -1 when a module failed to load
|
|
|
|
* @bugs if a single module fails to load, it stops trying to load any other modules
|
|
|
|
*/
|
|
|
|
|
2003-07-30 13:58:22 +00:00
|
|
|
int
|
2003-11-03 13:57:11 +00:00
|
|
|
ConfLoadModules ()
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
2000-02-04 04:52:45 +00:00
|
|
|
int i;
|
|
|
|
int rval;
|
2003-06-13 13:11:50 +00:00
|
|
|
|
2003-09-18 12:21:32 +00:00
|
|
|
SET_SEGV_LOCATION();
|
2004-01-12 20:40:59 +00:00
|
|
|
if(load_mods[1] == 0) {
|
2004-01-14 22:50:24 +00:00
|
|
|
nlog (LOG_NORMAL, LOG_CORE, "No modules configured for loading");
|
2004-01-12 20:40:59 +00:00
|
|
|
return NS_SUCCESS;
|
|
|
|
}
|
2003-09-29 12:46:22 +00:00
|
|
|
nlog (LOG_NORMAL, LOG_CORE, "Loading configured modules");
|
2003-06-13 13:11:50 +00:00
|
|
|
for (i = 1; (i < NUM_MODULES) && (load_mods[i] != 0); i++) {
|
2004-01-14 22:50:24 +00:00
|
|
|
nlog (LOG_DEBUG1, LOG_CORE, "ConfLoadModules: Loading Module %s", (char *)load_mods[i]);
|
2003-07-30 13:58:22 +00:00
|
|
|
rval = load_module (load_mods[i], NULL);
|
2003-11-03 13:57:11 +00:00
|
|
|
if (rval == NS_SUCCESS) {
|
2003-12-04 15:47:53 +00:00
|
|
|
nlog (LOG_NORMAL, LOG_CORE, "Successfully Loaded Module %s", (char *)load_mods[i]);
|
2000-02-04 04:52:45 +00:00
|
|
|
} else {
|
2003-12-04 15:47:53 +00:00
|
|
|
nlog (LOG_WARNING, LOG_CORE, "Could Not Load Module %s, Please check above error Messages", (char *)load_mods[i]);
|
2000-02-04 04:52:45 +00:00
|
|
|
}
|
2004-01-31 06:26:56 +00:00
|
|
|
free(load_mods[i]);
|
2000-02-04 04:52:45 +00:00
|
|
|
}
|
2003-09-29 12:46:22 +00:00
|
|
|
nlog (LOG_NORMAL, LOG_CORE, "Completed loading configured modules");
|
2004-01-12 20:40:59 +00:00
|
|
|
return NS_SUCCESS;
|
2000-02-03 23:45:51 +00:00
|
|
|
}
|
2002-12-26 15:15:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
/** @brief Process config file items
|
|
|
|
*
|
|
|
|
* Processes the config file and sets up the variables. No Error Checking is performed :(
|
|
|
|
*
|
|
|
|
* @param arg the variable value as a string
|
|
|
|
* @param configtype the index of the variable being called now
|
|
|
|
* @returns Nothing
|
|
|
|
*/
|
2003-11-03 13:57:11 +00:00
|
|
|
|
2003-07-30 13:58:22 +00:00
|
|
|
void
|
|
|
|
cb_Server (char *arg, int configtype)
|
2003-06-13 13:11:50 +00:00
|
|
|
{
|
|
|
|
if (configtype == 0) {
|
|
|
|
/* Server name */
|
2003-11-03 13:57:11 +00:00
|
|
|
strlcpy (me.name, arg, sizeof (me.name));
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 1) {
|
|
|
|
/* Server Port */
|
2003-07-30 13:58:22 +00:00
|
|
|
me.port = atoi (arg);
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 2) {
|
|
|
|
/* Connect To */
|
2003-11-03 13:57:11 +00:00
|
|
|
strlcpy (me.uplink, arg, sizeof (me.uplink));
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 3) {
|
|
|
|
/* Connect Pass */
|
2003-11-03 13:57:11 +00:00
|
|
|
strlcpy (me.pass, arg, sizeof (me.pass));
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 4) {
|
|
|
|
/* Server InfoLine */
|
2003-11-03 13:57:11 +00:00
|
|
|
strlcpy (me.infoline, arg, sizeof (me.infoline));
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 5) {
|
|
|
|
/* NetName */
|
2003-11-03 13:57:11 +00:00
|
|
|
strlcpy (me.netname, arg, sizeof (me.netname));
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 6) {
|
|
|
|
/* Reconnect time */
|
2003-07-30 13:58:22 +00:00
|
|
|
me.r_time = atoi (arg);
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 7) {
|
|
|
|
/* NeoStat Host */
|
2003-11-25 21:52:38 +00:00
|
|
|
strlcpy (me.host, arg, MAXHOST);
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 8) {
|
|
|
|
/* NeoStat User */
|
2003-11-25 21:52:38 +00:00
|
|
|
strlcpy (me.user, arg, MAXUSER);
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 9) {
|
|
|
|
me.want_privmsg = 1;
|
|
|
|
} else if (configtype == 10) {
|
2003-11-03 13:57:11 +00:00
|
|
|
strlcpy (me.chan, arg, sizeof (me.chan));
|
2003-06-13 13:11:50 +00:00
|
|
|
} else if (configtype == 11) {
|
|
|
|
me.onlyopers = 1;
|
|
|
|
} else if (configtype == 12) {
|
|
|
|
me.die = 1;
|
|
|
|
} else if (configtype == 13) {
|
2003-11-03 13:57:11 +00:00
|
|
|
strlcpy (me.local, arg, sizeof (me.local));
|
2003-10-06 16:33:42 +00:00
|
|
|
} else if (configtype == 14) {
|
2003-11-03 13:57:11 +00:00
|
|
|
strlcpy(LogFileNameFormat,arg,MAX_LOGFILENAME);
|
2003-10-13 11:20:40 +00:00
|
|
|
} else if (configtype == 15) {
|
|
|
|
me.numeric = atoi (arg);
|
|
|
|
/* limit value - really need to print error and quit */
|
|
|
|
if(me.numeric<=0)
|
|
|
|
me.numeric=1;
|
|
|
|
if(me.numeric>254)
|
|
|
|
me.numeric=254;
|
2004-02-03 21:38:06 +00:00
|
|
|
} else if (configtype == 16) {
|
|
|
|
me.setservertimes = atoi (arg);
|
|
|
|
/* Convert hours input to seconds */
|
|
|
|
me.setservertimes = me.setservertimes * 60 * 60;
|
|
|
|
/* limit value - really need to print error and quit */
|
2004-02-03 22:06:11 +00:00
|
|
|
if(me.setservertimes <= 0) {
|
|
|
|
me.setservertimes = (24 * 60 * 60);
|
|
|
|
}
|
2003-06-13 13:11:50 +00:00
|
|
|
}
|
2000-02-22 03:32:32 +00:00
|
|
|
|
2000-02-03 23:45:51 +00:00
|
|
|
}
|
|
|
|
|
2002-12-26 15:15:04 +00:00
|
|
|
/** @brief Rehash Function
|
|
|
|
*
|
|
|
|
* Called when we recieve a rehash signal. Does nothing atm
|
|
|
|
*
|
|
|
|
* @returns Nothing
|
|
|
|
*/
|
|
|
|
|
2003-07-30 13:58:22 +00:00
|
|
|
void
|
|
|
|
rehash ()
|
2000-02-03 23:45:51 +00:00
|
|
|
{
|
|
|
|
/* nothing, yet */
|
|
|
|
}
|