|
|
@ -1,4 +1,4 @@
|
|
|
|
/* $Id: network.c,v 1.39 2003/08/10 15:10:19 stpohle Exp $ */
|
|
|
|
/* $Id: network.c,v 1.40 2003/08/24 19:52:08 stpohle Exp $ */
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
network routines.
|
|
|
|
network routines.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -340,6 +340,9 @@ draw_netupdatestate ()
|
|
|
|
font_draw (70, y, text, 0);
|
|
|
|
font_draw (70, y, text, 0);
|
|
|
|
|
|
|
|
|
|
|
|
text[0] = 0;
|
|
|
|
text[0] = 0;
|
|
|
|
|
|
|
|
if (bman.players[i].net.net_istep == 3)
|
|
|
|
|
|
|
|
sprintf (text, "Getting Tunnel Data %d.", bman.players[i].net.net_status);
|
|
|
|
|
|
|
|
|
|
|
|
if (bman.players[i].net.net_istep == 2)
|
|
|
|
if (bman.players[i].net.net_istep == 2)
|
|
|
|
sprintf (text, "Getting Field Data %d of %d.", bman.players[i].net.net_status,
|
|
|
|
sprintf (text, "Getting Field Data %d of %d.", bman.players[i].net.net_status,
|
|
|
|
map.size.x);
|
|
|
|
map.size.x);
|
|
|
@ -419,14 +422,14 @@ net_transmit_gamedata ()
|
|
|
|
for (x = 0; x < MAX_PLAYERS; x++) {
|
|
|
|
for (x = 0; x < MAX_PLAYERS; x++) {
|
|
|
|
bman.players[x].net.timestamp = 0;
|
|
|
|
bman.players[x].net.timestamp = 0;
|
|
|
|
bman.players[x].net.net_status = -1;
|
|
|
|
bman.players[x].net.net_status = -1;
|
|
|
|
bman.players[x].net.net_istep = 2;
|
|
|
|
bman.players[x].net.net_istep = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
y = -1;
|
|
|
|
y = -1;
|
|
|
|
if (GT_MP_PTPM)
|
|
|
|
if (GT_MP_PTPM)
|
|
|
|
net_istep = 0;
|
|
|
|
net_istep = 0;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
net_istep = 2;
|
|
|
|
net_istep = 3;
|
|
|
|
|
|
|
|
|
|
|
|
while (!done && bman.state == GS_update) {
|
|
|
|
while (!done && bman.state == GS_update) {
|
|
|
|
/* the network thing */
|
|
|
|
/* the network thing */
|
|
|
@ -446,7 +449,33 @@ net_transmit_gamedata ()
|
|
|
|
|
|
|
|
|
|
|
|
/* if PTPS get all data */
|
|
|
|
/* if PTPS get all data */
|
|
|
|
if (GT_MP_PTPS) {
|
|
|
|
if (GT_MP_PTPS) {
|
|
|
|
|
|
|
|
if (net_istep == 3) {
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
get tunneldata
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
if ((y < GAME_MAX_TUNNELS - 1 && y == bman.players[bman.p_nr].net.net_status)
|
|
|
|
|
|
|
|
|| y == -1) {
|
|
|
|
|
|
|
|
y++;
|
|
|
|
|
|
|
|
downtimestamp = timestamp;
|
|
|
|
|
|
|
|
send_tunneldata (&bman.players[0].net.addr, y, -1, -1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (y < GAME_MAX_TUNNELS && y != bman.players[bman.p_nr].net.net_status
|
|
|
|
|
|
|
|
&& y >= 0 && timestamp - downtimestamp > DOWNLOAD_TIMEOUT) {
|
|
|
|
|
|
|
|
/* we have got no tunnel data*/
|
|
|
|
|
|
|
|
y--;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (y == GAME_MAX_TUNNELS - 1 && bman.players[bman.p_nr].net.net_status == y) {
|
|
|
|
|
|
|
|
/* we have got all tunnel data */
|
|
|
|
|
|
|
|
y = -1;
|
|
|
|
|
|
|
|
bman.players[bman.p_nr].net.net_istep = --net_istep;
|
|
|
|
|
|
|
|
bman.players[bman.p_nr].net.net_status = -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (net_istep == 2) {
|
|
|
|
if (net_istep == 2) {
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
get field data
|
|
|
|
|
|
|
|
*/
|
|
|
|
if ((y < map.size.y - 1 && y == bman.players[bman.p_nr].net.net_status)
|
|
|
|
if ((y < map.size.y - 1 && y == bman.players[bman.p_nr].net.net_status)
|
|
|
|
|| y == -1) {
|
|
|
|
|| y == -1) {
|
|
|
|
/* send field data req */
|
|
|
|
/* send field data req */
|
|
|
@ -468,6 +497,9 @@ net_transmit_gamedata ()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (net_istep == 1) {
|
|
|
|
if (net_istep == 1) {
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
get player data
|
|
|
|
|
|
|
|
*/
|
|
|
|
if ((y < MAX_PLAYERS - 1 && y == bman.players[bman.p_nr].net.net_status) || y == -1) {
|
|
|
|
if ((y < MAX_PLAYERS - 1 && y == bman.players[bman.p_nr].net.net_status) || y == -1) {
|
|
|
|
/* send player date req */
|
|
|
|
/* send player date req */
|
|
|
|
y++;
|
|
|
|
y++;
|
|
|
|