int irc_command ( char * message, struct __user *us ) { _usr = us; msg = message;//strdup ( message ); msg = s_upercommand ( msg ); if ( _usr->registered == NO ){ if ((strncmp (msg, "PASS", 4)) == 0) return irc_do_pass(); if ((strncmp (msg, "USER", 4)) == 0) return irc_do_user(); if ((strncmp (msg, "NICK", 4)) == 0) return irc_do_nick(); } else { if ((strncmp (msg, "NICK", 4)) == 0) irc_do_nick(); else if ((strncmp ( msg, "USERS",5)) == 0) irc_do_users(); else if ((strncmp ( msg, "LUSERS",6)) == 0) irc_do_users(); else if ((strncmp ( msg, "LIST", 4)) == 0) irc_do_list(); else if ((strncmp ( msg, "JOIN", 4)) == 0) irc_do_join(); else if ((strncmp ( msg, "PART", 4)) == 0) irc_do_part(); else if ((strncmp ( msg, "TOPIC", 5)) == 0) irc_do_topic(); else if ((strncmp ( msg, "VERSION", 7)) == 0) irc_do_version(); else if ((strncmp ( msg, "INVITE" , 6)) == 0) irc_do_invite(); else if ((strncmp ( msg, "KICK", 4)) == 0) irc_do_kick(); else if ((strncmp ( msg, "NAMES", 5)) == 0) irc_do_names(NULL,_usr->fd); else if ((strncmp ( msg, "WHOWAS", 6))==0) return irc_do_whowas(); else if ((strncmp ( msg, "WHOIS", 5)) == 0) return irc_do_whois(); else if ((strncmp ( msg, "WHO", 3)) == 0) irc_do_who(); else if ((strncmp ( msg, "AWAY", 4)) == 0) irc_do_away(); else if ((strncmp ( msg, "MODE", 4)) == 0) irc_do_mode(); else if ((strncmp ( msg, "NMODE",5)) == 0) irc_do_nmode(); else if ((strncmp ( msg, "ISON", 4)) == 0) irc_do_ison(); else if ((strncmp ( msg, "KNOCK",5)) == 0) irc_do_knock(); else if ((strncmp ( msg, "PRIVMSG", 7)) == 0) irc_do_privmsg(); else if ((strncmp ( msg, "NOTICE" , 6)) == 0) irc_do_notice(); else if ((strncmp ( msg, "QUIT", 4)) == 0) return irc_do_quit(); else if ((strncmp ( msg, "HELP", 4)) == 0) irc_do_help(_usr); else if ((strncmp ( msg, "SERVERHELP", 10)) == 0) irc_do_help(_usr); else if ((strncmp ( msg, "SERVICES", 8)) == 0 ) irc_do_services(); // extra`s else if ((strncmp ( msg, "MOTD", 4)) == 0) core_motd(_usr,MOTD_FILE); else if ((strncmp ( msg, "IRCDNAME", 8)) == 0) irc_names(); else if ((strncmp ( msg, "TIME", 4)) == 0) irc_do_time(); else if ((strncmp ( msg, "INFO", 4)) == 0) irc_do_info(); else if ((strncmp ( msg, "STATS",5)) == 0) irc_do_stats(); else if ((strncmp ( msg, "RULES", 5)) == 0) core_motd(_usr,RULES_FILE); else if ((strncmp ( msg, "VHOST", 5)) == 0) irc_do_vhost(); else if ((strncmp ( msg, "BUGS", 4)) == 0) core_motd(_usr,BUG_FILE); else if ((strncmp ( msg, "IRCOP", 5)) == 0) irc_do_ircop(); else if ((strncmp ( msg, "ADMIN", 5)) == 0) irc_do_admin(); else if ((strncmp ( msg, "PING", 4)) == 0) irc_do_ping(NULL,NULL); else if ((strncmp ( msg, "PONG", 4)) == 0) irc_do_pong(NULL,NULL,NULL); // STUFF FOR LINKED else if ((strncmp ( msg, "LINKS", 5)) == 0) irc_do_links(); // oper commands else if ((strncmp ( msg, "OPER", 4)) == 0) irc_do_oper(); else if ((strncmp( msg, "WALLOPS",7)) == 0) irc_do_wallops(); else if ((strncmp( msg, "LOCOPS", 6)) == 0) irc_do_locops(); else if ((strncmp( msg, "GLOBOPS", 7)) == 0) irc_do_globops(); else if ((strncmp( msg, "NETGLOBAL", 9)) == 0) irc_do_netglobal(); else if ((strncmp( msg, "SETHOST", 7)) == 0) irc_do_sethost(NULL,NULL); else if ((strncmp( msg, "DIE",3)) == 0 ) irc_do_die(); else if ((strncmp( msg, "RESTART", 7)) == 0) irc_do_restart(); else if ((strncmp( msg, "SETNICK", 7)) == 0) irc_do_setnick(); else if ((strncmp( msg, "FJOIN", 5)) == 0) irc_do_fjoin(NULL); else if ((strncmp( msg, "REHASH",6)) == 0) irc_do_rehash(); else if ((strncmp( msg, "BRING" , 5)) == 0) irc_do_bring(NULL,NULL); else if ((strncmp( msg, "KILL" , 4)) == 0) irc_do_kill(NULL,NULL); else if ((strncmp ( msg, "LA", 2)) == 0) { /* This code should work on. ** Unix and WIN32 */ } else return msg_build(_usr->fd,0,IRC_UNKNOW_COMMAND,_usr->Nick,msg); } return 0; } WAS REPLACED BY int irc_command2 ( char * message, struct __user *us ) { int i=0; _usr = us; msg = s_upercommand ( strdup(message) ); while ( la[i].cmd ) { if ( (strncmp(msg, la[i].cmd,strlen(la[i].cmd))) == 0) { la[i].used ++; if ( la[i].enabled == YES ) return la[i].funct(); } ++i; } return msg_build(_usr->fd,0,IRC_UNKNOW_COMMAND,_usr->Nick,msg); }