Fix graceful termination messages being discarded by Moonlight

This commit is contained in:
Cameron Gutman 2023-05-04 21:20:26 -05:00
parent 10ea67719e
commit eb8aaf0093

View File

@ -46,7 +46,7 @@ static const short packetTypes[] = {
0x0204, // Frame Stats (unused)
0x0206, // Input data
0x010b, // Rumble data
0x0100, // Termination
0x0109, // Termination
0x0200, // Periodic Ping
0x0302, // IDR frame
0x0001, // fully encrypted
@ -887,7 +887,7 @@ namespace stream {
control_terminate_t plaintext;
plaintext.header.type = packetTypes[IDX_TERMINATION];
plaintext.header.payloadLength = sizeof(plaintext.ec);
plaintext.ec = reason;
plaintext.ec = util::endian::big<uint32_t>(reason);
std::array<std::uint8_t,
sizeof(control_encrypted_t) + crypto::cipher::round_to_pkcs7_padded(sizeof(plaintext)) + crypto::cipher::tag_size>