summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-02 08:15:47 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-02 08:15:47 +0000
commitd7212378daff04fbc4c553b7d00402b014dcfad9 (patch)
tree1f80128f046978f1efb5ea8f0bcd966c92077aad /src
parentc9d2cea67128d714db85237ef2d062f07052c904 (diff)
downloadhercules-d7212378daff04fbc4c553b7d00402b014dcfad9.tar.gz
hercules-d7212378daff04fbc4c553b7d00402b014dcfad9.tar.bz2
hercules-d7212378daff04fbc4c553b7d00402b014dcfad9.tar.xz
hercules-d7212378daff04fbc4c553b7d00402b014dcfad9.zip
fixed Emotion flood (fix from Freya)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1198 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c14
-rw-r--r--src/map/map.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index d658866cc..9670983d1 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8163,10 +8163,20 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd) {
nullpo_retv(sd);
if (battle_config.basic_skill_check == 0 || pc_checkskill(sd, NV_BASIC) >= 2) {
+ if (RFIFOB(fd,2) == 34) {// prevent use of the mute emote [Valaris]
+ clif_skill_fail(sd, 1, 0, 1);
+ return;
+ }
+ // fix flood of emotion icon (ro-proxy): flood only the hacker player
+ if (sd->emotionlasttime >= time(NULL)) {
+ sd->emotionlasttime = time(NULL) + 2; // not more than 1 every 2 seconds (normal client is every 3-4 seconds)
+ clif_skill_fail(sd, 1, 0, 1);
+ return;
+ }
+ sd->emotionlasttime = time(NULL) + 2; // not more than 1 every 2 seconds (normal client is every 3-4 seconds)
+
WBUFW(buf,0) = 0xc0;
WBUFL(buf,2) = sd->bl.id;
- if(RFIFOB(fd,2)==34) // prevent use of the mute emote [Valaris]
- return;
WBUFB(buf,6) = RFIFOB(fd,2);
clif_send(buf, packet_len_table[0xc0], &sd->bl, AREA);
} else
diff --git a/src/map/map.h b/src/map/map.h
index dc95fa02b..c1d0670e7 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -200,6 +200,8 @@ struct map_session_data {
int followtimer; // [MouseJstr]
int followtarget;
+ time_t emotionlasttime; // to limit flood with emotion packets
+
short attackrange,attackrange_;
int skilltimer;
int skilltarget;