Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] (PR#5488) players need info about diplomatic relations wit
Home

[Freeciv-Dev] (PR#5488) players need info about diplomatic relations wit

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#5488) players need info about diplomatic relations without embassy
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 4 Nov 2003 03:26:23 -0800
Reply-to: rt@xxxxxxxxxxxxxx

[per - Thu Aug 28 11:58:58 2003]:
> Good point. Then we need a rules change: Players should know the
> diplomatic relations of any player they are in contact with (meaning they
> can do diplomacy with that player).

Since the design-board has approved this change, here is a patch. Will
be committed soon unless objections.

  - Per
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.295
diff -u -r1.295 plrhand.c
--- server/plrhand.c    13 Oct 2003 06:55:22 -0000      1.295
+++ server/plrhand.c    4 Nov 2003 11:24:36 -0000
@@ -1264,24 +1264,8 @@
   packet->gold            = plr->economic.gold;
   packet->government      = plr->government;
 
-  if (info_level >= INFO_EMBASSY) {
-    for (i = A_FIRST; i < game.num_tech_types; i++) {
-      packet->inventions[i] = plr->research.inventions[i].state + '0';
-    }
-    packet->inventions[i]   = '\0';
-    packet->tax             = plr->economic.tax;
-    packet->science         = plr->economic.science;
-    packet->luxury          = plr->economic.luxury;
-    packet->bulbs_researched= plr->research.bulbs_researched;
-    packet->techs_researched= plr->research.techs_researched;
-    packet->researching     = plr->research.researching;
-    packet->future_tech     = plr->future_tech;
-    if (plr->revolution != 0) {
-      packet->revolution    = 1;
-    } else {
-      packet->revolution    = 0;
-    }
-
+  if (info_level >= INFO_EMBASSY
+      || receiver->diplstates[plr->player_no].contact_turns_left > 0) {
     packet->embassy = plr->embassy;
     packet->gives_shared_vision = plr->gives_shared_vision;
     for(i = 0; i < MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS; i++) {
@@ -1292,19 +1276,6 @@
       packet->diplstates[i].has_reason_to_cancel = 
plr->diplstates[i].has_reason_to_cancel;
     }
   } else {
-    for (i = A_FIRST; i < game.num_tech_types; i++) {
-      packet->inventions[i] = '0';
-    }
-    packet->inventions[i]   = '\0';
-    packet->tax             = 0;
-    packet->science         = 0;
-    packet->luxury          = 0;
-    packet->bulbs_researched= 0;
-    packet->techs_researched= 0;
-    packet->researching     = A_NOINFO;
-    packet->future_tech     = 0;
-    packet->revolution      = 0;
-
     if (!receiver || !player_has_embassy(plr, receiver)) {
       packet->embassy  = 0;
     } else {
@@ -1322,7 +1293,7 @@
       packet->diplstates[i].has_reason_to_cancel = 0;
       packet->diplstates[i].contact_turns_left = 0;
     }
-    /* We always know the players relation to us */
+    /* We always know the player's relation to us */
     if (receiver) {
       int p_no = receiver->player_no;
 
@@ -1333,6 +1304,38 @@
       packet->diplstates[p_no].has_reason_to_cancel =
        plr->diplstates[p_no].has_reason_to_cancel;
     }
+  }
+
+  if (info_level >= INFO_EMBASSY) {
+    for (i = A_FIRST; i < game.num_tech_types; i++) {
+      packet->inventions[i] = plr->research.inventions[i].state + '0';
+    }
+    packet->inventions[i]   = '\0';
+    packet->tax             = plr->economic.tax;
+    packet->science         = plr->economic.science;
+    packet->luxury          = plr->economic.luxury;
+    packet->bulbs_researched= plr->research.bulbs_researched;
+    packet->techs_researched= plr->research.techs_researched;
+    packet->researching     = plr->research.researching;
+    packet->future_tech     = plr->future_tech;
+    if (plr->revolution != 0) {
+      packet->revolution    = 1;
+    } else {
+      packet->revolution    = 0;
+    }
+  } else {
+    for (i = A_FIRST; i < game.num_tech_types; i++) {
+      packet->inventions[i] = '0';
+    }
+    packet->inventions[i]   = '\0';
+    packet->tax             = 0;
+    packet->science         = 0;
+    packet->luxury          = 0;
+    packet->bulbs_researched= 0;
+    packet->techs_researched= 0;
+    packet->researching     = A_NOINFO;
+    packet->future_tech     = 0;
+    packet->revolution      = 0;
   }
 
   /* We have to inform the client that the other players also know

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#5488) players need info about diplomatic relations without embassy, Per I. Mathisen <=