Fix connection not terminating on server exit for Linux native builds (#277)

Debug line from another PR fixed an issue, where exiting the server
would not terminate the connection properly. Additionally, the other PR
had been missing curly braces for an if-check -- has been added here.

These changes fix the connection termination and don't come with side
effects such as no ping and player movement.

---

By creating this pull request, I understand that code that is AI
generated or otherwise automatically generated may be rejected without
further discussion.
I declare that I fully understand all code I pushed into this PR, and
wrote all this code myself and own the rights to this code.
This commit is contained in:
Tixx authored and GitHub committed 2026-11-02 22:08:11 +01:00
commit 92f41b6202
1 file changed
+3 -1
+3 -1
View File
@@ -76,8 +76,10 @@ void UDPRcv() {
#endif
ZeroMemory(&FromServer, clientLength);
static thread_local std::array<char, 10240> Ret {};
if (UDPSock == -1)
if (UDPSock == -1) {
debug("UDPSock == -1");
return;
}
int32_t Rcv = recvfrom(UDPSock, Ret.data(), Ret.size() - 1, 0, (sockaddr*)&FromServer, &clientLength);
if (Rcv == SOCKET_ERROR)
return;