MasterServer Send Game information FIXED

origin
stpohle 23 years ago
parent ea434d8194
commit 3d66e93f2b

@ -406,7 +406,7 @@ net_new_gamedata ()
Uint8 *keys;
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 ();
if (GT_MP_PTPM)
@ -541,16 +541,16 @@ net_game_send_player (int p_nr)
{
int p;
if (GT_MP_PTPM) {
for (p = 0; p < MAX_PLAYERS; p++)
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]);
}
else if (p_nr == bman.p_nr) {
for (p = 0; p < MAX_PLAYERS; p++)
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]);
}
if (GT_MP_PTPM) {
for (p = 0; p < MAX_PLAYERS; p++)
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]);
}
else if (p_nr == bman.p_nr) {
for (p = 0; p < MAX_PLAYERS; p++)
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]);
}
};
@ -607,7 +607,8 @@ net_delplayer (int pl_nr)
{
char host[LEN_SERVERNAME];
char port[LEN_PORT];
int i,j=1;
int i,
j = 1;
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].net.net_istep = 0; // needed for disconnect during the update
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++)
if (PS_IS_used (bman.players[i].state)) {
send_quit (&bman.players[i].net.addr, host, port);j++;}
gamesrv_sendmode(bman.maxplayer,j);
}
send_quit (&bman.players[i].net.addr, host, port);
j++;
}
gamesrv_sendmode (bman.maxplayer, j);
}
}
if (GT_MP_PTPM && bman.notifygamemaster)
gamesrv_sendmode (bman.maxplayer, bman.players_nr_s);
@ -698,11 +702,13 @@ 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;
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++)
if (PS_IS_used (bman.players[i].state) && i != bman.p_nr)
send_ill (&bman.players[i].net.addr, p_nr, &bman.players[p_nr]);
@ -718,14 +724,14 @@ net_host_new_game ()
{
int p,
i;
// set players thier fields
for (i = 0; i < MAX_PLAYERS; i++)
bman.players[i].pos.y = bman.players[i].pos.x = -1;
bman.players_nr = 0;
game_set_playerposition();
game_set_playerposition ();
bman.players_nr_s = 0;
for (p = 0; p < MAX_PLAYERS; p++) {
bman.players[p].pos.x = bman.players[p].pos.x << 8;
@ -734,16 +740,16 @@ net_host_new_game ()
bman.players[p].frame = 0;
bman.players[p].frameto = 0;
if (PS_IS_used (bman.players[p].state)) {
bman.players_nr_s++;
if (bman.players[p].gfx_nr == -1) {
bman.players[p].gfx = NULL;
bman.players[p].state &= (0xff - (PSF_alife + PSF_playing));
}
else {
bman.players[p].state |= PSF_alife + PSF_playing;
bman.players[p].gfx = &gfx.players[bman.players[p].gfx_nr];
}
if (PS_IS_used (bman.players[p].state)) {
bman.players_nr_s++;
if (bman.players[p].gfx_nr == -1) {
bman.players[p].gfx = NULL;
bman.players[p].state &= (0xff - (PSF_alife + PSF_playing));
}
else {
bman.players[p].state |= PSF_alife + PSF_playing;
bman.players[p].gfx = &gfx.players[bman.players[p].gfx_nr];
}
}
else
bman.players[p].state = 0;

Loading…
Cancel
Save