MasterServer Send Game information FIXED

origin
stpohle 23 years ago
parent ea434d8194
commit 3d66e93f2b

@ -406,7 +406,7 @@ net_new_gamedata ()
Uint8 *keys; Uint8 *keys;
Uint32 downtimestamp = 0; Uint32 downtimestamp = 0;
net_host_new_game (); // we do it to for the clients 'cause we need to reset the clients net_host_new_game (); // we do it to for the clients 'cause we need to reset the clients
draw_logo (); draw_logo ();
if (GT_MP_PTPM) if (GT_MP_PTPM)
@ -541,16 +541,16 @@ net_game_send_player (int p_nr)
{ {
int p; int p;
if (GT_MP_PTPM) { if (GT_MP_PTPM) {
for (p = 0; p < MAX_PLAYERS; p++) for (p = 0; p < MAX_PLAYERS; p++)
if (PS_IS_used (bman.players[p].state) && p != bman.p_nr) if (PS_IS_used (bman.players[p].state) && p != bman.p_nr)
send_playerdata (&bman.players[p].net.addr, p_nr, &bman.players[p_nr]); send_playerdata (&bman.players[p].net.addr, p_nr, &bman.players[p_nr]);
} }
else if (p_nr == bman.p_nr) { else if (p_nr == bman.p_nr) {
for (p = 0; p < MAX_PLAYERS; p++) for (p = 0; p < MAX_PLAYERS; p++)
if (PS_IS_used (bman.players[p].state) && p != bman.p_nr) if (PS_IS_used (bman.players[p].state) && p != bman.p_nr)
send_playerdata (&bman.players[p].net.addr, p_nr, &bman.players[p_nr]); send_playerdata (&bman.players[p].net.addr, p_nr, &bman.players[p_nr]);
} }
}; };
@ -607,7 +607,8 @@ net_delplayer (int pl_nr)
{ {
char host[LEN_SERVERNAME]; char host[LEN_SERVERNAME];
char port[LEN_PORT]; char port[LEN_PORT];
int i,j=1; int i,
j = 1;
d_printf ("net_delplayer (%d)\n", pl_nr); d_printf ("net_delplayer (%d)\n", pl_nr);
@ -623,14 +624,17 @@ net_delplayer (int pl_nr)
bman.players[pl_nr].state &= (0xFF - (PSF_used + PSF_alife)); // Delete the used flag bman.players[pl_nr].state &= (0xFF - (PSF_used + PSF_alife)); // Delete the used flag
bman.players[pl_nr].net.net_istep = 0; // needed for disconnect during the update bman.players[pl_nr].net.net_istep = 0; // needed for disconnect during the update
bman.players_nr_s--; bman.players_nr_s--;
bman.players[pl_nr].gfx_nr = -1; bman.players[pl_nr].gfx_nr = -1;
if (GT_MP_PTPM && (GS_WAITRUNNING || bman.state == GS_update)) if (GT_MP_PTPM && (GS_WAITRUNNING || bman.state == GS_update)) {
for (i = 1; i < MAX_PLAYERS; i++) for (i = 1; i < MAX_PLAYERS; i++)
if (PS_IS_used (bman.players[i].state)) { if (PS_IS_used (bman.players[i].state)) {
send_quit (&bman.players[i].net.addr, host, port);j++;} send_quit (&bman.players[i].net.addr, host, port);
gamesrv_sendmode(bman.maxplayer,j); j++;
} }
gamesrv_sendmode (bman.maxplayer, j);
}
}
if (GT_MP_PTPM && bman.notifygamemaster) if (GT_MP_PTPM && bman.notifygamemaster)
gamesrv_sendmode (bman.maxplayer, bman.players_nr_s); gamesrv_sendmode (bman.maxplayer, bman.players_nr_s);
@ -698,10 +702,12 @@ net_send_chat (char *text, signed char notigamesrv)
}; };
void net_game_send_ill (int p_nr) { void
net_game_send_ill (int p_nr)
{
int i; int i;
d_printf ("net_game_send_ill (%d)\n", p_nr); d_printf ("net_game_send_ill (%d)\n", p_nr);
for (i = 0; i < MAX_PLAYERS; i++) for (i = 0; i < MAX_PLAYERS; i++)
if (PS_IS_used (bman.players[i].state) && i != bman.p_nr) if (PS_IS_used (bman.players[i].state) && i != bman.p_nr)
@ -724,7 +730,7 @@ net_host_new_game ()
bman.players[i].pos.y = bman.players[i].pos.x = -1; bman.players[i].pos.y = bman.players[i].pos.x = -1;
bman.players_nr = 0; bman.players_nr = 0;
game_set_playerposition(); game_set_playerposition ();
bman.players_nr_s = 0; bman.players_nr_s = 0;
for (p = 0; p < MAX_PLAYERS; p++) { for (p = 0; p < MAX_PLAYERS; p++) {
@ -734,16 +740,16 @@ net_host_new_game ()
bman.players[p].frame = 0; bman.players[p].frame = 0;
bman.players[p].frameto = 0; bman.players[p].frameto = 0;
if (PS_IS_used (bman.players[p].state)) { if (PS_IS_used (bman.players[p].state)) {
bman.players_nr_s++; bman.players_nr_s++;
if (bman.players[p].gfx_nr == -1) { if (bman.players[p].gfx_nr == -1) {
bman.players[p].gfx = NULL; bman.players[p].gfx = NULL;
bman.players[p].state &= (0xff - (PSF_alife + PSF_playing)); bman.players[p].state &= (0xff - (PSF_alife + PSF_playing));
} }
else { else {
bman.players[p].state |= PSF_alife + PSF_playing; bman.players[p].state |= PSF_alife + PSF_playing;
bman.players[p].gfx = &gfx.players[bman.players[p].gfx_nr]; bman.players[p].gfx = &gfx.players[bman.players[p].gfx_nr];
} }
} }
else else
bman.players[p].state = 0; bman.players[p].state = 0;

Loading…
Cancel
Save