[Freeciv-Dev] (PR#40189) Pregame disconnect - reconnect leaves player under AI control

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40189 

 S2_2 and TRUNK

 1. Start server
 2. Connect client to it:
/list: List of players:
/list: 
--
/list: cazfi (user cazfi, Human, Team 0, not ready) 1 connection:
/list:   cazfi from localhost (command access level ctrl), bufsize=40kb
/list: AI*1 (user Unassigned, AI, difficulty level Easy, Team 1)
/list: AI*2 (user Unassigned, AI, difficulty level Easy, Team 2)
/list: AI*3 (user Unassigned, AI, difficulty level Easy, Team 3)
/list: AI*4 (user Unassigned, AI, difficulty level Easy, Team 4)
/list: 
--
We have control of the server (command access level hack)

 3. Cancel
 4. Reconnect:
/list: List of players:
/list: 
--
/list: cazfi (user cazfi, AI, difficulty level Easy, Team 0, not
ready) 1 connection:
/list:   cazfi from localhost (command access level ctrl), bufsize=40kb
/list: AI*2 (user Unassigned, AI, difficulty level Easy, Team 2)
/list: AI*3 (user Unassigned, AI, difficulty level Easy, Team 3)
/list: AI*4 (user Unassigned, AI, difficulty level Easy, Team 4)
/list: AI*5 (user Unassigned, AI, difficulty level Easy, Team 1)
/list: 
--
We have control of the server (command access level hack)



 - ML



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40190) [Patch] Rewritten handle_event()

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40190 

 Functional changes:

 - Popup for server operator message is shown to all clients, even
those attached to AI mode player
 - Always show messages that are configured to be shown somewhere. If
it cannot be shown where configured, show in chatline

 For S2_2 and TRUNK.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/climisc.c freeciv/client/climisc.c
--- freeciv/client/climisc.c	2008-03-16 23:46:31.0 +0200
+++ freeciv/client/climisc.c	2008-04-06 12:32:30.0 +0300
@@ -882,6 +882,9 @@
 		  enum event_type event, int conn_id)
 {
   int where = MW_OUTPUT;	/* where to display the message */
+  bool fallback_needed = FALSE; /* we want fallback if actual 'where' is not
+ * usable */
+  bool shown = FALSE;   /* Message displayed somewhere at least */
   
   if (event = E_LAST)  {
 /* Server may have added a new event; leave as MW_OUTPUT */
@@ -890,20 +893,38 @@
 where = messages_where[event];
   }
 
-  if (BOOL_VAL(where  MW_OUTPUT)
-  || C_S_RUNNING != client_state()) {
-/* When the game isn't running, the messages dialog isn't present and
- * we want to send all messages to the chatline.  There shouldn't be
- * any problem with server spam in pregame anyway. */
-append_output_window_full(message, conn_id);
+  /* Popup */
+  if (BOOL_VAL(where  MW_POPUP)) {
+/* Popups are usually not shown if player is under AI control.
+ * Server operator messages are shown always. */
+if (NULL == client.conn.playing
+|| !client.conn.playing-ai.control
+|| event == E_MESSAGE_WALL) {
+  popup_notify_goto_dialog(_(Popup Request), message, ptile);
+  shown = TRUE;
+} else {
+  /* Force to chatline so it will be visible somewhere at least.
+   * Messages window may still handle this so chatline is not needed
+   * after all. */
+  fallback_needed = TRUE;
+}
   }
+
+  /* Message window */
   if (BOOL_VAL(where  MW_MESSAGES)) {
-add_notify_window(message, ptile, event);
+/* When the game isn't running, the messages dialog isn't present. */
+if (C_S_RUNNING == client_state()) {
+  add_notify_window(message, ptile, event);
+  shown = TRUE;
+} else {
+  /* Force to chatline instead. */
+  fallback_needed = TRUE;
+}
   }
-  if (BOOL_VAL(where  MW_POPUP)
-   (NULL == client.conn.playing
-  || !client.conn.playing-ai.control)) {
-popup_notify_goto_dialog(_(Popup Request), message, ptile);
+
+  /* Chatline */
+  if (BOOL_VAL(where  MW_OUTPUT) || (fallback_needed  !shown)) {
+append_output_window_full(message, conn_id);
   }
 
   play_sound_for_event(event);
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39777) Command line options

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39777 

On 14/10/2007, Christian Knoke  wrote:
  ~$ civclient -- --help

  The last line (for bug reports) should appear in the output of

  ~$ civclient --help

  instead! At the current place, no one will find it.

 Attached patch adds bug address to client common side. It's not
removed from gui-specific help.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/civclient.c freeciv/client/civclient.c
--- freeciv/client/civclient.c	2008-03-08 16:13:03.0 +0200
+++ freeciv/client/civclient.c	2008-04-06 15:12:46.0 +0300
@@ -269,6 +269,9 @@
   fc_fprintf(stderr, _(  --\t\t
 			   Pass any following options to the UI.\n
 			   \t\t\tTry \%s -- --help\ for more.\n), argv[0]);
+  fc_fprintf(stderr, \n);
+  /* TRANS: No full stop after the URL, could cause confusion. */
+  fc_fprintf(stderr, _(Report bugs at %s\n), BUG_URL);
   exit(EXIT_SUCCESS);
 } else if (is_option(--version,argv[i])) {
   fc_fprintf(stderr, %s %s\n, freeciv_name_version(), client_string);
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40077) S2_2 memory leak in readline code

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40077 

On 04/02/2008, Jason Dorje Short  wrote:

  Pretty minor but the readline code may need some sort of function call
  for cleanup.

 There's no cleanup function in readline API. This leak is most likely
in readline (at least from our perspective. It doesn't matter if it's
readline itself or something it uses) If so, this should go to
freeciv.supp.


 - ML



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39965) Uncompressed Compressed savegames use differing whitespace

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39965 

