--- freeciv/server/stdinhand.c Sat May 11 09:31:13 2002 +++ freeciv+spyoncmds/server/stdinhand.c Sat May 11 10:05:52 2002 @@ -1441,8 +1441,6 @@ if (send_server_info_to_metaserver(TRUE, FALSE)) { notify_player(NULL, _("Open metaserver connection to [%s]."), meta_addr_port()); - cmd_reply(CMD_METACONN, caller, C_OK, - _("Metaserver connection opened.")); } } @@ -1455,8 +1453,6 @@ server_close_udp(); notify_player(NULL, _("Close metaserver connection to [%s]."), meta_addr_port()); - cmd_reply(CMD_METACONN, caller, C_OK, - _("Metaserver connection closed.")); } } @@ -1508,8 +1504,6 @@ } else { notify_player(NULL, _("Metaserver infostring set to '%s'."), srvarg.metaserver_info_line); - cmd_reply(CMD_METAINFO, caller, C_OK, - _("Metaserver info string set.")); } } @@ -1525,8 +1519,6 @@ notify_player(NULL, _("Metaserver is now [%s]."), meta_addr_port()); - cmd_reply(CMD_METASERVER, caller, C_OK, - _("Metaserver address set.")); } /*************************************************************** @@ -1717,8 +1709,6 @@ pplayer->ai.control = TRUE; set_ai_level_directer(pplayer, game.skill_level); - cmd_reply(CMD_CREATE, caller, C_OK, - _("Created new AI player: %s."), pplayer->name); } @@ -2492,8 +2482,8 @@ if (pplayer) { if (pplayer->ai.control) { set_ai_level_directer(pplayer, level); - cmd_reply(cmd, caller, C_OK, - _("%s is now %s."), pplayer->name, name_of_skill_level(level)); + notify_player(NULL, _("Game: Player '%s' now has skill level '%s'."), + pplayer->name, name_of_skill_level(level)); } else { cmd_reply(cmd, caller, C_FAIL, _("%s is not controlled by the AI."), pplayer->name); @@ -2502,12 +2492,10 @@ players_iterate(pplayer) { if (pplayer->ai.control) { set_ai_level_directer(pplayer, level); - cmd_reply(cmd, caller, C_OK, - _("%s is now %s."), pplayer->name, name_of_skill_level(level)); } } players_iterate_end; - cmd_reply(cmd, caller, C_OK, - _("Setting game.skill_level to %d."), level); + notify_player(NULL, _("Game: AI players now have skill level '%s'."), + name_of_skill_level(level)); game.skill_level = level; } else { cmd_reply_no_such_player(cmd, caller, name, match_result); @@ -2784,11 +2772,8 @@ break; } - if (strlen(buffer) > 0) { - cmd_reply(CMD_SET, caller, C_OK, "%s", buffer); - if (sset_is_to_client(cmd)) { - notify_player(NULL, "%s", buffer); - } + if (strlen(buffer) > 0 && sset_is_to_client(cmd)) { + notify_player(NULL, "%s", buffer); } if (do_update) { @@ -2858,7 +2843,7 @@ Handle "command input", which could really come from stdin on console, or from client chat command, or read from file with -r, etc. caller==NULL means console, str is the input, which may optionally - start with SERVER_COMMAND_PREFIX character. + start with SERVER_COMMAND_PREFIX character **************************************************************************/ void handle_stdin_input(struct connection *caller, char *str) { @@ -2939,6 +2924,17 @@ i=strlen(arg)-1; while(i>0 && isspace(arg[i])) arg[i--]='\0'; + + if (commands[cmd].level > ALLOW_INFO) { + /* + * this command will affect the game - inform all players + * + * use command,arg instead of str because of the trailing + * newline in str when it comes from the server command line + */ + notify_player(NULL, "%s: '%s %s'", + caller ? caller->name : "(server prompt)", command, arg); + } switch(cmd) { case CMD_REMOVE: