make sure that the reliable packets from soundlist, modellist and the skins

info get acked. This is done by sending a no-op packet (0 byte didn't work
because the runt packet detector throws them out before the ack is seen).
This commit is contained in:
Bill Currie 2001-05-29 03:29:51 +00:00
parent 3c66182588
commit d441a61bf3
4 changed files with 18 additions and 0 deletions

View file

@ -127,6 +127,7 @@ void Netchan_OutOfBand (netadr_t adr, int length, byte *data);
void Netchan_OutOfBandPrint (netadr_t adr, char *format, ...) __attribute__((format(printf,2,3)));
qboolean Netchan_Process (netchan_t *chan);
void Netchan_Setup (netchan_t *chan, netadr_t adr, int qport);
void Netchan_AckPacket (netchan_t *chan);
qboolean Netchan_CanPacket (netchan_t *chan);
qboolean Netchan_CanReliable (netchan_t *chan);

View file

@ -269,6 +269,8 @@ Model_NextDownload (void)
return; // started a download
}
Netchan_AckPacket (&cls.netchan);
for (i = 1; i < MAX_MODELS; i++) {
if (!cl.model_name[i][0])
break;
@ -329,6 +331,8 @@ Sound_NextDownload (void)
return; // started a download
}
Netchan_AckPacket (&cls.netchan);
for (i = 1; i < MAX_SOUNDS; i++) {
if (!cl.sound_name[i][0])
break;

View file

@ -79,6 +79,8 @@ Skin_NextDownload (void)
return; // started a download
}
Netchan_AckPacket (&cls.netchan);
cls.downloadtype = dl_none;
// now load them in for real

View file

@ -451,3 +451,14 @@ Netchan_Process (netchan_t *chan)
return true;
}
/*
Netchan_AckPacket
Send a nop packet so that any unacked reliable packets get acked.
*/
void
Netchan_AckPacket (netchan_t *chan)
{
Netchan_Transmit (chan, 1, (byte*)"\001");
}