On 13/12/2007, [EMAIL PROTECTED]  wrote:

  I noticed that savegames using no compression (level 0) and savegames using 
 compression (at least the default level 6) use completely different line end 
 whitespace, and so the the two files yield more differences than content.

 Cannot reproduce.

 Saving same game with all three different compresstypes (none, gzip,
and bzip2), uncompressing gzip and bzip2 saves with external tools and
then comparing md5sums of all the files shows no differences.

  Or perhaps WinRar is doing this to me... i dunno ;)

You use WinRar to uncompress savegames? I suspect it's adding Windows
-style linefeeds.

Closing ticket.


 - ML



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40188) Patch to freeciv-2.1 branch for Finnish (fi) translation of 2.1.4

2008-04-06 Thread Timo Jyrinki

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40188 

This transaction appears to have no content
Hi,

Attached would be a very small patch against freeciv-2.1 branch. It
updates only very few strings that were a bit subpar and highly visible
(most notably the one with extra underscore).

To Sini: let's keep in mind to change those also for 2.2  trunk when
either of us starts to actually do new translations (also klikkaa -
napsauta in general perhaps...)

-Timo

-- 
http://iki.fi/tjyrinki/
Index: po/fi.po
===
--- po/fi.po	(revision 14553)
+++ po/fi.po	(working copy)
@@ -10,7 +10,7 @@
 Project-Id-Version: freeciv 2.1\n
 Report-Msgid-Bugs-To: \n
 POT-Creation-Date: 2008-01-23 00:04-0500\n
-PO-Revision-Date: 2008-01-18 20:49+0200\n
+PO-Revision-Date: 2008-04-05 20:58+0300\n
 Last-Translator: Timo Jyrinki [EMAIL PROTECTED]\n
 Language-Team: Finnish [EMAIL PROTECTED]\n
 MIME-Version: 1.0\n
@@ -9804,12 +9804,12 @@
 
 #: client/text.c:609
 msgid (Click for more info)
-msgstr (Klikkaamalla saat lisätietoa)
+msgstr (Napsauttamalla lisätietoa)
 
 #: client/text.c:625
 #, c-format
 msgid %s People
-msgstr %s kansa
+msgstr %s kansalaista
 
 #: client/text.c:629
 #, c-format
