when updating game info also check for player connected status in case we send to everyone

This commit is contained in:
zicodxx 2012-05-16 10:41:15 +02:00
parent 8699ae6b63
commit 2c5176a336
2 changed files with 9 additions and 0 deletions

View file

@ -3,6 +3,7 @@ D2X-Rebirth Changelog
20120516
--------
main/game.c: In Multiplayer when taking damage, the game will only leave menus when shield drop below 5
main/net_udp.c: when updating game info also check for player connected status in case we send to everyone
20120515
--------

View file

@ -2312,6 +2312,8 @@ void net_udp_send_netgame_update()
for (i=1; i<N_players; i++ )
{
if (Players[i].connected == CONNECT_DISCONNECTED)
continue;
net_udp_send_game_info(Netgame.players[i].protocol.udp.addr, UPID_GAME_INFO);
}
net_udp_send_game_info(GBcast, UPID_GAME_INFO_LITE);
@ -3478,6 +3480,8 @@ int net_udp_send_sync(void)
Netgame.numplayers = 0;
for (i=1; i<N_players; i++)
{
if (Players[i].connected == CONNECT_DISCONNECTED)
continue;
net_udp_dump_player(Netgame.players[i].protocol.udp.addr, DUMP_ABORTED);
net_udp_send_game_info(Netgame.players[i].protocol.udp.addr, UPID_GAME_INFO);
}
@ -3657,6 +3661,8 @@ abort:
// Tell everyone we're bailing
Netgame.numplayers = 0;
for (i=1; i<save_nplayers; i++) {
if (Players[i].connected == CONNECT_DISCONNECTED)
continue;
net_udp_dump_player(Netgame.players[i].protocol.udp.addr, DUMP_ABORTED);
net_udp_send_game_info(Netgame.players[i].protocol.udp.addr, UPID_GAME_INFO);
}
@ -4021,6 +4027,8 @@ void net_udp_leave_game()
N_players=0;
for (i=1; i<nsave; i++ )
{
if (Players[i].connected == CONNECT_DISCONNECTED)
continue;
net_udp_send_game_info(Netgame.players[i].protocol.udp.addr, UPID_GAME_INFO);
}
net_udp_send_game_info(GBcast, UPID_GAME_INFO_LITE);