From 5dc3a23a9fd3d63f47268393d6cb030f95a1e95e Mon Sep 17 00:00:00 2001 From: stpohle Date: Mon, 13 Dec 2004 21:29:29 +0000 Subject: [PATCH] team mode completed prepared for last test before release --- ChangeLog | 25 ++++++++++++------------- configure.in | 2 +- include/network.h | 4 ++-- src/game.c | 5 +++-- src/mapmenu.c | 5 +++-- src/multiwait.c | 13 +------------ src/network.c | 6 +++--- src/packets.c | 4 +++- src/player.c | 4 ++-- src/playermenu.c | 9 ++++++--- src/single.c | 4 ++-- 11 files changed, 38 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index de2432c..597a68d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ -$Id: ChangeLog,v 1.89 2004/12/05 19:43:34 stpohle Exp $ +$Id: ChangeLog,v 1.90 2004/12/13 21:29:29 stpohle Exp $ -* FINISH TEAM MODE. - -* Team Data won't be send by changes. +* FINISH TEAM MODE - counting points. + +- Fixed: Teamdata wasn't send right, net_send_playerid changed, + send_playerdata and do_playerdata fixed. - Fixed: Problems with the second local player join and leaving. Also the second local player won't get @@ -14,10 +15,16 @@ $Id: ChangeLog,v 1.89 2004/12/05 19:43:34 stpohle Exp $ part of the explosion_restore function. Explosion was growing on slow PC more as one field per cycle. -- AI Player die on a slow computer because they move more +- AI: Player die on a slow computer because they move more as 1 Field. This might be also the problem Acidjnk told me about. + Variable dir_change added so we won't have + anymore so many suicides. + + little more work on the AI, there are still some kind of + problems. Maybe i'll rewrite the whole AI again. + - fixed: Server starts the game soo fast that the client's ignore the gamestat for a running game. Check if all players are ready. @@ -34,16 +41,8 @@ $Id: ChangeLog,v 1.89 2004/12/05 19:43:34 stpohle Exp $ - fixed: AI won't have anymore so many suicide deaths. -- Variable dir_change added so we won't have - anymore so many suicides. - -- Playermenu (Playerselection changed again) - - New Team menu Handling. -- little work on the AI, there are still some kind of - problems. Maybe i'll rewrite the whole AI again. - - changed: Playermenu (F2 in the Playerselection screen). You will see some details about the other players and you can go to the teammenu from here. diff --git a/configure.in b/configure.in index 89de647..7be412f 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl Please disable it in the Anjuta project configuration AC_INIT(configure.in) AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE(bomberclone, 0.11.4test3) +AM_INIT_AUTOMAKE(bomberclone, 0.11.4) AM_CONFIG_HEADER(config.h) diff --git a/include/network.h b/include/network.h index 67123db..d441351 100644 --- a/include/network.h +++ b/include/network.h @@ -1,4 +1,4 @@ -/* $Id: network.h,v 1.21 2004/11/07 04:13:09 stpohle Exp $ +/* $Id: network.h,v 1.22 2004/12/13 21:29:30 stpohle Exp $ * network.h file... for everything what have to do with the network stuff */ @@ -101,7 +101,7 @@ extern int network_server_port (char *server, char *host, int hostlen, char *por extern void network_shutdown (); extern int network_init (); extern int network_loop (); -extern void net_change_playerid (int pl_nr); +extern void net_send_playerid (int pl_nr); extern void net_new_game (); extern void net_transmit_gamedata (); extern void net_game_send_player (int p_nr); diff --git a/src/game.c b/src/game.c index d3aaf29..6ba0d68 100644 --- a/src/game.c +++ b/src/game.c @@ -1,4 +1,4 @@ -/* $Id: game.c,v 1.104 2004/12/01 21:47:59 stpohle Exp $ +/* $Id: game.c,v 1.105 2004/12/13 21:29:30 stpohle Exp $ game.c - procedures for the game. */ #include @@ -427,6 +427,7 @@ game_end () if (bman.gametype == GT_team) { int t_nr; + bman.lastwinner = -1; cnt_left = 0; for (t_nr = 0; t_nr < MAX_TEAMS; t_nr++) for (i = 0; i < MAX_PLAYERS; i++) { @@ -435,8 +436,8 @@ game_end () if (bman.lastwinner != t_nr) { teams[t_nr].wins++; cnt_left++; + bman.lastwinner = t_nr; } - bman.lastwinner = t_nr; } } diff --git a/src/mapmenu.c b/src/mapmenu.c index 8fa74de..0225eef 100644 --- a/src/mapmenu.c +++ b/src/mapmenu.c @@ -1,4 +1,4 @@ -/* $Id: mapmenu.c,v 1.24 2004/09/12 20:54:24 stpohle Exp $ */ +/* $Id: mapmenu.c,v 1.25 2004/12/13 21:29:31 stpohle Exp $ */ /* map/tileset selection menu */ #include "bomberclone.h" @@ -153,6 +153,7 @@ mapmenu () map.size.y = MAX_FIELDSIZE_Y; config_write (); + if (GT_MP_PTPM) net_send_servermode (); } @@ -356,5 +357,5 @@ void mapgamesetting () { bman.gametype = gametype_sel- &gametype[0]; menuselect = -1; } - } + } }; diff --git a/src/multiwait.c b/src/multiwait.c index d8ed9da..e48e6c6 100644 --- a/src/multiwait.c +++ b/src/multiwait.c @@ -1,4 +1,4 @@ -/* $Id: multiwait.c,v 1.52 2004/11/30 14:30:36 stpohle Exp $ +/* $Id: multiwait.c,v 1.53 2004/12/13 21:29:31 stpohle Exp $ multiwait.c - this manages only the network screen where everyone have to select it's players and where even the basic chat is inside */ @@ -28,17 +28,6 @@ extern int UpdateRects_nr; extern int blitdb_nr; - -/* returns number of active players in a team -static int mw_team_is_used (int t_nr) { - int i,j=0; - for(i=0;istate))) { j++;} - d_printf("Team: %s : %d players\n",teams[t_nr].name,j); - return j; -} -*/ - /* this will load some graphics and so other stuff */ static void mw_init () { diff --git a/src/network.c b/src/network.c index 9f94964..156f81c 100644 --- a/src/network.c +++ b/src/network.c @@ -1,4 +1,4 @@ -/* $Id: network.c,v 1.70 2004/12/05 19:43:37 stpohle Exp $ */ +/* $Id: network.c,v 1.71 2004/12/13 21:29:31 stpohle Exp $ */ /* network routines. */ @@ -419,11 +419,11 @@ draw_netupdatestate (char st) used to update settings at startup */ void -net_change_playerid (int pl_nr) +net_send_playerid (int pl_nr) { int i; - d_printf ("net_change_playerid pl_nr:%d\n", pl_nr); + d_printf ("net_send_playerid pl_nr:%d\n", pl_nr); if (GT_MP_PTPM) { /* diff --git a/src/packets.c b/src/packets.c index e4dbe4f..bb9cf7d 100644 --- a/src/packets.c +++ b/src/packets.c @@ -367,7 +367,7 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr) /* Send all connected players the new PlayerID */ if (GT_MP_PTPM && GS_WAITRUNNING && addr->pl_nr >= 0 && addr->pl_nr < MAX_PLAYERS) - net_change_playerid (addr->pl_nr); + net_send_playerid (addr->pl_nr); } // d_playerdetail ("*** PLAYER List ***"); @@ -697,6 +697,7 @@ send_playerdata (_net_addr * addr, int p_nr, _player * pl) p_dat.frame = HTON16 (FTOI16 (pl->frame)); p_dat.p_nr = p_nr; p_dat.ready = pl->ready; + p_dat.team_nr = pl->team_nr; send_pkg ((struct pkg *) &p_dat, addr); }; @@ -722,6 +723,7 @@ do_playerdata (struct pkg_playerdata *p_dat, _net_addr * addr) if (bman.state == GS_running && bman.p_nr != p_dat->p_nr) { pl->points = NTOH16 (p_dat->points); pl->dead_by = NTOH16 (p_dat->dead_by); + pl->team_nr = p_dat->team_nr; } else if (bman.state != GS_running || bman.p_nr != p_dat->p_nr) { pl->pos.x = I16TOF (NTOH16 (p_dat->pos.x)); diff --git a/src/player.c b/src/player.c index b80bda1..00bfbd6 100644 --- a/src/player.c +++ b/src/player.c @@ -1,4 +1,4 @@ -/* $Id: player.c,v 1.95 2004/12/05 19:43:37 stpohle Exp $ +/* $Id: player.c,v 1.96 2004/12/13 21:29:31 stpohle Exp $ * player.c - everything what have to do with the player */ #include @@ -841,7 +841,7 @@ player_set_gfx (_player * p, signed char gfx_nr) p->gfx = &gfx.players[gfx_nr]; p->state |= PSF_playing; } - if (GT_MP) net_change_playerid (p-players); + if (GT_MP) net_send_playerid (p-players); }; diff --git a/src/playermenu.c b/src/playermenu.c index b7ee4b1..e412475 100644 --- a/src/playermenu.c +++ b/src/playermenu.c @@ -1,4 +1,4 @@ -/* $Id: playermenu.c,v 1.14 2004/12/05 19:43:37 stpohle Exp $ +/* $Id: playermenu.c,v 1.15 2004/12/13 21:29:31 stpohle Exp $ */ #include "bomberclone.h" @@ -313,7 +313,7 @@ void playermenu () { } if (done == 1 && menu->focus->id == 2) { /* create ai player */ - net_change_playerid (single_create_ai (1)); + net_send_playerid (single_create_ai (1)); done = 0; } @@ -326,6 +326,8 @@ void playermenu () { done = 0; players[sel_pl_nr].team_nr = teammenu_select (&players[sel_pl_nr]); bman.updatestatusbar = 1; + if (GT_MP) + net_send_playerid (sel_pl_nr); } if (done == 1 && menu->focus->id == 4) { /* kick player */ @@ -340,7 +342,8 @@ void playermenu () { } while ((done == 0 || menu->focus->id != 5) && done != -1); team_update (); - ai_team_choosegfx (); + if (GT_SP || GT_MP_PTPM) + ai_team_choosegfx (); menu_delete (menu); }; diff --git a/src/single.c b/src/single.c index def911b..9e682e4 100644 --- a/src/single.c +++ b/src/single.c @@ -1,4 +1,4 @@ -/* $Id: single.c,v 1.80 2004/11/30 14:30:37 stpohle Exp $ */ +/* $Id: single.c,v 1.81 2004/12/13 21:29:31 stpohle Exp $ */ /* single player */ #include "basic.h" @@ -490,7 +490,7 @@ single_create_ai (int num_players) try, gfx_sel, i = 0; - _player *pl; + _player *pl = NULL; for (count = 0; count < num_players; count++) { /* find free players */