@@ -11323,11 +11323,11 @@
 #: client/gui-gtk-2.0/menu.c:814 client/gui-gtk-2.0/menu.c:816
 #: data/Freeciv.in:2028
 msgid View
-msgstr Näytä
+msgstr Näkymä
 
 #: client/gui-gtk-2.0/gui_main.c:1208
 msgid Chat
-msgstr K_eskustele
+msgstr Keskustelu
 
 #: client/gui-gtk-2.0/gui_main.c:1224 client/gui-win32/gui_main.c:538
 #: data/Freeciv.in:2809
@@ -11647,7 +11647,7 @@
 
 #: client/gui-gtk-2.0/mapview.c:147
 msgid Shows your current luxury/science/tax rates;click to toggle them.
-msgstr Näyttää nykyisen luksus/tutkimus/vero -tasosi, klikkaa muuttaaksesi.
+msgstr Näyttää nykyisen luksus/tutkimus/vero -tasosi, napsauta muuttaaksesi.
 
 #: client/gui-gtk-2.0/mapview.c:692 client/gui-win32/canvas.c:275
 msgid Better fog will only work in truecolor.  Disabling it


signature.asc
Description: PGP signature
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40191) [Patch] Do not resend Edit Mode message to everyone when client connects

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40191 

 When new client connects, send Edit Mode notification only to that connection.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/connecthand.c freeciv/server/connecthand.c
--- freeciv/server/connecthand.c	2008-04-05 00:49:30.0 +0300
+++ freeciv/server/connecthand.c	2008-04-06 16:18:46.0 +0300
@@ -196,7 +196,7 @@
   }
 
   if (game.info.is_edit_mode) {
-notify_conn(NULL, NULL, E_SETTING,
+notify_conn(dest, NULL, E_SETTING,
 _( *** Server is in edit mode. *** ));
   }
 
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40184) [editor] Toolbar GUI front-end preliminary work

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40184 

On 04/04/2008, Madeline Book  wrote:

  A small preview of the editor toolbar in action, as
  described in the editor wikia page.
  I have also attached a screenshot if you do not have
  the time (or the means) to apply a git binary diff
  and compile the result (if you do, don't forget to
  run autogen.sh).

 Care to send editor.png separately so I can take just the code
changes from patch, and not to struggle with binary part? Looks like
good development.


 - ML



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40191) [Patch] Do not resend Edit Mode message to everyone when client connects

2008-04-06 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40191 

 [EMAIL PROTECTED] - Sun Apr 06 13:33:00 2008]:
 
  When new client connects, send Edit Mode notification only to that
 connection.

Quite correct, it was my mistake to use NULL instead of dest.


--
天国を滅ぼした男の話である。

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40184) [editor] Toolbar GUI front-end preliminary work

2008-04-06 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40184 

 [EMAIL PROTECTED] - Sun Apr 06 16:20:31 2008]:
 
 On 04/04/2008, Madeline Book  wrote:
 
   A small preview of the editor toolbar in action, as
   described in the editor wikia page.
   I have also attached a screenshot if you do not have
   the time (or the means) to apply a git binary diff
   and compile the result (if you do, don't forget to
   run autogen.sh).
 
  Care to send editor.png separately so I can take just the code
 changes from patch, and not to struggle with binary part?

Can do.


--
そして地獄に迷い込んだ女と会うこと。
inline: editor.png___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40192) [Patch] Fix civ1 ruleset syntax

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40192 

 Attempt to load civ1 ruleset fails because of illegal format. Fix attached.

 Non-fatal error about Airbase remains as there currently is no legal
format for disabling Airbases completely.


 - ML

diff -Nurd -X.diff_ignore freeciv/data/civ1/terrain.ruleset freeciv/data/civ1/terrain.ruleset
--- freeciv/data/civ1/terrain.ruleset	2007-10-29 21:10:35.0 +0200
+++ freeciv/data/civ1/terrain.ruleset	2008-04-06 22:15:56.0 +0300
@@ -495,7 +495,7 @@
 food = 0
 shield   = 0
 trade= 0
-resources= Seals
+resources= resource_seals
 road_trade_incr  = 0
 road_time= 4
 irrigation_result= no
