Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#10325) [Patch] Write log about game.seed & map.seed
Home

[Freeciv-Dev] (PR#10325) [Patch] Write log about game.seed & map.seed

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10325) [Patch] Write log about game.seed & map.seed
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Sat, 25 Sep 2004 08:17:59 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10325 >


  Debug messages telling what values seeds get when they are not 
explicitly set.


  - Caz


diff -Nurd -X.diff_ignore freeciv/server/generator/mapgen.c 
freeciv/server/generator/mapgen.c
--- freeciv/server/generator/mapgen.c   2004-09-24 22:50:12.531250000 +0300
+++ freeciv/server/generator/mapgen.c   2004-09-25 15:03:02.578125000 +0300
@@ -1003,8 +1003,10 @@
   /* save the current random state: */
   RANDOM_STATE rstate = get_myrand_state();
  
-  if (map.seed==0)
+  if (map.seed == 0) {
     map.seed = (myrand(MAX_UINT32) ^ time(NULL)) & (MAX_UINT32 >> 1);
+    freelog(LOG_DEBUG, "Setting map.seed:%d", map.seed);
+  }
 
   mysrand(map.seed);
 
diff -Nurd -X.diff_ignore freeciv/server/srv_main.c freeciv/server/srv_main.c
--- freeciv/server/srv_main.c   2004-09-24 22:50:12.546875000 +0300
+++ freeciv/server/srv_main.c   2004-09-25 15:03:46.156250000 +0300
@@ -157,6 +157,7 @@
     /* We strip the high bit for now because neither game file nor
        server options can handle unsigned ints yet. - Cedric */
     game.seed = time(NULL) & (MAX_UINT32 >> 1);
+    freelog(LOG_DEBUG, "Setting game.seed:%d", game.seed);
   }
  
   if (!myrand_is_init()) {

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10325) [Patch] Write log about game.seed & map.seed, Marko Lindqvist <=