summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ca23794)
raw | patch | inline | side by side (parent: ca23794)
author | fgsfds <derp.primus@gmail.com> | |
Sat, 15 Jul 2023 17:05:00 +0000 (19:05 +0200) | ||
committer | fgsfds <derp.primus@gmail.com> | |
Sat, 15 Jul 2023 17:05:00 +0000 (19:05 +0200) |
src/game/g_net.pas | patch | blob | history |
diff --git a/src/game/g_net.pas b/src/game/g_net.pas
index 44485eb48aa1363a77c17e1a896ab2ef1cc253d4..6d1be31fa920990a39f9ff7f95ce0ab66a437402 100644 (file)
--- a/src/game/g_net.pas
+++ b/src/game/g_net.pas
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;
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();