summaryrefslogtreecommitdiff
path: root/src/actormanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-29 19:32:58 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-29 19:32:58 +0300
commite55ed9a138e97f6fba5e3b6858a755f8a50197d2 (patch)
tree90b5337d62f42b2060328905776748f32c6e4eb6 /src/actormanager.cpp
parent88f71d6a8673932d178408e7632a6eea08623294 (diff)
downloadmv-e55ed9a138e97f6fba5e3b6858a755f8a50197d2.tar.gz
mv-e55ed9a138e97f6fba5e3b6858a755f8a50197d2.tar.bz2
mv-e55ed9a138e97f6fba5e3b6858a755f8a50197d2.tar.xz
mv-e55ed9a138e97f6fba5e3b6858a755f8a50197d2.zip
Move from client packets limiter related code into separate file.
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r--src/actormanager.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index 699eb7fbd..c7e091900 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -45,6 +45,7 @@
#include "utils/gettext.h"
#include "net/net.h"
+#include "net/packetlimiter.h"
#include "net/playerhandler.h"
#include <algorithm>
@@ -566,7 +567,7 @@ bool ActorManager::pickUpAll(const int x1, const int y1,
}
}
}
- else if (client->checkPackets(PACKET_PICKUP))
+ else if (PacketLimiter::checkPackets(PACKET_PICKUP))
{
FloorItem *item = nullptr;
unsigned cnt = 65535;
@@ -1151,7 +1152,7 @@ void ActorManager::heal(const Being *const target) const
&& PlayerInfo::getAttribute(Attributes::HP)
!= PlayerInfo::getAttribute(Attributes::MAX_HP))
{
- if (!client->limitPackets(PACKET_CHAT))
+ if (!PacketLimiter::limitPackets(PACKET_CHAT))
return;
chatWindow->localChatInput(mSpellHeal1);
}
@@ -1164,7 +1165,7 @@ void ActorManager::heal(const Being *const target) const
{
if (target && target->getType() != ActorType::MONSTER)
{
- if (!client->limitPackets(PACKET_CHAT))
+ if (!PacketLimiter::limitPackets(PACKET_CHAT))
return;
chatWindow->localChatInput(mSpellHeal1 + " "
+ target->getName());
@@ -1172,7 +1173,7 @@ void ActorManager::heal(const Being *const target) const
else if (PlayerInfo::getAttribute(Attributes::HP)
!= PlayerInfo::getAttribute(Attributes::MAX_HP))
{
- if (!client->limitPackets(PACKET_CHAT))
+ if (!PacketLimiter::limitPackets(PACKET_CHAT))
return;
chatWindow->localChatInput(mSpellHeal1);
}
@@ -1189,7 +1190,7 @@ void ActorManager::heal(const Being *const target) const
if (player_relations.getRelation(target->getName()) !=
PlayerRelation::ENEMY2)
{
- if (!client->limitPackets(PACKET_CHAT))
+ if (!PacketLimiter::limitPackets(PACKET_CHAT))
return;
chatWindow->localChatInput(mSpellHeal2 + " "
+ target->getName());
@@ -1197,7 +1198,7 @@ void ActorManager::heal(const Being *const target) const
// target enemy
else
{
- if (!client->limitPackets(PACKET_CHAT))
+ if (!PacketLimiter::limitPackets(PACKET_CHAT))
return;
chatWindow->localChatInput(mSpellHeal1);
}
@@ -1208,7 +1209,7 @@ void ActorManager::heal(const Being *const target) const
&& PlayerInfo::getAttribute(Attributes::HP)
!= PlayerInfo::getAttribute(Attributes::MAX_HP))
{
- if (!client->limitPackets(PACKET_CHAT))
+ if (!PacketLimiter::limitPackets(PACKET_CHAT))
return;
chatWindow->localChatInput(mSpellHeal1);
}
@@ -1223,7 +1224,7 @@ void ActorManager::itenplz() const
return;
}
- if (!client->limitPackets(PACKET_CHAT))
+ if (!PacketLimiter::limitPackets(PACKET_CHAT))
return;
chatWindow->localChatInput(mSpellItenplz);