Skip to content

Commit

Permalink
Unify comms client/server help text
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
  • Loading branch information
smcameron committed Oct 13, 2023
1 parent c9bd8de commit dc1b7c0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
5 changes: 5 additions & 0 deletions help_text_comms_screen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@
" * /help\n"
" * /channel channel-number - change current channel\n"
" * /computer <english request for computer>\n"
" * /eject cargo-bay-number - eject cargo\n"
" * /hail ship-name - hail ship on current channel\n"
" * /inventory - report inventory of ship's cargo hold\n"
" * /passengers - report list of passengers\n"
" * /antenna <bearing> <mark> - aim the high gain antenna\n"
" * /about - information about the game\n"
ESC_OR_F1_HELP_TEXT,
40 changes: 19 additions & 21 deletions snis_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -15755,30 +15755,28 @@ typedef void (*meta_comms_func)(char *name, struct game_client *c, char *txt);
static void meta_comms_help(__attribute__((unused)) char *name, struct game_client *c,
__attribute__((unused)) char *txt)
{
int i;
char buffer[256];
int i, j;
#define ESC_OR_F1_HELP_TEXT
#define FKEYS_HELP_TEXT
const char *hlptxt[] = {
"COMMUNICATIONS",
" CONTROLS",
" * ZOOM CONTROLS MAIN SCREEN ZOOM",
" * RED ALERT SOUNDS RED ALERT ALARM",
" * TOP ROW OF BUTTONS CONTROLS MAIN SCREEN",
" COMMANDS",
" * COMMANDS ARE PRECEDED BY FORWARD SLASH -> /",
" * /help",
" * /computer <english request for computer>",
" * /channel channel-number - change current channel",
" * /eject cargo-bay-number - eject cargo",
" * /hail ship-name - hail ship or starbase on current channel",
" * /inventory - report inventory of ship's cargo hold",
" * /passengers - report list of passengers",
" * /antenna <bearing> <mark> - aim the high gain antenna",
" * /about - information about the game",
"",
0,
#include "help_text_comms_screen.txt"
};
for (i = 0; hlptxt[i]; i++)
send_comms_packet(NULL, "", bridgelist[c->bridge].comms_channel, hlptxt[i]);

for (i = 0, j = 0; 1; i++) {
buffer[j] = hlptxt[0][i];
if (buffer[j] == '\n' || buffer[j] == '\0') {
buffer[j] = '\0';
j = 0;
send_comms_packet(NULL, "", bridgelist[c->bridge].comms_channel, buffer);
} else {
j++;
}
if (hlptxt[0][i] == '\0')
break;
}
}


static void meta_comms_about(__attribute__((unused)) char *name, struct game_client *c,
__attribute__((unused)) char *txt)
Expand Down

0 comments on commit dc1b7c0

Please sign in to comment.