/* * XPilot NG, a multiplayer space war game. * * Copyright (C) 1991-2001 by * * Bjørn Stabell * Ken Ronny Schouten * Bert Gijsbers * Dick Balaska * * Copyright (C) 2003-2004 Kristian Söderblom * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "xpclient.h" const char c_commands[][16] = { "ignore", "i", "ignore!", "i!", "unignore", "u", "help", "h", "set", "s", "get", "g", "quit", "q", }; static void print_ignorelist(void) { char buffer[MAX_CHARS] = ""; int i; unsigned short check = 0; for (i = 0; i < num_others; i++) { if (Others[i].ignorelevel == 1) { if (strlen(buffer) + strlen(Others[i].nick_name) + 17 > MAX_CHARS) { strcat(buffer, "[*Client reply*]"); Add_message(buffer); buffer[0] = '\0'; } strcat(buffer, Others[i].nick_name); strcat(buffer, " "); check = 1; } else if (Others[i].ignorelevel == 2) { if (strlen(buffer) + strlen(Others[i].nick_name) + 18 > MAX_CHARS) { strcat(buffer, "[*Client reply*]"); Add_message(buffer); buffer[0] = '\0'; } strcat(buffer, "!"); strcat(buffer, Others[i].nick_name); strcat(buffer, " "); check = 1; } } if (check) { strcat(buffer, "[*Client reply*]"); Add_message(buffer); } else Add_message("Ignorelist is empty. [*Client reply*]"); } static void print_help(const char *arg) { int i; char message[MAX_CHARS] = ""; /*Add_message(arg);*/ if (arg == NULL) { for (i = 0; i < NELEM(c_commands); i += 2) { strcat(message, c_commands[i]); strcat(message, " "); } strcat(message, "[*Client reply*]"); Add_message(message); } else { for (i = 0; i < NELEM(c_commands); i++) { if (!strcmp(arg, c_commands[i])) break; } switch (i) { case 0: /* ignore */ case 1: /* i */ Add_message("'\\ignore ' ignores by changing " "text to ***'s. [*Client reply*]"); Add_message("Just '\\ignore' shows list of ignored players " "[*Client reply*]"); break; case 2: /* ignore! */ case 3: /* i! */ Add_message("'\\ignore! ' ignores completely. " "[*Client reply*]"); break; case 4: /* unignore */ case 5: /* u */ Add_message("'\\unignore ' allows messages from " "again. [*Client reply*]"); break; case 6: /* help */ case 7: /* h */ Add_message("'\\help ' shows help about . " "Just '\\help' show avaiable commands " "[*Client reply*]"); break; case 8: /* set */ case 9: /* s */ Add_message("'\\set