diff -Nurd -Xfreeciv/diff_ignore freeciv/server/stdinhand.c nov30+spyoncmds/server/stdinhand.c --- freeciv/server/stdinhand.c Sat Dec 1 00:34:24 2001 +++ nov30+spyoncmds/server/stdinhand.c Sat Dec 1 00:34:50 2001 @@ -1167,7 +1167,7 @@ ) }, - {"endgame", ALLOW_CTRL, + {"endgame", ALLOW_HACK, "endgame", N_("End the game."), N_("This command ends the game immediately.") @@ -1176,8 +1176,12 @@ /* TRANS: translate text between <> only */ N_("remove "), N_("Fully remove player from game."), + /* N_("This *completely* removes a player from the game, including " "all cities and units etc. Use with care!") + */ + /* note: cannot be used once game has started due to problems with + player renumbering - make it ALLOW_HACK once this is repaired - rp */ }, {"save", ALLOW_HACK, /* TRANS: translate text between <> only */ @@ -1483,8 +1487,6 @@ if (send_server_info_to_metaserver(1,0)) { notify_player(0, _("Open metaserver connection to [%s]."), meta_addr_port()); - cmd_reply(CMD_METACONN, caller, C_OK, - _("Metaserver connection opened.")); } } @@ -1497,8 +1499,6 @@ server_close_udp(); notify_player(0, _("Close metaserver connection to [%s]."), meta_addr_port()); - cmd_reply(CMD_METACONN, caller, C_OK, - _("Metaserver connection closed.")); } } @@ -1550,8 +1550,6 @@ } else { notify_player(0, _("Metaserver infostring set to '%s'."), srvarg.metaserver_info_line); - cmd_reply(CMD_METAINFO, caller, C_OK, - _("Metaserver info string set.")); } } @@ -1567,8 +1565,6 @@ notify_player(0, _("Metaserver is now [%s]."), meta_addr_port()); - cmd_reply(CMD_METASERVER, caller, C_OK, - _("Metaserver address set.")); } /*************************************************************** @@ -1661,8 +1657,6 @@ pplayer->ai.control = !pplayer->ai.control; if (pplayer->ai.control) { notify_player(0, _("Game: %s is now AI-controlled."), pplayer->name); - cmd_reply(CMD_AITOGGLE, caller, C_OK, - _("%s is now under AI control."), pplayer->name); if (pplayer->ai.skill_level==0) { pplayer->ai.skill_level = game.skill_level; } @@ -1680,8 +1674,6 @@ assess_danger_player(pplayer); } else { notify_player(0, _("Game: %s is now human."), pplayer->name); - cmd_reply(CMD_AITOGGLE, caller, C_OK, - _("%s is now under human control."), pplayer->name); /* because the hard AI `cheats' with government rates but humans shouldn't */ if (!game.is_new_game) { @@ -1761,8 +1753,6 @@ pplayer->ai.control = 1; set_ai_level_directer(pplayer, game.skill_level); - cmd_reply(CMD_CREATE, caller, C_OK, - _("Created new AI player: %s."), pplayer->name); } @@ -1792,8 +1782,6 @@ sz_strlcpy(name, pplayer->name); server_remove_player(pplayer); if (caller==NULL || caller->used) { /* may have removed self */ - cmd_reply(CMD_REMOVE, caller, C_OK, - _("Removed player %s from the game."), name); } } @@ -2459,8 +2447,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(0, _("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); @@ -2470,12 +2458,10 @@ pplayer = get_player(i); 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)); } } - cmd_reply(cmd, caller, C_OK, - _("Setting game.skill_level to %d."), level); + notify_player(0, _("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); @@ -2668,11 +2654,9 @@ char *reject_message = NULL; if (!settings[cmd].func_change || settings[cmd].func_change(val, &reject_message)) { *(op->value) = val; - cmd_reply(CMD_SET, caller, C_OK, _("Option: %s has been set to %d."), - settings[cmd].name, val); - if (sset_is_to_client(cmd)) { - notify_player(0, _("Option: %s has been set to %d."), + notify_player(0, _("Option: %s has been set to %d."), settings[cmd].name, val); + if (sset_is_to_client(cmd)) { /* canonify map generator settings( all of which are int ) */ adjust_terrain_param(); /* send any modified game parameters to the clients -- @@ -2697,9 +2681,6 @@ if (!settings[cmd].func_change_s || settings[cmd].func_change_s(arg, &reject_message)) { strcpy(op->svalue, arg); - cmd_reply(CMD_SET, caller, C_OK, - _("Option: %s has been set to \"%s\"."), - op->name, op->svalue); if (sset_is_to_client(cmd)) { notify_player(0, _("Option: %s has been set to \"%s\"."), op->name, op->svalue); @@ -2743,7 +2724,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) { @@ -2813,6 +2794,18 @@ 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,args instead of str because of the trailing + * newline in str when it comes from the server command line + */ + notify_player(0, "%s: '%s %s'", + caller ? caller->name : "(server prompt)", command, arg); + } switch(cmd) { case CMD_REMOVE: