Index: client/options.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/options.c,v retrieving revision 1.40 diff -u -r1.40 options.c --- client/options.c 2001/07/04 11:24:19 1.40 +++ client/options.c 2001/09/04 18:05:21 @@ -161,6 +161,7 @@ N_("Wonder Will Be Finished Next Turn"), /* E_CITY_WONDER_WILL_BE_BUILT */ N_("Learned New Government"), /* E_NEW_GOVERNMENT */ N_("City Nuked"), /* E_CITY_NUKED */ + N_("Messages from the Server Operator"), /* E_MESSAGE_WALL*/ }; /************************************************************************** @@ -184,6 +185,7 @@ { int out_only[] = {E_IMP_BUY, E_IMP_SOLD, E_UNIT_BUY, E_MY_DIPLOMAT, E_UNIT_LOST_ATT, E_UNIT_WIN_ATT}; + int all[] = {E_MESSAGE_WALL}; int i; for(i=0; i<E_LAST; i++) { @@ -191,6 +193,9 @@ } for(i=0; i<sizeof(out_only)/sizeof(int); i++) { messages_where[out_only[i]] = MW_OUTPUT; + } + for(i=0; i<sizeof(all)/sizeof(int); i++) { + messages_where[all[i]] = MW_OUTPUT | MW_MESSAGES | MW_POPUP; } for(i=0;i<E_LAST;i++) { Index: common/events.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/events.h,v retrieving revision 1.17 diff -u -r1.17 events.h --- common/events.h 2001/07/04 11:24:21 1.17 +++ common/events.h 2001/09/04 18:05:21 @@ -60,6 +60,7 @@ E_CITY_WONDER_WILL_BE_BUILT, E_NEW_GOVERNMENT, E_CITY_NUKED, + E_MESSAGE_WALL, /* Note: If you add a new event, make sure you make a similar change to message_text in client/options.c */ Index: server/stdinhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v retrieving revision 1.189 diff -u -r1.189 stdinhand.c --- server/stdinhand.c 2001/09/02 13:38:00 1.189 +++ server/stdinhand.c 2001/09/04 18:05:21 @@ -903,6 +903,7 @@ CMD_EXPLAIN, CMD_SHOW, CMD_SCORE, + CMD_WALL, /* mostly non-harmful: */ CMD_SET, @@ -1017,6 +1018,12 @@ N_("For each connected client, pops up a window showing the current " "player scores.") }, + {"wall", ALLOW_HACK, + N_("wall <message>"), + N_("Send message to all connections."), + N_("For each connected client, pops up a window showing the message " + "entered.") + }, {"set", ALLOW_CTRL, N_("set <option-name> <value>"), N_("Set server options.") @@ -2324,6 +2331,17 @@ show_help_option_list(caller, CMD_EXPLAIN); } } +/****************************************************************** + Send a message to all players +******************************************************************/ +static void wall(char *str) +{ + char wallbuffer[2048]; + wallbuffer[0]=0; + cat_snprintf(wallbuffer, sizeof(wallbuffer),"%s",str); + notify_conn_ex(&game.game_connections,-1,-1,E_MESSAGE_WALL, + _("Server Operator: %s"),wallbuffer); +} /****************************************************************** Send a report with server options to specified connections. @@ -2826,6 +2844,9 @@ cmd_reply(cmd, caller, C_SYNTAX, _("The game must be running before you can see the score.")); } + break; + case CMD_WALL: + wall(arg); break; case CMD_READ_SCRIPT: read_command(caller,arg);