From 09b91f5229b37130a5c42e4de7c120c749125f3d Mon Sep 17 00:00:00 2001 From: KimLS Date: Sun, 12 May 2019 21:09:06 -0700 Subject: [PATCH] Change hash from enum to int, older gcc versions have trouble with that --- common/net/eqstream.cpp | 4 ++-- common/net/eqstream.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/net/eqstream.cpp b/common/net/eqstream.cpp index 9df0ea17e..378b0d919 100644 --- a/common/net/eqstream.cpp +++ b/common/net/eqstream.cpp @@ -72,7 +72,7 @@ void EQ::Net::EQStream::QueuePacket(const EQApplicationPacket *p, bool ack_req) opcode = p->GetOpcodeBypass(); } else { - m_packet_sent_count[p->GetOpcode()]++; //Wont bother with bypass tracking of these since those are rare for testing anyway + m_packet_sent_count[static_cast(p->GetOpcode())]++; //Wont bother with bypass tracking of these since those are rare for testing anyway opcode = (*m_opcode_manager)->EmuToEQ(p->GetOpcode()); } @@ -122,7 +122,7 @@ EQApplicationPacket *EQ::Net::EQStream::PopPacket() { } EmuOpcode emu_op = (*m_opcode_manager)->EQToEmu(opcode); - m_packet_recv_count[emu_op]++; + m_packet_recv_count[static_cast(emu_op)]++; EQApplicationPacket *ret = new EQApplicationPacket(emu_op, (unsigned char*)p->Data() + m_owner->GetOptions().opcode_size, p->Length() - m_owner->GetOptions().opcode_size); ret->SetProtocolOpcode(opcode); diff --git a/common/net/eqstream.h b/common/net/eqstream.h index 09ffbe509..86d7b9485 100644 --- a/common/net/eqstream.h +++ b/common/net/eqstream.h @@ -66,8 +66,8 @@ namespace EQ std::shared_ptr m_connection; OpcodeManager **m_opcode_manager; std::deque> m_packet_queue; - std::unordered_map m_packet_recv_count; - std::unordered_map m_packet_sent_count; + std::unordered_map m_packet_recv_count; + std::unordered_map m_packet_sent_count; friend class EQStreamManager; }; }