Changeset 5309:91102861071a in roaraudio for plugins
- Timestamp:
- 11/29/11 00:11:46 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/roard/protocol-irc.c
r5308 r5309 33 33 static int on_quit(int client, const char * cmd, char * args, char * text); 34 34 static int on_ping(int client, const char * cmd, char * args, char * text); 35 static int on_lusers(int client, const char * cmd, char * args, char * text); 35 36 static int on_whois(int client, const char * cmd, char * args, char * text); 36 37 static int on_privmsg(int client, const char * cmd, char * args, char * text); … … 75 76 {"QUIT", on_quit}, 76 77 {"PING", on_ping}, 78 {"LUSERS", on_lusers}, 77 79 {"WHOIS", on_whois}, 78 80 {"PRIVMSG", on_privmsg}, … … 499 501 ); 500 502 503 on_lusers(client, NULL, NULL, NULL); 504 501 505 return 0; 502 506 } … … 621 625 } 622 626 627 static int on_lusers(int client, const char * cmd, char * args, char * text) { 628 const char * clientnick = get_nick(client); 629 size_t i; 630 size_t numchans = 0; 631 632 (void)cmd, (void)args, (void)text; 633 634 /* 635 :v0.fellig.org 251 nick :There are 9 users and 11 invisible on 1 servers 636 637 :v0.fellig.org 252 nick 1 :operator(s) online 638 639 :v0.fellig.org 254 nick 16 :channels formed 640 :v0.fellig.org 255 nick :I have 20 clients and 0 servers 641 :v0.fellig.org 265 nick :Current Local Users: 20 Max: 52 642 :v0.fellig.org 266 nick :Current Global Users: 20 Max: 22 643 */ 644 645 for (i = 0; i < MAX_CHANNELS; i++) { 646 if ( !g_channels[i].client_count ) 647 continue; 648 numchans++; 649 } 650 651 put_printf(client, ":%s 251 %s :There are %zu users and 0 invisible on 1 servers\n", 652 server_name, clientnick, counters_get(cur, clients)); 653 put_printf(client, ":%s 254 %s %zu :channels formed\n", 654 server_name, clientnick, numchans); 655 put_printf(client, ":%s 255 %s :I have %zu clients and 0 servers\n", 656 server_name, clientnick, counters_get(cur, clients)); 657 put_printf(client, ":%s 265 %s :Current Local Users: %zu Max: <unknown>\n", 658 server_name, clientnick, counters_get(cur, clients)); 659 put_printf(client, ":%s 266 %s :Current Global Users: %zu Max: <unknown>\n", 660 server_name, clientnick, counters_get(cur, clients)); 661 662 return 0; 663 } 664 623 665 static int on_whois(int client, const char * cmd, char * args, char * text) { 624 666 const char * clientnick = get_nick(client);
Note: See TracChangeset
for help on using the changeset viewer.