|
|
|
@ -344,7 +344,7 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr)
|
|
|
|
|
pl->net.pingreq = pl->net.pingack + 5;
|
|
|
|
|
if (GT_MP_PTPS)
|
|
|
|
|
pl->net.flags = p_id->netflags;
|
|
|
|
|
if (p_id->host[0] != 0) {
|
|
|
|
|
if (p_id->host[0] != 0 && p_id->pl_nr != bman.p_servnr) { // copy addr only if p_id != server
|
|
|
|
|
pl->net.addr.pl_nr = addr->pl_nr;
|
|
|
|
|
strncpy (pl->net.addr.host, p_id->host, LEN_SERVERNAME);
|
|
|
|
|
strncpy (pl->net.addr.port, p_id->port, LEN_PORT);
|
|
|
|
@ -353,7 +353,7 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr)
|
|
|
|
|
}
|
|
|
|
|
/* player is used, we need to check if it's the second player from the server
|
|
|
|
|
* to set it's host and port name */
|
|
|
|
|
else if (PS_IS_used (p_id->state)) {
|
|
|
|
|
else if (PS_IS_used (p_id->state) && p_id->pl_nr != bman.p_servnr) { // copy addr only if p_id != server
|
|
|
|
|
strncpy (pl->net.addr.host, players[bman.p_servnr].net.addr.host, LEN_SERVERNAME);
|
|
|
|
|
strncpy (pl->net.addr.port, players[bman.p_servnr].net.addr.port, LEN_PORT);
|
|
|
|
|
memcpy (&pl->net.addr.sAddr, &players[bman.p_servnr].net.addr.sAddr,
|
|
|
|
@ -361,7 +361,7 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 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 it won't be possible to send
|
|
|
|
|
* something to them.
|
|
|
|
|
*
|
|
|
|
|
* Check only as long as pl->state is still not a network player */
|
|
|
|
@ -386,7 +386,11 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr)
|
|
|
|
|
else
|
|
|
|
|
pl->state &= (0xff - PSF_net);
|
|
|
|
|
|
|
|
|
|
if (pl->gfx_nr != p_id->gfx_nr)
|
|
|
|
|
/* make sure we won't end up in an infinite loop, because of a slow network.
|
|
|
|
|
* only accept the gfx data from other players. Our own we will not overwrite.*/
|
|
|
|
|
if ((bman.state != GS_wait
|
|
|
|
|
|| (p_id->pl_nr != bman.p_nr && p_id->pl_nr != bman.p2_nr))
|
|
|
|
|
&& pl->gfx_nr != p_id->gfx_nr)
|
|
|
|
|
player_set_gfx (pl, p_id->gfx_nr);
|
|
|
|
|
strncpy (pl->name, p_id->name, LEN_PLAYERNAME);
|
|
|
|
|
|
|
|
|
|