|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
/* $Id: network.c,v 1.26 2003/05/29 20:49:53 stpohle Exp $ */
|
|
|
|
|
/* $Id: network.c,v 1.27 2003/05/29 21:35:03 stpohle Exp $ */
|
|
|
|
|
/*
|
|
|
|
|
network routines.
|
|
|
|
|
*/
|
|
|
|
@ -546,7 +546,7 @@ net_game_send_player (int p_nr)
|
|
|
|
|
}
|
|
|
|
|
else if (p_nr == bman.p_nr) {
|
|
|
|
|
for (p = 0; p < MAX_PLAYERS; p++)
|
|
|
|
|
if (PS_IS_netplayer (bman.players[p].state) && p != bman.p_nr && (bman.players[p].net.flags & NETF_firewall) == 0)
|
|
|
|
|
if (PS_IS_netplayer (bman.players[p].state) && p != bman.p_nr && NET_CANSEND(p))
|
|
|
|
|
send_playerdata (&bman.players[p].net.addr, p_nr, &bman.players[p_nr]);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -563,7 +563,7 @@ net_game_send_playermove (int p_nr, int mustsend)
|
|
|
|
|
pl = &bman.players[p_nr];
|
|
|
|
|
|
|
|
|
|
pl->net.pkgopt.send_to--;
|
|
|
|
|
if ((pl->net.pkgopt.send_to <= 0 || mustsend) && ( GT_MP_PTPM || (bman.players[p].net.flags & NETF_firewall) == 0))
|
|
|
|
|
if ((pl->net.pkgopt.send_to <= 0 || mustsend) && NET_CANSEND(p))
|
|
|
|
|
send_playermove (&bman.players[p].net.addr, p_nr, pl);
|
|
|
|
|
|
|
|
|
|
/* network packet send control */
|
|
|
|
@ -587,7 +587,7 @@ net_game_send_bomb (int p, int b)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (pl = 0; pl < MAX_PLAYERS; pl++)
|
|
|
|
|
if (PS_IS_netplayer (bman.players[pl].state) && pl != bman.p_nr && ( GT_MP_PTPM || (bman.players[p].net.flags & NETF_firewall) == 0))
|
|
|
|
|
if (PS_IS_netplayer (bman.players[pl].state) && pl != bman.p_nr && NET_CANSEND(pl))
|
|
|
|
|
send_bombdata (&bman.players[pl].net.addr, p, b, &bman.players[p].bombs[b]);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -603,7 +603,7 @@ net_game_send_field (int x, int y)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (pl = 0; pl < MAX_PLAYERS; pl++)
|
|
|
|
|
if (PS_IS_netplayer (bman.players[pl].state) && pl != bman.p_nr && ( GT_MP_PTPM || (bman.players[pl].net.flags & NETF_firewall) == 0))
|
|
|
|
|
if (PS_IS_netplayer (bman.players[pl].state) && pl != bman.p_nr && NET_CANSEND(pl))
|
|
|
|
|
send_field (&bman.players[pl].net.addr, x, y, &bman.field[x][y]);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -674,7 +674,7 @@ net_send_servermode ()
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
|
if (PS_IS_netplayer (bman.players[i].state) && i != bman.p_nr && ( GT_MP_PTPM || (bman.players[i].net.flags & NETF_firewall) == 0))
|
|
|
|
|
if (PS_IS_netplayer (bman.players[i].state) && i != bman.p_nr && NET_CANSEND(i))
|
|
|
|
|
send_servermode (&bman.players[i].net.addr, i);
|
|
|
|
|
|
|
|
|
|
if (GT_MP_PTPM && bman.notifygamemaster) /* send notification the the gamemaster */
|
|
|
|
@ -707,7 +707,7 @@ net_send_chat (char *text, signed char notigamesrv)
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
|
if (PS_IS_netplayer (bman.players[i].state) && i != bman.p_nr && ( GT_MP_PTPM || (bman.players[i].net.flags & NETF_firewall) == 0))
|
|
|
|
|
if (PS_IS_netplayer (bman.players[i].state) && i != bman.p_nr && NET_CANSEND(i))
|
|
|
|
|
send_chat (&bman.players[i].net.addr, text);
|
|
|
|
|
|
|
|
|
|
if (GT_MP_PTPM && bman.notifygamemaster && notigamesrv == 1) /* send notification the the gamemaster */
|
|
|
|
@ -723,7 +723,7 @@ net_game_send_ill (int p_nr)
|
|
|
|
|
d_printf ("net_game_send_ill (%d)\n", p_nr);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
|
if (PS_IS_netplayer (bman.players[i].state) && i != bman.p_nr && ( GT_MP_PTPM || (bman.players[i].net.flags & NETF_firewall) == 0))
|
|
|
|
|
if (PS_IS_netplayer (bman.players[i].state) && i != bman.p_nr && NET_CANSEND(i))
|
|
|
|
|
send_ill (&bman.players[i].net.addr, p_nr, &bman.players[p_nr]);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -801,6 +801,6 @@ net_game_send_special (int pl_nr, int ex_nr)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (pl = 0; pl < MAX_PLAYERS; pl++)
|
|
|
|
|
if (PS_IS_netplayer (bman.players[pl].state) && pl != pl_nr && ( GT_MP_PTPM || (bman.players[pl].net.flags & NETF_firewall) == 0))
|
|
|
|
|
if (PS_IS_netplayer (bman.players[pl].state) && pl != pl_nr && NET_CANSEND(pl))
|
|
|
|
|
send_special (&bman.players[pl].net.addr, pl_nr, bman.players[pl_nr].special, ex_nr);
|
|
|
|
|
};
|
|
|
|
|