Change hash from enum to int, older gcc versions have trouble with that

This commit is contained in:
KimLS 2019-05-12 21:09:06 -07:00
parent 0eeb73b436
commit 09b91f5229
2 changed files with 4 additions and 4 deletions

View File

@ -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<int>(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<int>(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);

View File

@ -66,8 +66,8 @@ namespace EQ
std::shared_ptr<DaybreakConnection> m_connection;
OpcodeManager **m_opcode_manager;
std::deque<std::unique_ptr<EQ::Net::Packet>> m_packet_queue;
std::unordered_map<EmuOpcode, int> m_packet_recv_count;
std::unordered_map<EmuOpcode, int> m_packet_sent_count;
std::unordered_map<int, int> m_packet_recv_count;
std::unordered_map<int, int> m_packet_sent_count;
friend class EQStreamManager;
};
}