Close out fire from queue list as this is not necessarily needed to keep games in sync; While processing the noloss queue, only process 5 packets max

This commit is contained in:
zicodxx 2009-02-03 10:56:22 +00:00
parent 98fe14c6d8
commit 8d5657b472
3 changed files with 11 additions and 2 deletions

View file

@ -1,5 +1,9 @@
D2X-Rebirth Changelog
20090203
--------
main/network.c, main/noloss.c: Close out fire from queue list as this is not necessarily needed to keep games in sync; While processing the noloss queue, only process 5 packets max
20090202
--------
main/newdemo.c, main/gameseq.c, main/gamerend.c, main/ai.c, main/game.c, main/gauges.c, main/game.h, main/gamecntl.c: Defined some default cockpit modes in Demo mode so we do not get invalid values when demo starts in non-default-view mode (as new HUD modes are only triggered at beginning and end of event); Removed Newdemo_flying_guided global; Init seismic disturbances in demo mode just to make sure tey are switched off when coming from game mode; Made initialisation for Missile_viewer signature saving global so we can reset it for each new level and make sure we get a correct missile view; Fixed regression in Ai_last_missile_camera

View file

@ -4036,7 +4036,7 @@ void network_do_frame(int force, int listen)
// Send out packet PacksPerSec times per second maximum... unless they fire, then send more often...
if ( (last_send_time>F1_0/Netgame.PacketsPerSec) || (Network_laser_fired) || force || PacketUrgent )
{
int to_queue = (Network_laser_fired || force || PacketUrgent);
int to_queue = (force || PacketUrgent);
if ( Players[Player_num].connected ) {
int objnum = Players[Player_num].objnum;

View file

@ -183,7 +183,7 @@ void noloss_init_queue(void)
// 2) Check if there are packets in queue which we need to re-send to player(s) (if packet is older than one second)
void noloss_process_queue(void)
{
int i;
int i, count = 0;
for (i = 0; i < NOLOSS_QUEUE_SIZE; i++)
{
@ -222,6 +222,11 @@ void noloss_process_queue(void)
{
con_printf(CON_DEBUG, "Re-Sending queued packet %i\n",i);
noloss_send_queued_packet(i);
count++;
}
// Only send 5 packets from the queue by each time the queue process is called
if (count >= 5)
break;
}
}