summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2011-04-12 22:49:19 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2011-04-12 22:49:19 +0200
commit141aeea3a6dad4891aaa52fd6d63dee1b4dada69 (patch)
tree7a89a8b871bbaadb3b1242b3ac69810b13171d57
parentc4180b083a13ac03d294838c578a9cd9862ddaf9 (diff)
downloadmana-141aeea3a6dad4891aaa52fd6d63dee1b4dada69.tar.gz
mana-141aeea3a6dad4891aaa52fd6d63dee1b4dada69.tar.bz2
mana-141aeea3a6dad4891aaa52fd6d63dee1b4dada69.tar.xz
mana-141aeea3a6dad4891aaa52fd6d63dee1b4dada69.zip
Limit the number of pick-up packets to avoid kick from the server
Reviewd-by: Thorbjorn
-rw-r--r--src/net/tmwa/playerhandler.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index a4cd7b15..49db66ae 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -598,8 +598,13 @@ void PlayerHandler::increaseSkill(int skillId)
void PlayerHandler::pickUp(FloorItem *floorItem)
{
+ static Uint32 lastTime = 0;
+ if (SDL_GetTicks() < lastTime + 100)
+ return;
+
MessageOut outMsg(CMSG_ITEM_PICKUP);
outMsg.writeInt32(floorItem->getId());
+ lastTime = SDL_GetTicks();
}
void PlayerHandler::setDirection(char direction)