X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_net.pas;h=6d1be31fa920990a39f9ff7f95ce0ab66a437402;hb=62ceb85a85290d53a42a8aa13a5da9a04c4bc80c;hp=44485eb48aa1363a77c17e1a896ab2ef1cc253d4;hpb=ca23794a6f2dc5eb454f65fc53efc265f16de612;p=d2df-sdl.git 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();