fix patch ping event case
This commit is contained in:
+9
-10
@@ -228,16 +228,15 @@ void Client::dispatch_send_ping(evutil_socket_t, short, void* ctx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Client::send_ping() {
|
void Client::send_ping() {
|
||||||
if (this->version() == GameVersion::PATCH) {
|
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
|
||||||
this->log.info("Sending ping command");
|
be_uint64_t timestamp = now();
|
||||||
// The game doesn't use this timestamp; we only use it for debugging purposes
|
try {
|
||||||
be_uint64_t timestamp = now();
|
this->channel.send(0x1D, 0x00, ×tamp, sizeof(be_uint64_t));
|
||||||
try {
|
} catch (const exception& e) {
|
||||||
this->channel.send(0x1D, 0x00, ×tamp, sizeof(be_uint64_t));
|
this->log.info("Failed to send ping: %s", e.what());
|
||||||
} catch (const exception& e) {
|
}
|
||||||
this->log.info("Failed to send ping: %s", e.what());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user