/* * Call the relevant command handler based on the first character of the * line (the command). */ static void ui_handle_command(char *line) { /* Find out what one-letter command was sent. */ switch (line[0]) { case 'c': ui_connect(line); break; case 'C': ui_config(line); break; case 'd': ui_delete(line); break; case 'D': ui_debug(line); break; case 'M': ui_setmode(line); break; case 'p': ui_packetlog(line); break; case 'Q': ui_shutdown_daemon(line); break; case 'R': reinit(); break; case 'S': ui_report_sa(line); break; case 'r': ui_report(line); break; case 't': ui_teardown(line); break; case 'T': ui_teardown_all(line); break; default: log_print("ui_handle_messages: unrecognized command: '%c'", line[0]); } }
/* -------------------------------------------------------------------------- * * Hauptschleife des Clients * * -------------------------------------------------------------------------- */ void client_run(void) { /* Mit dem Menu beginnen */ client_status = CLIENT_MAIN; while(client_status != CLIENT_EXIT) { switch(client_status) { /* Das Hauptmenu */ case CLIENT_MAIN: { ui_main(client_screen); break; } /* Konfiguration des Clients */ case CLIENT_CONFIG: { ui_config(client_screen); break; } /* Öffentlicher Chat und Spielübersicht */ case CLIENT_CHAT: { ui_chat(client_screen); break; } /* "Chat Channel" und Spieleinstellungen */ case CLIENT_SETTINGS: { ui_settings(client_screen); break; } case CLIENT_TEST: { ui_test(client_screen); break; } case CLIENT_GAME: { ui_game(client_screen); break; } case CLIENT_GAME_END: { ui_game_end(client_screen); client_status = CLIENT_CHAT; break; } } } }