control: text changes in the control menu. replaced `waypoint with node` (#569)

Co-authored-by: jeefo <dmitry@jeefo.net>
This commit is contained in:
commandcobra7 2024-05-16 21:15:41 +03:00 committed by GitHub
commit 30df1a5726
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 253 additions and 238 deletions

View file

@ -13,12 +13,12 @@ int32_t ServerQueryHook::sendTo (int socket, const void *message, size_t length,
};
auto packet = reinterpret_cast <const uint8_t *> (message);
constexpr int32_t packetLength = 5;
constexpr int32_t kPacketLength = 5;
// player replies response
if (length > packetLength && memcmp (packet, "\xff\xff\xff\xff", packetLength - 1) == 0) {
if (length > kPacketLength && memcmp (packet, "\xff\xff\xff\xff", kPacketLength - 1) == 0) {
if (packet[4] == 'D') {
QueryBuffer buffer { packet, length, packetLength };
QueryBuffer buffer { packet, length, kPacketLength };
auto count = buffer.read <uint8_t> ();
for (uint8_t i = 0; i < count; ++i) {
@ -32,7 +32,7 @@ int32_t ServerQueryHook::sendTo (int socket, const void *message, size_t length,
return send (buffer.data ());
}
else if (packet[4] == 'I') {
QueryBuffer buffer { packet, length, packetLength };
QueryBuffer buffer { packet, length, kPacketLength };
buffer.skip <uint8_t> (); // protocol
// skip server name, folder, map game
@ -48,7 +48,7 @@ int32_t ServerQueryHook::sendTo (int socket, const void *message, size_t length,
return send (buffer.data ());
}
else if (packet[4] == 'm') {
QueryBuffer buffer { packet, length, packetLength };
QueryBuffer buffer { packet, length, kPacketLength };
buffer.shiftToEnd (); // shift to the end of buffer
buffer.write <uint8_t> (0); // zero out bot count