From a8c7da70e0834a96a624cc2d2e5d148d603d8e54 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 20 Sep 2023 23:11:24 -0700 Subject: [PATCH] fix patch ping event case --- src/Client.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Client.cc b/src/Client.cc index 8ec79881..df3841b4 100644 --- a/src/Client.cc +++ b/src/Client.cc @@ -228,16 +228,15 @@ void Client::dispatch_send_ping(evutil_socket_t, short, void* ctx) { } void Client::send_ping() { - if (this->version() == GameVersion::PATCH) { - throw logic_error("send_ping called for patch client"); - } - this->log.info("Sending ping command"); - // The game doesn't use this timestamp; we only use it for debugging purposes - be_uint64_t timestamp = now(); - try { - this->channel.send(0x1D, 0x00, ×tamp, sizeof(be_uint64_t)); - } catch (const exception& e) { - this->log.info("Failed to send ping: %s", e.what()); + if (this->version() != GameVersion::PATCH) { + this->log.info("Sending ping command"); + // The game doesn't use this timestamp; we only use it for debugging purposes + be_uint64_t timestamp = now(); + try { + this->channel.send(0x1D, 0x00, ×tamp, sizeof(be_uint64_t)); + } catch (const exception& e) { + this->log.info("Failed to send ping: %s", e.what()); + } } }