From: fgsfds Date: Sat, 15 Jul 2023 17:05:00 +0000 (+0200) Subject: net: keep broadcasts in band X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=62ceb85a85290d53a42a8aa13a5da9a04c4bc80c;p=d2df-sdl.git net: keep broadcasts in band --- diff --git a/src/game/g_net.pas b/src/game/g_net.pas index 44485eb..6d1be31 100644 --- a/src/game/g_net.pas +++ b/src/game/g_net.pas @@ -1396,14 +1396,6 @@ begin if NetMode = NET_SERVER then for T := NET_UNRELIABLE to NET_RELIABLE do begin - if NetBuf[T].CurSize > 0 then - begin - P := enet_packet_create(NetBuf[T].Data, NetBuf[T].CurSize, F); - if not Assigned(P) then continue; - enet_host_broadcast(NetHost, Chan, P); - NetBuf[T].Clear(); - end; - for I := Low(NetClients) to High(NetClients) do begin if not NetClients[I].Used then continue; @@ -1619,9 +1611,15 @@ begin end else begin - // write size first - NetBuf[T].Write(Integer(NetOut.CurSize)); - NetBuf[T].Write(NetOut); + for ID := Low(NetClients) to High(NetClients) do + begin + if NetClients[ID].Used then + begin + // write size first + NetClients[ID].NetOut[T].Write(Integer(NetOut.CurSize)); + NetClients[ID].NetOut[T].Write(NetOut); + end; + end; end; if NetDump then g_Net_DumpSendBuffer();