summaryrefslogtreecommitdiff
path: root/src/map/npc.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/npc.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/npc.c')
-rw-r--r--src/map/npc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 11725b3..5fe190b 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -21,6 +21,7 @@
#include "pc.h"
#include "script.h"
#include "skill.h"
+#include "../common/socket.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -2008,7 +2009,7 @@ int do_init_npc(void)
free(nsl->prev);
nsl->prev = NULL;
}
- fp=fopen(nsl->name,"r");
+ fp=fopen_(nsl->name,"r");
if (fp==NULL) {
printf("file not found : %s\n",nsl->name);
exit(1);
@@ -2065,7 +2066,7 @@ int do_init_npc(void)
npc_parse_mapflag(w1,w2,w3,w4);
}
}
- fclose(fp);
+ fclose_(fp);
printf("\rLoading NPCs [%d]: %-54s",npc_id-START_NPC_NUM,nsl->name);
fflush(stdout);
}