Properly increment the packet number before sending the gamespy reply
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 32s

Some programs parse the packet number and stop working properly if the packet number is an incorrect value
This commit is contained in:
smallmodel 2025-01-04 19:43:47 +01:00
parent c10fd17d19
commit 9427137dbd
No known key found for this signature in database
GPG key ID: A96F163ED4891440
2 changed files with 3 additions and 3 deletions

View file

@ -192,11 +192,11 @@ static void packet_send(qr_t qrec, struct sockaddr *addr, char *buffer)
return;
}
qrec->packetnumber += 1;
Com_sprintf(keyvalue, sizeof(keyvalue), "\\queryid\\%d.%d", qrec->queryid, qrec->packetnumber);
strcat(buffer, keyvalue);
qrec->packetnumber++;
sendto((SOCKET)qrec->querysock, buffer, (int)strlen(buffer), 0, addr, sizeof(*addr));
*buffer = 0;
}