summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorDennis Friis <peavey@inspircd.org>2009-07-07 00:52:08 +0200
committerDennis Friis <peavey@inspircd.org>2009-07-07 00:55:31 +0200
commit4673fd3ca06010e74f8223486b0f34e58c7b0a7e (patch)
treecfcc97752fd770eb1befa295e16f7aa4a2607ca9 /src/map/script.c
parent03b5e644857f80a23bd8b856b78a10cf0a564a66 (diff)
downloadtmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.gz
tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.bz2
tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.xz
tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.zip
Fixes to socket system to make it cope better with fd depletion.
Also added timeout for fullconnect, secured map server from stateless connections.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 94f03f7..218c3f3 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -1090,7 +1090,7 @@ static void read_constdb(void)
char line[1024],name[1024];
int val,n,i,type;
- fp=fopen("db/const.txt","r");
+ fp=fopen_("db/const.txt","r");
if(fp==NULL){
printf("can't read db/const.txt\n");
return ;
@@ -1111,7 +1111,7 @@ static void read_constdb(void)
str_data[n].val=val;
}
}
- fclose(fp);
+ fclose_(fp);
}
/*==========================================
@@ -6549,7 +6549,7 @@ static int script_load_mapreg()
FILE *fp;
char line[1024];
- if( (fp=fopen(mapreg_txt,"rt"))==NULL )
+ if( (fp=fopen_(mapreg_txt,"rt"))==NULL )
return -1;
while(fgets(line,sizeof(line),fp)){
@@ -6576,7 +6576,7 @@ static int script_load_mapreg()
numdb_insert(mapreg_db,(i<<24)|s,v);
}
}
- fclose(fp);
+ fclose_(fp);
mapreg_dirty=0;
return 0;
}
@@ -6666,7 +6666,7 @@ int script_config_read(char *cfgName)
script_config.check_cmdcount=8192;
script_config.check_gotocount=512;
- fp=fopen(cfgName,"r");
+ fp=fopen_(cfgName,"r");
if(fp==NULL){
printf("file not found: %s\n",cfgName);
return 1;
@@ -6684,7 +6684,7 @@ int script_config_read(char *cfgName)
script_config_read(w2);
}
}
- fclose(fp);
+ fclose_(fp);
return 0;
}