From eb8aaf009316e18c7c78e2995669cdc96785a2de Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 4 May 2023 21:20:26 -0500 Subject: [PATCH] Fix graceful termination messages being discarded by Moonlight --- src/stream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stream.cpp b/src/stream.cpp index ec4cb0cc..1dd85897 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -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(reason); std::array