rnd-20060329-2-src
authorHolger Schemel <info@artsoft.org>
Wed, 29 Mar 2006 19:22:12 +0000 (21:22 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:51:19 +0000 (10:51 +0200)
* fixed bug with allowing "focus on all players" in network games
* fixed bug with player focus when playing tapes from network games

ChangeLog
src/conftime.h
src/events.c
src/game.c
src/netserv.c
src/network.c

index b04a62339bcb55076d342f7aab62341e3918b643..8acd236ac118275f0c8b6809558e873c4fc46ef1 100644 (file)
--- 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
index 050751399b400cd81a4edc8470400850af16c06c..eb082f747ca60ba31646f7d7024b821f9d0b347a 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-03-29 19:24]"
+#define COMPILE_DATE_STRING "[2006-03-29 21:11]"
index b54623d4e030fbdff367497aad6f1788bbeb3df4..a818d96a57ea553433eb193846ca60c585005371 100644 (file)
@@ -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;
 
index bbcb6604b16bdccee0f34e8393092cd1bca4a158..bf69d768d419d47852261a9407d25cf5b11b8aa6 100644 (file)
@@ -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;
index f1f9a1a96528bb36198982d200f2f70474c3f7e7..8a41aee586b8caa48be7d43acee1ce6e1c34578c 100644 (file)
@@ -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);
   }
 
index 2f990f7f9911dad78be872df5e8c7cf67b920239..feb79bd9769d58098d75a5120d8aa457025a8fc5 100644 (file)
@@ -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",