summaryrefslogtreecommitdiff
path: root/src/gui/windows/npcdialog.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/gui/windows/npcdialog.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/gui/windows/npcdialog.cpp')
-rw-r--r--src/gui/windows/npcdialog.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 47ad71f32..11ba96933 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -57,6 +57,7 @@
#include "net/net.h"
#include "net/npchandler.h"
+#include "net/packetlimiter.h"
#include "utils/copynpaste.h"
#include "utils/delete2.h"
@@ -282,7 +283,7 @@ void NpcDialog::action(const ActionEvent &event)
{
if (mActionState == NPC_ACTION_NEXT)
{
- if (!client->limitPackets(PACKET_NPC_NEXT))
+ if (!PacketLimiter::limitPackets(PACKET_NPC_NEXT))
return;
nextDialog();
@@ -307,7 +308,7 @@ void NpcDialog::action(const ActionEvent &event)
if (selectedIndex >= static_cast<int>(mItems.size())
|| selectedIndex < 0
- || !client->limitPackets(PACKET_NPC_INPUT))
+ || !PacketLimiter::limitPackets(PACKET_NPC_INPUT))
{
return;
}
@@ -320,7 +321,7 @@ void NpcDialog::action(const ActionEvent &event)
}
case NPC_INPUT_STRING:
{
- if (!client->limitPackets(PACKET_NPC_INPUT))
+ if (!PacketLimiter::limitPackets(PACKET_NPC_INPUT))
return;
printText = mTextField->getText();
Net::getNpcHandler()->stringInput(mNpcId, printText);
@@ -328,7 +329,7 @@ void NpcDialog::action(const ActionEvent &event)
}
case NPC_INPUT_INTEGER:
{
- if (!client->limitPackets(PACKET_NPC_INPUT))
+ if (!PacketLimiter::limitPackets(PACKET_NPC_INPUT))
return;
printText = strprintf("%d", mIntField->getValue());
Net::getNpcHandler()->integerInput(
@@ -337,7 +338,7 @@ void NpcDialog::action(const ActionEvent &event)
}
case NPC_INPUT_ITEM:
{
- if (!client->limitPackets(PACKET_NPC_INPUT))
+ if (!PacketLimiter::limitPackets(PACKET_NPC_INPUT))
return;
std::string str;