summaryrefslogtreecommitdiff
path: root/src/net/net.cpp
diff options
context:
space:
mode:
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