+ void handle_cmd(char cmd, char *arg)
+ {
+ switch (cmd) {
+ case CT_quit:
+ ShowPause(me);
+ refresh();
+ gameStatus = 0;
+ return;
+ case CT_pause:
+ if (Players[me].alive <= 0) return;
+ Players[me].flags ^= SCF_paused;
+ if (Game.started > 1)
+ Message(Players[me].flags & SCF_paused
+ ? "You paused the game" : "You unpaused the game");
+ else
+ Message(Players[me].flags & SCF_paused
+ ? "You are not ready" : "You are ready");
+ checkPaused();
+ if (game == GT_classicTwo)
+ SendPacket(me, NP_pause, 0, NULL);
+ ShowPause(me);
+ changed = 1;
+ return;
+ }
+ }
+
+ void handle_cmdstr(char *cmd)
+ {
+ char tag[17], value[81];
+ char *cmdend;
+ int i;
+
+ if ((cmdend = strchr(cmd, ' '))) {
+ *cmdend = 0;
+ } else {
+ cmdend = cmd + strlen(cmd); // whole string
+ }
+ for (i = 0; i < CT_MAX; i++){
+ if (!strcasecmp(cmds[i], cmd)) {
+ return handle_cmd(i, cmdend + 1);
+ }
+ }
+ Message("Unknown command /%s", cmd);
+ }
+
+ void handle_str(char *str)
+ {
+ if (chatText[0] == '/') {
+ if (chatText[1] != '/') {
+ handle_cmdstr(chatText + 1);
+ return;
+ }
+ memmove(chatText, chatText + 1, strlen(chatText));
+ }
+
+ Message("<\\%d%s\\7> %s",
+ Players[me].team > 7 ? 7 : Players[me].team,
+ Players[me].name, chatText);
+ if (game == GT_classicTwo)
+ SendPacket(me, NP_msg, strlen(chatText) + 1, chatText);
+ }
+