playerid is send too many times also gfx change was still possible to do in a diffrent gamestate as GS_wait.

origin
stpohle 21 years ago
parent 6e99a34654
commit bcda2a67a0

@ -341,7 +341,9 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr)
/* Check if we have to make a network test.. only client to client /* Check if we have to make a network test.. only client to client
* we won't check 2 players too because i't won't be possible to send * we won't check 2 players too because i't won't be possible to send
* something to them. Start the timer for the connection test. */ * something to them.
*
* Check only as long as pl->state is still not a network player */
if (GT_MP_PTPS && !(PS_IS_netplayer (pl->state)) && (PS_IS_netplayer (p_id->state)) if (GT_MP_PTPS && !(PS_IS_netplayer (pl->state)) && (PS_IS_netplayer (p_id->state))
&& p_id->pl_nr != bman.p_servnr && p_id->pl_nr != bman.p_nr && p_id->pl_nr != bman.p_servnr && p_id->pl_nr != bman.p_nr
&& !(pl->net.flags & NETF_local2) && p_id->pl_nr != bman.p2_nr) { && !(pl->net.flags & NETF_local2) && p_id->pl_nr != bman.p2_nr) {
@ -375,6 +377,15 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr)
net_send_playerid (addr->pl_nr); net_send_playerid (addr->pl_nr);
} }
/*
* if we are already in a game don't let the player change the gfx */
else if (GT_MP_PTPM && p_id->pl_nr >= 0 && p_id->pl_nr < MAX_PLAYERS &&
p_id->pl_nr != bman.p_nr && p_id->pl_nr != bman.p2_nr && bman.state != GS_wait) {
/* Send all connected players the new PlayerID */
if (GT_MP_PTPM && GS_WAITRUNNING && addr->pl_nr >= 0 && addr->pl_nr < MAX_PLAYERS)
net_send_playerid (addr->pl_nr);
}
// d_playerdetail ("*** PLAYER List ***"); // d_playerdetail ("*** PLAYER List ***");
team_update (); team_update ();
bman.updatestatusbar = 1; bman.updatestatusbar = 1;

Loading…
Cancel
Save