summaryrefslogtreecommitdiff
path: root/src/net/net.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-17 16:34:43 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-17 16:58:46 +0300
commit38659dbd75d81edbe336d5311a1cd1184d359b7e (patch)
tree919c97a5e48c5e9287250eab34cb36ef5f02c21e /src/net/net.cpp
parentc1ba61eb566a0a1a2532690ba3bf7e6498bee06b (diff)
downloadplus-38659dbd75d81edbe336d5311a1cd1184d359b7e.tar.gz
plus-38659dbd75d81edbe336d5311a1cd1184d359b7e.tar.bz2
plus-38659dbd75d81edbe336d5311a1cd1184d359b7e.tar.xz
plus-38659dbd75d81edbe336d5311a1cd1184d359b7e.zip
add support for ignore packets logging.
Option for coma separated packet ids added in misc tab.
Diffstat (limited to 'src/net/net.cpp')
-rw-r--r--src/net/net.cpp19
1 files changed, 18 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>.
*/
+#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<int> 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