From e4f1bb413aa609b173707b9e5d960ae0476dab61 Mon Sep 17 00:00:00 2001 From: lordttseven Date: Sat, 18 Feb 2012 22:05:21 +0000 Subject: * adjusted socket_max_client_packet to a more accurate (if guessed) value to prevent undefined client behavior (may only affect more recent clients?) + added a workaround for too large ZC_SKILLINFO_LIST packets resulting from all_skill group permission by sending excess skills one by one (bugreport:5348 and bugreport:5349) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15609 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 2c6b3e742..007df2928 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4534,6 +4534,10 @@ void clif_skillinfoblock(struct map_session_data *sd) { if( (id = sd->status.skill[i].id) != 0 ) { + // workaround for bugreport:5348 + if (len + 37 > socket_max_client_packet) + break; + WFIFOW(fd,len) = id; WFIFOL(fd,len+2) = skill_get_inf(id); WFIFOW(fd,len+6) = sd->status.skill[i].lv; @@ -4549,6 +4553,16 @@ void clif_skillinfoblock(struct map_session_data *sd) } WFIFOW(fd,2)=len; WFIFOSET(fd,len); + + // workaround for bugreport:5348; send the remaining skills one by one to bypass packet size limit + for ( ; i < MAX_SKILL; i++) + { + if( (id = sd->status.skill[i].id) != 0 ) + { + clif_addskill(sd, id); + clif_skillinfo(sd, id, 0); + } + } } /** * Server tells client 'sd' to add skill of id 'id' to it's skill tree (e.g. with Ice Falcion item) -- cgit v1.2.3-70-g09d2