Allow hole punch packets to get through before udp fully recved

This commit is contained in:
Jack Garrard 2022-10-27 04:51:36 -07:00
parent 5c04bb1006
commit 4171390f42
1 changed files with 8 additions and 2 deletions

View File

@ -170,8 +170,14 @@ bool SocketClient::send(Packet *packet) {
int valread = 0;
int fd = -1;
if ((packet->mType != PLAYERINF && packet->mType != HACKCAPINF && packet->mType != HOLEPUNCH) || !this->mHasRecvUdp) {
Logger::log("Sending packet: %s\n", packetNames[packet->mType]);
if ((packet->mType != PLAYERINF && packet->mType != HACKCAPINF && packet->mType != HOLEPUNCH)
|| (!this->mHasRecvUdp && packet->mType != HOLEPUNCH)
|| this->mUdpAddress.port == 0) {
if (packet->mType != PLAYERINF && packet->mType != HACKCAPINF) {
Logger::log("Sending packet: %s\n", packetNames[packet->mType]);
}
fd = this->socket_log_socket;
} else {