diff --git a/src/network/C4NetIO.cpp b/src/network/C4NetIO.cpp index 07a8f79ca..0120fb38e 100644 --- a/src/network/C4NetIO.cpp +++ b/src/network/C4NetIO.cpp @@ -3259,6 +3259,7 @@ void C4NetIOUDP::Peer::OnRecv(const C4NetIOPacket &rPacket) // (mt-safe) } // build ConnOk Packet ConnOKPacket nPack; + bool fullyConnected = false; nPack.StatusByte = IPID_ConnOK; // (always du, no mc experiments here) nPack.Nr = fBroadcasted ? pParent->iOPacketCounter : iOPacketCounter; @@ -3271,10 +3272,12 @@ void C4NetIOUDP::Peer::OnRecv(const C4NetIOPacket &rPacket) // (mt-safe) { nPack.MCMode = ConnOKPacket::MCM_NoMC; // du ok // no multicast => we're fully connected now - OnConn(); + fullyConnected = true; } // send it SendDirect(C4NetIOPacket(&nPack, sizeof(nPack), false, addr)); + // Clients will try sending data from OnConn, so send ConnOK before that. + if (fullyConnected) OnConn(); } break;