diff options
author | Haru <haru@dotalux.com> | 2014-05-09 08:40:15 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-05-09 08:40:41 +0200 |
commit | a168c786095d50dfce96791627b57b917a9cf7eb (patch) | |
tree | 0380cd6e114d066913ac8c64ac60a49af3d68ce2 /src | |
parent | b6b3f58795288701d0e162d43fa6f0a47af913b3 (diff) | |
download | hercules-a168c786095d50dfce96791627b57b917a9cf7eb.tar.gz hercules-a168c786095d50dfce96791627b57b917a9cf7eb.tar.bz2 hercules-a168c786095d50dfce96791627b57b917a9cf7eb.tar.xz hercules-a168c786095d50dfce96791627b57b917a9cf7eb.zip |
Removed extra'GeoIP disabled' message on charserver shutdown
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/char/inter.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/char/inter.c b/src/char/inter.c index 8b6368e9d..972407ef3 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -454,14 +454,15 @@ const char* geoip_getcountry(uint32 ipnum){ * Disables GeoIP * frees geoip.cache **/ -void geoip_final( void ) { - if( geoip.cache ) { +void geoip_final(bool shutdown) { + if (geoip.cache) { aFree(geoip.cache); geoip.cache = NULL; } - if( geoip.active ) { - ShowStatus("GeoIP "CL_RED"disabled"CL_RESET".\n"); + if (geoip.active) { + if (!shutdown) + ShowStatus("GeoIP "CL_RED"disabled"CL_RESET".\n"); geoip.active = false; } } @@ -483,20 +484,20 @@ void geoip_init(void) { db = fopen("./db/GeoIP.dat","rb"); if( db == NULL ) { ShowError("geoip_readdb: Error reading GeoIP.dat!\n"); - geoip_final(); + geoip_final(false); return; } fno = fileno(db); if( fstat(fno, &bufa) < 0 ) { ShowError("geoip_readdb: Error stating GeoIP.dat! Error %d\n", errno); - geoip_final(); + geoip_final(false); return; } geoip.cache = aMalloc( (sizeof(geoip.cache) * bufa.st_size) ); if( fread(geoip.cache, sizeof(unsigned char), bufa.st_size, db) != bufa.st_size ) { ShowError("geoip_cache: Couldn't read all elements!\n"); fclose(db); - geoip_final(); + geoip_final(false); return; } @@ -520,7 +521,7 @@ void geoip_init(void) { else ShowError("geoip_init(): GeoIP is corrupted!\n"); - geoip_final(); + geoip_final(false); return; } ShowStatus("Finished Reading "CL_GREEN"GeoIP"CL_RESET" Database.\n"); @@ -1044,7 +1045,7 @@ void inter_final(void) inter_mail_sql_final(); inter_auction_sql_final(); - geoip_final(); + geoip_final(true); do_final_msg(); return; } |