From 38659dbd75d81edbe336d5311a1cd1184d359b7e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Sep 2014 16:34:43 +0300 Subject: add support for ignore packets logging. Option for coma separated packet ids added in misc tab. --- src/net/net.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/net/net.cpp') diff --git a/src/net/net.cpp b/src/net/net.cpp index 237287fef..3aba48940 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -20,9 +20,11 @@ * along with this program. If not, see . */ +#include "main.h" + #include "net/net.h" -#include "main.h" +#include "configuration.h" #include "net/loginhandler.h" @@ -34,6 +36,8 @@ #include "net/eathena/generalhandler.h" #endif +#include "utils/stringutils.h" + #include "debug.h" namespace Net @@ -90,6 +94,7 @@ Net::QuestHandler *questHandler = nullptr; namespace Net { ServerInfo::Type networkType = ServerInfo::UNKNOWN; +std::set ignorePackets; void connectToServer(const ServerInfo &server) { @@ -142,6 +147,7 @@ void unload() GeneralHandler *const handler = generalHandler; if (handler) handler->unload(); + ignorePackets.clear(); } ServerInfo::Type getNetworkType() @@ -149,4 +155,15 @@ ServerInfo::Type getNetworkType() return networkType; } +void loadIgnorePackets() +{ + const std::string str = config.getStringValue("ignorelogpackets"); + splitToIntSet(ignorePackets, str, ','); +} + +bool isIgnorePacket(const int id) +{ + return ignorePackets.find(id) != ignorePackets.end(); +} + } // namespace Net -- cgit v1.2.3-60-g2f50