fixed network games, part 4: added debug output for player mapping
authorHolger Schemel <info@artsoft.org>
Fri, 18 May 2018 12:49:21 +0000 (14:49 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 18 May 2018 12:49:21 +0000 (14:49 +0200)
src/game.c

index fbe9fd00ba8e1d705ad07b4d9d36c8ff873107f8..78a371e33896c5b7fd2af2d322f1b28792855935 100644 (file)
@@ -3558,6 +3558,24 @@ void InitGame()
   if (options.debug)
   {
     printf("Player status at level initialization:\n");
+
+    for (i = 0; i < MAX_PLAYERS; i++)
+    {
+      struct PlayerInfo *player = &stored_player[i];
+
+      printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
+            i + 1,
+            player->present,
+            player->connected,
+            player->connected_locally,
+            player->connected_network,
+            player->active);
+
+      if (local_player == player)
+       printf(" (local player)");
+
+      printf("\n");
+    }
   }
 #endif
 
@@ -3718,10 +3736,12 @@ void InitGame()
     {
       struct PlayerInfo *player = &stored_player[i];
 
-      printf("- player %d: present == %d, connected == %d, active == %d",
+      printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
             i + 1,
             player->present,
             player->connected,
+            player->connected_locally,
+            player->connected_network,
             player->active);
 
       if (local_player == player)
@@ -3824,10 +3844,12 @@ void InitGame()
     {
       struct PlayerInfo *player = &stored_player[i];
 
-      printf("- player %d: present == %d, connected == %d, active == %d",
+      printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
             i + 1,
             player->present,
             player->connected,
+            player->connected_locally,
+            player->connected_network,
             player->active);
 
       if (local_player == player)
@@ -3989,10 +4011,12 @@ void InitGame()
     {
       struct PlayerInfo *player = &stored_player[i];
 
-      printf("- player %d: present == %d, connected == %d, active == %d",
+      printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
             i + 1,
             player->present,
             player->connected,
+            player->connected_locally,
+            player->connected_network,
             player->active);
 
       if (local_player == player)
@@ -4208,10 +4232,12 @@ void InitGame()
       {
        struct PlayerInfo *player = &stored_player[i];
 
-       printf("- player %d: present == %d, connected == %d, active == %d",
+       printf("- player %d: present == %d, connected == %d [%d/%d], active == %d",
               i + 1,
               player->present,
               player->connected,
+              player->connected_locally,
+              player->connected_network,
               player->active);
 
        if (local_player == player)