From 8bb31688f71af76a143220c41079d3e01be85c1a Mon Sep 17 00:00:00 2001 From: ultramage Date: Fri, 13 Nov 2009 21:06:21 +0000 Subject: Resolved a client hang in the scenario where the client sent loadendack before the server finished loading all data (bugreport:3700). Improved the performance of pc_autosave() to stop scanning players after it has already found the player it wanted to save (bugreport:3717). The 'overweight' status changes (SC_WEIGHT50/SC_WEIGHT90) will now be cleared on logout, to avoid saving them into the database (they get derived from player weight during login anyway). Improved lock.c on windows to use C's access(0) function instead of doing fopen/fclose when testing for existence of files. Re-added the 'static' attribute to mapindex_getmapname_ext's buffer; returning the address of a non-static local variable is undefined behavior (see r13901). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14144 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index ed9f12c72..2eb614780 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -13416,15 +13416,21 @@ int clif_parse(int fd) if ((int)RFIFOREST(fd) < packet_len) return 0; // not enough data received to form the packet - if (packet_db[packet_ver][cmd].func) { - if (sd && sd->bl.prev == NULL && packet_db[packet_ver][cmd].func != clif_parse_LoadEndAck) - ; //Only valid packet when player is not on a map is the finish-loading packet. + if( packet_db[packet_ver][cmd].func == clif_parse_debug ) + packet_db[packet_ver][cmd].func(fd, sd); + else + if( packet_db[packet_ver][cmd].func != NULL ) + { + if( !sd && packet_db[packet_ver][cmd].func != clif_parse_WantToConnection ) + ; //Only valid packet when there is no session + else + if( sd && sd->bl.prev == NULL && packet_db[packet_ver][cmd].func != clif_parse_LoadEndAck ) + ; //Only valid packet when player is not on a map + else + if( sd && session[sd->fd]->flag.eof ) + ; //No more packets accepted else - if ((sd && sd->state.active) - || packet_db[packet_ver][cmd].func == clif_parse_WantToConnection - || packet_db[packet_ver][cmd].func == clif_parse_debug - ) //Only execute the function when there's an active sd (except for debug/wanttoconnect packets) - packet_db[packet_ver][cmd].func(fd, sd); + packet_db[packet_ver][cmd].func(fd, sd); } #if DUMP_UNKNOWN_PACKET else if (battle_config.error_log) -- cgit v1.2.3-70-g09d2