fix configfile

This commit is contained in:
Olaf Rempel 2007-04-17 14:27:25 +02:00
parent be2726a22f
commit 521a911110
2 changed files with 12 additions and 9 deletions

View File

@ -34,6 +34,9 @@
#include "server.h"
#include "plugin.h"
#define DEFAULT_CONFIG "hlswmaster.conf"
#define DEFAULT_LOGFILE "hlswmaster.log"
static struct option opts[] = {
{"config", 1, 0, 'c'},
{"user", 1, 0, 'u'},
@ -45,7 +48,7 @@ static struct option opts[] = {
int main(int argc, char *argv[])
{
int arg = 0, code = 0, debug = 0;
char *config = NULL, *user = NULL, *logfile;
char *config = DEFAULT_CONFIG, *user = NULL, *logfile;
while (code != -1) {
code = getopt_long(argc, argv, "c:u:dh", opts, &arg);
@ -102,7 +105,7 @@ int main(int argc, char *argv[])
exit(-1);
/* check logfile */
logfile = config_get_string("global", "logfile", "hlswmaster.log");
logfile = config_get_string("global", "logfile", DEFAULT_LOGFILE);
if (logfile && !debug) {
/* start logging */
if (!log_init(logfile))

View File

@ -1,18 +1,18 @@
[global]
## broadcast scan source IP & PORT (udp)
#scanner_src 0.0.0.0:7130
scanner_src 0.0.0.0:7130
## broadcast scan every X seconds
#scan_interval 60
scan_interval 60
## serverlist rebuild every X seconds
#serverlist_refresh 5
serverlist_refresh 5
## server timeout after X seconds
#serverlist_timeout 180
serverlist_timeout 180
## master answers with this source IP
#master_src 0.0.0.0:7140
master_src 0.0.0.0:7140
plugin_dir plugins
plugin d3engine.so
@ -25,11 +25,11 @@ plugin quake2.so
plugin ut2k4.so
## logging
#logfile hlswmaster.log
logfile hlswmaster.log
[gamespy1]
## internal fragment-list timeout
#gc_timeout 90
gc_timeout 90
[hlswproxy]
## ask these hlswmasters