From ee77ce3259f523c93305be15ed5c114a79aea181 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 29 Mar 2006 21:22:12 +0200 Subject: [PATCH] rnd-20060329-2-src * fixed bug with allowing "focus on all players" in network games * fixed bug with player focus when playing tapes from network games --- ChangeLog | 2 ++ src/conftime.h | 2 +- src/events.c | 2 +- src/game.c | 23 ++++++++++++++++++++--- src/netserv.c | 4 ++-- src/network.c | 7 +++++++ 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b04a6233..8acd236a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ * fixed bug with not scrolling the screen in multi-player mode with the focus on player 1 when all players are moving in different directions * fixed bug with keeping pointer to gadget even after its deallocation + * fixed bug with allowing "focus on all players" in network games + * fixed bug with player focus when playing tapes from network games 2006-03-22 * uploaded pre-release (test) version 3.2.0-7 binary and source code diff --git a/src/conftime.h b/src/conftime.h index 05075139..eb082f74 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-03-29 19:24]" +#define COMPILE_DATE_STRING "[2006-03-29 21:11]" diff --git a/src/events.c b/src/events.c index b54623d4..a818d96a 100644 --- a/src/events.c +++ b/src/events.c @@ -697,7 +697,7 @@ void HandleKey(Key key, int key_status) TapeTogglePause(TAPE_TOGGLE_MANUAL); } - if (game_status == GAME_MODE_PLAYING) + if (game_status == GAME_MODE_PLAYING && !network_playing) { int centered_player_nr_next = -999; diff --git a/src/game.c b/src/game.c index bbcb6604..bf69d768 100644 --- a/src/game.c +++ b/src/game.c @@ -2031,9 +2031,23 @@ void InitGame() game.envelope_active = FALSE; - game.centered_player_nr = game.centered_player_nr_next = -1; /* focus all */ + /* set focus to local player for network games, else to all players */ + game.centered_player_nr = (network_playing ? local_player->index_nr : -1); + game.centered_player_nr_next = game.centered_player_nr; game.set_centered_player = FALSE; + if (network_playing && tape.recording) + { + /* store client dependent player focus when recording network games */ + tape.centered_player_nr_next = game.centered_player_nr_next; + tape.set_centered_player = TRUE; + } + +#if 0 + printf("::: focus set to player %d [%d]\n", + game.centered_player_nr, local_player->index_nr); +#endif + for (i = 0; i < NUM_BELTS; i++) { game.belt_dir[i] = MV_NONE; @@ -12856,7 +12870,10 @@ static void HandleGameButtons(struct GadgetInfo *gi) switch (id) { case GAME_CTRL_ID_STOP: - RequestQuitGame(TRUE); + if (tape.playing) + TapeStop(); + else + RequestQuitGame(TRUE); break; case GAME_CTRL_ID_PAUSE: @@ -12883,7 +12900,7 @@ static void HandleGameButtons(struct GadgetInfo *gi) #endif { tape.pausing = FALSE; - DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF,0); + DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF, 0); } } break; diff --git a/src/netserv.c b/src/netserv.c index f1f9a1a9..8a41aee5 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -293,11 +293,11 @@ static void Handle_OP_NUMBER_WANTED(struct NetworkServerPlayerInfo *player) Error(ERR_NETWORK_SERVER, "client %d (%s) switches to # %d", player->number, player->player_name, nr_wanted); else if (player->number == nr_wanted) - Error(ERR_NETWORK_SERVER, "client %d (%s) still has # %d", + Error(ERR_NETWORK_SERVER, "client %d (%s) already has # %d", player->number, player->player_name, nr_wanted); else Error(ERR_NETWORK_SERVER, - "client %d (%s) cannot switch (client %d still exists)", + "client %d (%s) cannot switch (client %d already exists)", player->number, player->player_name, nr_wanted); } diff --git a/src/network.c b/src/network.c index 2f990f7f..feb79bd9 100644 --- a/src/network.c +++ b/src/network.c @@ -431,11 +431,18 @@ static void Handle_OP_NUMBER_WANTED() } else if (old_client_nr == first_player.nr) /* failed -- local player? */ { +#if 0 char *color[] = { "yellow", "red", "green", "blue" }; +#endif char request[100]; +#if 1 + sprintf(request, "Sorry ! Player %d already exists ! You are player %d !", + index_nr_wanted + 1, new_index_nr + 1); +#else sprintf(request, "Sorry ! %s player still exists ! You are %s player !", color[index_nr_wanted], color[new_index_nr]); +#endif Request(request, REQ_CONFIRM); Error(ERR_NETWORK_CLIENT, "cannot switch -- you keep client # %d", -- 2.34.1