@@ -1045,7 +1045,7 @@
 food = 0
 shield   = 1
 trade= 0
-resources= resource_gold
+resources= resource_gold
 road_trade_incr  = 0
 road_time= 6
 irrigation_result= no
@@ -1076,7 +1076,7 @@
 food = 0
 shield   = 1
 trade= 0
-resources= resource_gold
+resources= resource_gold
 road_trade_incr  = 0
 road_time= 6
 irrigation_result= no
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40194) Start button skips checks

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40194 

 start_game() is called from two distinct places.

 1) Command /start
 2) All human players indicate that they are ready by using Start -button

 There is some functionality in first that is never executed for case
two. Number of players is not checked against minplayers setting
(making it totally useless), there's no scenario sanity checking.


 - ML



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40195) [Patch] Fix several crashes if there's less nations than MAX_PLAYERS

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40195 

 If modpack has less than MAX_PLAYERS playable nations, server can run
out of nations to assign to players and crash. Attached patch prevents
several such cases.

 - There's no duplicate code for handling both start methods. #40194
should be fixed so that duplicate code is not needed. /start should be
correctly handled, Start-button not.
 - I have not yet investigated civil war player creation. It will
probably require fixing too.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/connecthand.c freeciv/server/connecthand.c
--- freeciv/server/connecthand.c	2008-04-03 20:14:42.0 +0300
+++ freeciv/server/connecthand.c	2008-04-07 00:14:17.0 +0300
@@ -475,7 +475,8 @@
 
   if (NULL == pplayer) {
 /* no uncontrolled player found */
-if (game.info.nplayers = game.info.max_players) {
+if (game.info.nplayers = game.info.max_players
+|| game.info.nplayers - server.nbarbarians = server.playable_nations) {
   return FALSE;
 }
 assert(game.info.nplayers  MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS);
diff -Nurd -X.diff_ignore freeciv/server/ruleset.c freeciv/server/ruleset.c
--- freeciv/server/ruleset.c	2008-04-01 22:40:44.0 +0300
+++ freeciv/server/ruleset.c	2008-04-07 00:17:33.0 +0300
@@ -2490,7 +2490,9 @@
 
 pl-is_playable = secfile_lookup_bool_default(file, TRUE,
 		  %s.is_playable, sec[i]);
-
+if (pl-is_playable) {
+  server.playable_nations++;
+}
 
 /* Check barbarian type. Default is None meaning not a barbarian */
 barb_type = secfile_lookup_str_default(file, None,
@@ -3554,6 +3556,7 @@
 
   ruleset_data_free();
   reset_player_nations();
+  server.playable_nations = 0;
 
   openload_ruleset_file(techfile, techs);
   load_tech_names(techfile);
@@ -3611,6 +3614,10 @@
 
   /* Build AI unit class cache corresponding to loaded rulesets */
   unit_class_ai_init();
+
+  /* We may need to adjust number of AI players if number of available
+   * nations changed */
+  aifill(game.info.aifill);
 }
 
 /**
diff -Nurd -X.diff_ignore freeciv/server/srv_main.c freeciv/server/srv_main.c
--- freeciv/server/srv_main.c	2008-04-01 22:40:44.0 +0300
+++ freeciv/server/srv_main.c	2008-04-07 00:15:10.0 +0300
@@ -1592,6 +1592,9 @@
 {
   int limit = MIN(amount, game.info.max_players);
 
+  /* Limit to nations provided by ruleset */
+  limit = MIN(limit, server.playable_nations);
+
   if (!game.info.is_new_game || S_S_INITIAL != server_state()) {
 return;
   }
@@ -2145,6 +2148,7 @@
 void server_game_init(void)
 {
   /* was redundantly in game_load() */
+  server.playable_nations = 0;
   server.nbarbarians = 0;
   server.identity_number = IDENTITY_NUMBER_SKIP;
 
diff -Nurd -X.diff_ignore freeciv/server/srv_main.h freeciv/server/srv_main.h
--- freeciv/server/srv_main.h	2008-03-10 19:54:21.0 +0200
+++ freeciv/server/srv_main.h	2008-04-07 00:11:53.0 +0300
@@ -60,6 +60,7 @@
  *
  * TODO: Lots more variables could be added here. */
 extern struct civserver {
+  int playable_nations;
   int nbarbarians;
 
   /* this counter creates all the city and unit numbers used.
diff -Nurd -X.diff_ignore freeciv/server/stdinhand.c freeciv/server/stdinhand.c
--- freeciv/server/stdinhand.c	2008-04-06 11:24:53.0 +0300
+++ freeciv/server/stdinhand.c	2008-04-07 00:40:09.0 +0300
@@ -818,13 +818,13 @@
 }
 
 /**
-...
+ Creates named AI player
 **/
 static bool create_ai_player(struct connection *caller, char *arg, bool check)
 {
   PlayerNameStatus PNameStatus;
   struct player *pplayer = NULL;
-   
+
   if (S_S_INITIAL != server_state())
   {
 cmd_reply(CMD_CREATE, caller, C_SYNTAX,
@@ -840,14 +840,19 @@
 }
   } players_iterate_end;
 
-  /* game.info.max_players is a limit on the number of non-observer players.
-   * MAX_NUM_PLAYERS is a limit on all players. */
-  if (game.info.nplayers = MAX_NUM_PLAYERS) {
-if (NULL == pplayer) {
+  if (NULL == pplayer) {
+/* Check that we are not going over max players setting */
+if (game.info.nplayers = game.info.max_players) {
   cmd_reply(CMD_CREATE, caller, C_FAIL,
 	_(Can't add more players, server is full.));
   return FALSE;
 }
+/* Check that we have nations available */
+if (game.info.nplayers - server.nbarbarians = server.playable_nations) {
+  cmd_reply(CMD_CREATE, caller, C_FAIL,
+	_(Can't add more players, not enough nations.));
+  return FALSE;
+}
   }
 
   if ((PNameStatus = test_player_name(arg)) == PNameEmpty)
@@ -2966,12 +2971,13 @@
* they first release. */
   if (!pplayer  !pconn-playing
(game.info.nplayers = game.info.max_players
-  || game.info.nplayers = MAX_NUM_PLAYERS + 

[Freeciv-Dev] (PR#40196) String comparison preoblems

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40196 

 S2_2

 1. Start server
 2. Connect client A with username 'cazfi'
 - There will be users 'cazfi' and 4 * easy AI
 3. Connect client B with username 'cazfi2'
 - Related to #40189, new user is under AI control and shown by
name easy AI
 4. Client B: From context menu of cazfi2 (first easy AI) Aitoggle Player
 - Server says Player name prefix 'cazfi2' is ambiguous.
 5. Client B: Cancel (to main menu)
 6. Client B: Reconnect with username 'caz'
 7. Client B: From context menu of caz (first easy AI) Aitoggle Player
- Server says cazfi is now under AI control.

 So it cannot distinguish between cazfi and cazfi2 , and selects
cazfi instead of caz.


 - ML



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40194) Start button skips checks

2008-04-06 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40194 

On 07/04/2008, Marko Lindqvist  wrote:

   start_game() is called from two distinct places.

   1) Command /start
   2) All human players indicate that they are ready by using Start -button

   There is some functionality in first that is never executed for case
  two. Number of players is not checked against minplayers setting
  (making it totally useless), there's no scenario sanity checking.

 Patch


 - ML

diff -Nurd -X.diff_ignore freeciv/server/srv_main.c freeciv/server/srv_main.c
--- freeciv/server/srv_main.c	2008-04-01 22:40:44.0 +0300
+++ freeciv/server/srv_main.c	2008-04-07 01:41:47.0 +0300
@@ -1578,9 +1578,8 @@
 		are ready to start.),
 		  num_ready, num_ready + num_unready);
 } else {
-  notify_conn(NULL, NULL, E_SETTING,
-		  _(All players are ready; starting game.));
-  start_game();
+  /* Check minplayers etc. and then start */
+  start_command(NULL, FALSE, TRUE);
 }
   }
 }
diff -Nurd -X.diff_ignore freeciv/server/stdinhand.c freeciv/server/stdinhand.c
--- freeciv/server/stdinhand.c	2008-04-06 11:24:53.0 +0300
+++ freeciv/server/stdinhand.c	2008-04-07 01:42:08.0 +0300
@@ -93,7 +93,6 @@
 static bool observe_command(struct connection *caller, char *name, bool check);
 static bool take_command(struct connection *caller, char *name, bool check);
 static bool detach_command(struct connection *caller, char *name, bool check);
-static bool start_command(struct connection *caller, char *name, bool check);
 static bool end_command(struct connection *caller, char *str, bool check);
 static bool surrender_command(struct connection *caller, char *str, bool check);
 
@@ -3695,7 +3694,7 @@
   case CMD_TIMEOUT:
 return timeout_command(caller, allargs, check);
   case CMD_START_GAME:
-return start_command(caller, arg, check);
+return start_command(caller, check, FALSE);
   case CMD_END_GAME:
 return end_command(caller, arg, check);
   case CMD_SURRENDER:
@@ -3756,9 +3755,9 @@
 }
 
 /**
-...
+ Handle start command. Notify all players about errors if notify set.
 **/
-static bool start_command(struct connection *caller, char *name, bool check)
+bool start_command(struct connection *caller, bool check, bool notify)
 {
   switch (server_state()) {
   case S_S_INITIAL:
@@ -3797,16 +3796,26 @@
 if (game.info.nplayers  game.info.min_players) {
   cmd_reply(CMD_START_GAME, caller, C_FAIL,
 		_(Not enough players, game will not start.));
+  if (notify) {
+notify_conn(NULL, NULL, E_SETTING,
+_(Not enough players, game will not start.));
+  }
   return FALSE;
 } else if (check) {
   return TRUE;
 } else if (!caller) {
+  if (notify) {
+notify_conn(NULL, NULL, E_SETTING,
+_(All players are ready; starting game.));
+  }
   start_game();
   return TRUE;
 } else if (NULL == caller-playing || !caller-playing-is_connected) {
   /* A detached or observer player can't do /start. */
   return TRUE;
 } else {
+  /* This might trigger recursive call to start_command() if this is
+   * last player who gets ready. In that case caller is NULL. */
   handle_player_ready(caller-playing, player_number(caller-playing), TRUE);
   return TRUE;
 }
diff -Nurd -X.diff_ignore freeciv/server/stdinhand.h freeciv/server/stdinhand.h
--- freeciv/server/stdinhand.h	2007-09-14 14:44:25.0 +0300
+++ freeciv/server/stdinhand.h	2008-04-07 01:28:38.0 +0300
@@ -33,7 +33,7 @@
 void show_players(struct connection *caller);
 
 bool load_command(struct connection *caller, char *arg, bool check);
-
+bool start_command(struct connection *caller, bool check, bool notify);
 
 void toggle_ai_player_direct(struct connection *caller,
 			 struct player *pplayer);
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] Question about freeciv and real economy

2008-04-06 Thread Mikail Ahundov
Hello. Sorry for my English

My friends and me are interested in everything about cybernetics in real 
economy.
May be you heard about Cybersyn - 
http://en.wikipedia.org/wiki/Project_Cybersyn. Stafford Beer - 
http://en.wikipedia.org/wiki/Stafford_Beer and his 
http://en.wikipedia.org/wiki/Viable_System_Model

Cybersyn uses cybernetic algorithms to compress dataflows, show them on 
displays in simple graphic way and to predict evolving of Chily economy.
But all solutions were taken by people-operators in  control rooms.

We want to stay a questions like
1) what informations do you have about systems like Cybersyn?
2) May be you heard about systems which control country economy fully 
automatically.
3) Do you know science works about automatic analyzing and controlling 
of country or big enterprises (communities) economies?
4) Can we use freeciv algorithms to create model of real country economy?
5) If not, than what we need to add to freeciv.
6) May be freeciv is close to some parts of real economy processes?
7) May be if we sometimes implement Cybersyn in some enterprise or 
community then can we use freeciv algorithms as mind booster for control 
rooms operators? If not freeciv algorithms, then which?

Thank you for answers!

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev