Updates for beta10

This commit is contained in:
WolverinDEV
2020-02-15 14:03:46 +01:00
parent 423f7a7303
commit 035f23ef23
19 changed files with 242 additions and 218 deletions
@@ -79,7 +79,7 @@ void VoiceClientConnection::handle_incoming_datagram(const pipes::buffer_view& b
#endif
#endif
IncomingClientPacketParser packet_parser{buffer};
ClientPacketParser packet_parser{buffer};
if(!packet_parser.valid()) {
logTrace(this->client->getServerId(), "{} Received invalid packet. Dropping.", CLIENT_STR_LOG_PREFIX_(this->client));
return;
@@ -140,8 +140,8 @@ void VoiceClientConnection::handle_incoming_datagram(const pipes::buffer_view& b
}
decrypt_result = this->crypt_handler.decrypt(
data + IncomingClientPacketParser::kHeaderOffset, IncomingClientPacketParser::kHeaderLength,
data + IncomingClientPacketParser::kPayloadOffset, packet_parser.payload_length(),
data + ClientPacketParser::kHeaderOffset, ClientPacketParser::kHeaderLength,
data + ClientPacketParser::kPayloadOffset, packet_parser.payload_length(),
data,
crypt_key, crypt_nonce,
error
@@ -214,7 +214,7 @@ void VoiceClientConnection::handle_incoming_datagram(const pipes::buffer_view& b
}
bool VoiceClientConnection::verify_encryption(const pipes::buffer_view &buffer /* incl. mac etc */) {
IncomingClientPacketParser packet_parser{buffer};
ClientPacketParser packet_parser{buffer};
if(!packet_parser.valid() || !packet_parser.is_encrypted()) return false;
assert(packet_parser.type() >= 0 && packet_parser.type() < this->incoming_generation_estimators.size());