When leaving game and still sending extras, don't forget to update the timer so we won't get stuck in an infinite loop

This commit is contained in:
zicodxx 2011-04-21 20:52:33 +02:00
parent a498f20bc9
commit d9bbc359a2
3 changed files with 11 additions and 0 deletions

View file

@ -1,5 +1,9 @@
D2X-Rebirth Changelog D2X-Rebirth Changelog
20110421
--------
main/net_ipx.c, main/net_udp.c: When leaving game and still sending extras, don't forget to update the timer so we won't get stuck in an infinite loop
20110420 20110420
-------- --------
main/multi.c, main/state.c: Resolved termination issue when reading and comparing callsigns fro Coop savestates; Added scores sending after Coop savestate loading as unrestored players will send them when loading new level main/multi.c, main/state.c: Resolved termination issue when reading and comparing callsigns fro Coop savestates; Added scores sending after Coop savestate loading as unrestored players will send them when loading new level

View file

@ -4192,7 +4192,10 @@ void net_ipx_leave_game()
if ((multi_i_am_master())) if ((multi_i_am_master()))
{ {
while (Network_sending_extras>1 && Player_joining_extras!=-1) while (Network_sending_extras>1 && Player_joining_extras!=-1)
{
timer_update();
net_ipx_send_extras(); net_ipx_send_extras();
}
Netgame.numplayers = 0; Netgame.numplayers = 0;
nsave=N_players; nsave=N_players;

View file

@ -3409,6 +3409,7 @@ void net_udp_read_sync_packet( ubyte * data, int data_len, struct _sockaddr send
if (Netgame.segments_checksum != my_segments_checksum) if (Netgame.segments_checksum != my_segments_checksum)
{ {
Network_status = NETSTAT_MENU; Network_status = NETSTAT_MENU;
net_udp_close();
nm_messagebox(TXT_ERROR, 1, TXT_OK, TXT_NETLEVEL_NMATCH); nm_messagebox(TXT_ERROR, 1, TXT_OK, TXT_NETLEVEL_NMATCH);
#ifdef RELEASE #ifdef RELEASE
return; return;
@ -4035,7 +4036,10 @@ void net_udp_leave_game()
if ((multi_i_am_master())) if ((multi_i_am_master()))
{ {
while (Network_sending_extras>1 && Player_joining_extras!=-1) while (Network_sending_extras>1 && Player_joining_extras!=-1)
{
timer_update();
net_udp_send_extras(); net_udp_send_extras();
}
Netgame.numplayers = 0; Netgame.numplayers = 0;
nsave=N_players; nsave=N_players;