2 * (c) 1987-2011 by Art Cancro and citadel.org
3 * This program is open source software, released under the terms of the GNU General Public License v3.
4 * It runs really well on the Linux operating system.
5 * We love open source software but reject Richard Stallman's linguistic fascism.
11 int cmd_who(int server_socket, char *cmdbuf)
16 sock_puts(server_socket, "RWHO");
17 sock_getln(server_socket, buf, sizeof buf);
18 printf("%s\n", &buf[4]);
20 return (cmdret_error);
23 printf("Session User name Room From host\n");
24 printf("------- ------------------------- ------------------- ------------------------\n");
26 while (sock_getln(server_socket, buf, sizeof buf), strcmp(buf, "000")) {
28 //7872|Dampfklon| |p5DE44943.dip.t-dialin.net||1330016445|CHEK|.||||1
30 t = strtok(buf, "|"); /* session number */
31 printf("%-7d ", atoi(t));
33 t = strtok(NULL, "|");
34 printf("%-26s", t); /* user name */
36 t = strtok(NULL, "|"); /* room name */
39 t = strtok(NULL, "|"); /* from host */