summaryrefslogtreecommitdiff
path: root/src/net/eathena/network.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/network.cpp')
-rw-r--r--src/net/eathena/network.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 74f3c3e00..973d306f9 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -117,8 +117,8 @@ void Network::registerHandlers()
void Network::registerFakeHandlers()
{
- const NetworkInfos &packets = NetworkDb::getFakePackets();
- FOR_EACH (NetworkInfosIter, it, packets)
+ const NetworkInPacketInfos &packets = NetworkDb::getFakePackets();
+ FOR_EACH (NetworkInPacketInfosIter, it, packets)
{
const size_t id = (*it).first;
if (id >= packet_lengths_size)
@@ -141,6 +141,30 @@ void Network::registerFakeHandlers()
mPackets[id].func = nullptr;
mPackets[id].version = 0;
}
+
+ const NetworkRemovePacketInfos &removePackets =
+ NetworkDb::getRemovePackets();
+ FOR_EACH (NetworkRemovePacketInfosIter, it, removePackets)
+ {
+ const size_t id = *it;
+ if (id >= packet_lengths_size)
+ {
+ reportAlways("Wrong remove packet id %d", CAST_S32(id));
+ continue;
+ }
+ if (mPackets[id].len == 0 &&
+ mPackets[id].func == nullptr &&
+ mPackets[id].version == 0)
+ {
+ continue;
+ }
+ logger->log("Remove packet: %d",
+ CAST_S32(id));
+ mPackets[id].name = "";
+ mPackets[id].len = 0;
+ mPackets[id].func = nullptr;
+ mPackets[id].version = 0;
+ }
}
void Network::clearHandlers()